Added skills, shortcuts, and bugifixes++

This commit is contained in:
2026-02-18 11:58:45 +01:00
parent 09463d7620
commit 54a8c47df4
24 changed files with 3172 additions and 239 deletions

View File

@@ -189,11 +189,41 @@ struct HelpView: View {
@Environment(\.dismiss) var dismiss
@State private var searchText = ""
@State private var expandedCommandID: UUID?
private let settings = SettingsService.shared
private var allCategories: [CommandCategory] {
var cats = helpCategories
let shortcuts = settings.userShortcuts
if !shortcuts.isEmpty {
let shortcutCommands = shortcuts.map { s in
CommandDetail(
command: s.command + (s.needsInput ? " <text>" : ""),
brief: s.description,
detail: "Template: \(s.template)",
examples: s.needsInput ? ["\(s.command) your text here"] : [s.command]
)
}
cats.append(CommandCategory(name: "Your Shortcuts", icon: "bolt.fill", commands: shortcutCommands))
}
let activeSkills = settings.agentSkills.filter { $0.isActive }
if !activeSkills.isEmpty {
let skillCommands = activeSkills.map { skill in
CommandDetail(
command: skill.name,
brief: skill.skillDescription,
detail: "Active skill — injected into system prompt automatically.\n\nContent:\n\(skill.content)",
examples: []
)
}
cats.append(CommandCategory(name: "Active Skills", icon: "brain", commands: skillCommands))
}
return cats
}
private var filteredCategories: [CommandCategory] {
if searchText.isEmpty { return helpCategories }
if searchText.isEmpty { return allCategories }
let q = searchText.lowercased()
return helpCategories.compactMap { cat in
return allCategories.compactMap { cat in
let matched = cat.commands.filter {
$0.command.lowercased().contains(q) ||
$0.brief.lowercased().contains(q) ||