()
| 166 | }; |
| 167 | |
| 168 | const handleSave = async () => { |
| 169 | try { |
| 170 | setSaving(true); |
| 171 | setError(null); |
| 172 | |
| 173 | await api.slashCommandSave( |
| 174 | commandForm.scope, |
| 175 | commandForm.name, |
| 176 | commandForm.namespace || undefined, |
| 177 | commandForm.content, |
| 178 | commandForm.description || undefined, |
| 179 | commandForm.allowedTools, |
| 180 | commandForm.scope === 'project' ? projectPath : undefined |
| 181 | ); |
| 182 | |
| 183 | // Track command creation |
| 184 | trackEvent.slashCommandCreated({ |
| 185 | command_type: editingCommand ? 'custom' : 'custom', |
| 186 | has_parameters: commandForm.content.includes('$ARGUMENTS') |
| 187 | }); |
| 188 | |
| 189 | setEditDialogOpen(false); |
| 190 | await loadCommands(); |
| 191 | } catch (err) { |
| 192 | console.error("Failed to save command:", err); |
| 193 | setError(err instanceof Error ? err.message : "Failed to save command"); |
| 194 | } finally { |
| 195 | setSaving(false); |
| 196 | } |
| 197 | }; |
| 198 | |
| 199 | const handleDeleteClick = (command: SlashCommand) => { |
| 200 | setCommandToDelete(command); |
nothing calls this directly
no test coverage detected