feat: learn launch suggestions and preserve selection during refresh
This commit is contained in:
@@ -12,7 +12,8 @@ public struct Application: Identifiable, Sendable {
|
||||
}
|
||||
|
||||
fileprivate init(canonicalURL: URL, name: String) {
|
||||
url = canonicalURL
|
||||
url = canonicalURL.hasDirectoryPath
|
||||
? canonicalURL : URL(fileURLWithPath: canonicalURL.path, isDirectory: true)
|
||||
self.name = name
|
||||
searchableName = folded(name)
|
||||
searchableCharacters = Array(searchableName)
|
||||
@@ -137,7 +138,7 @@ private func folded(_ string: String) -> String {
|
||||
string.folding(options: [.caseInsensitive, .diacriticInsensitive], locale: searchLocale)
|
||||
}
|
||||
|
||||
private func alphabetical(_ lhs: Application, _ rhs: Application) -> Bool {
|
||||
func alphabetical(_ lhs: Application, _ rhs: Application) -> Bool {
|
||||
let order = lhs.name.localizedStandardCompare(rhs.name)
|
||||
if order != .orderedSame { return order == .orderedAscending }
|
||||
if lhs.name != rhs.name { return lhs.name < rhs.name }
|
||||
|
||||
Reference in New Issue
Block a user