Merge remote-tracking branch 'refs/remotes/origin/main'

This commit is contained in:
neon443 committed 2026-06-19 20:29:14 +01:00
commit f29f38558d
1 file changed
+2 -14
@@ -213,14 +213,6 @@ struct EmojiCollectionView: UIViewRepresentable {
var menuChildrem: [UIMenuElement] = []
let emojiName = self.items[indexPath.row]
// if let localImagePath = hoarder.trie.dict[emojiName]?.localImageURLString,
// let attrs = try? FileManager.default.attributesOfItem(atPath: localImagePath),
// let size = attrs[FileAttributeKey("NSFileSize")] {
// print(size, "bytes")
// let sizeLabel = UIAction(title: "\(size as! Int/1000) KB", image: nil, identifier: nil, discoverabilityTitle: nil, attributes: .disabled) { _ in }
// menuChildrem.append(sizeLabel)
// }
let packMenuItem: (EmojiHoarder, Int) -> UIAction = { hoarder, packIndex in
let pack = hoarder.emojiPacks[packIndex]
return UIAction(
@@ -245,7 +237,6 @@ struct EmojiCollectionView: UIViewRepresentable {
]
)
packMenuItems.append(createNewPackMenu)
// let addToPackMenu = UIMenu(title: "Add to Pack", image: UIImage(systemName: "square.stack.3d.up.fill"), children: packMenuItems)
menuChildrem.append(UIMenu(title: "Add to Pack", image: UIImage(systemName: "square.stack.3d.up.fill"), children: packMenuItems))
let copyName = UIAction(title: "Copy Name", image: UIImage(systemName: "doc.on.clipboard")) { action in
@@ -259,7 +250,6 @@ struct EmojiCollectionView: UIViewRepresentable {
let share = UIAction(title: "Share", image: UIImage(systemName: "square.and.arrow.up")) { action in
}
// let sharingMenu = UIMenu(options: .displayInline, children: [copyName, copyImage, share])
menuChildrem.append(UIMenu(options: .displayInline, children: [copyName, copyImage, share]))
let delete = UIAction(title: "Delete", image: UIImage(systemName: "trash")) { action in
@@ -267,15 +257,13 @@ struct EmojiCollectionView: UIViewRepresentable {
await self.hoarder.delete(emoji: self.hoarder.trie.dict[emojiName])
}
self.items.remove(at: indexPath.row)
collectionView.performBatchUpdates {
collectionView.deleteItems(at: [indexPath])
Task.detached {
await self.applySnapshot(animated: true)
}
}
delete.attributes.update(with: .destructive)
// let destructiveMenu = UIMenu(options: .displayInline, children: [delete])
menuChildrem.append(UIMenu(options: .displayInline, children: [delete]))
// let menu = UIMenu(title: emojiName, children: [addToPackMenu, sharingMenu, destructiveMenu])
let menu = UIMenu(title: emojiName, children: menuChildrem)
return UIContextMenuConfiguration(
identifier: nil,
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.