History menu improvements

This commit is contained in:
James Magahern
2024-07-31 17:53:23 -07:00
parent a0056af8b1
commit 29057c8024
4 changed files with 35 additions and 1 deletions

View File

@@ -34,7 +34,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
private func historyMenu() -> UIMenu {
let historyItems = BrowserHistory.shared.allHistory(limit: 50).map { item in
let title = (item.title.count > 0) ? item.title : item.url.absoluteString
let title = ((item.title.count > 0) ? item.title : item.url.absoluteString)
.middleTruncatedString(maximumLength: 85)
return UIAction(title: title) { action in
UIApplication.shared.sendAction(#selector(ShortcutResponder.handleOpenURL), to: nil, from: action, for: OpenURLEvent(url: item.url))
}