New version v2.3.6
This commit is contained in:
@@ -271,7 +271,7 @@ struct CommandSuggestionsView: View {
|
||||
let selectedIndex: Int
|
||||
let onSelect: (String) -> Void
|
||||
|
||||
static let builtInCommands: [(command: String, description: String)] = [
|
||||
static let builtInCommands: [(command: String, description: LocalizedStringKey)] = [
|
||||
("/help", "Show help and available commands"),
|
||||
("/history", "View command history"),
|
||||
("/model", "Select AI model"),
|
||||
@@ -302,19 +302,19 @@ struct CommandSuggestionsView: View {
|
||||
("/mcp write off", "Disable MCP write permissions"),
|
||||
]
|
||||
|
||||
static func allCommands() -> [(command: String, description: String)] {
|
||||
static func allCommands() -> [(command: String, description: LocalizedStringKey)] {
|
||||
let shortcuts = SettingsService.shared.userShortcuts.map { s in
|
||||
(s.command, "⚡ \(s.description)")
|
||||
(s.command, LocalizedStringKey("⚡ \(s.description)"))
|
||||
}
|
||||
return builtInCommands + shortcuts
|
||||
}
|
||||
|
||||
static func filteredCommands(for searchText: String) -> [(command: String, description: String)] {
|
||||
static func filteredCommands(for searchText: String) -> [(command: String, description: LocalizedStringKey)] {
|
||||
let search = searchText.lowercased()
|
||||
return allCommands().filter { $0.command.contains(search) || search == "/" }
|
||||
}
|
||||
|
||||
private var suggestions: [(command: String, description: String)] {
|
||||
private var suggestions: [(command: String, description: LocalizedStringKey)] {
|
||||
Self.filteredCommands(for: searchText)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user