()
| 352 | |
| 353 | // Get filtered commands for navigation - using the same sorting logic as SlashCommandUI |
| 354 | const getFilteredCommands = () => { |
| 355 | return slashCommands |
| 356 | .filter((cmd) => |
| 357 | cmd.name.toLowerCase().includes(slashCommandFilter.toLowerCase()), |
| 358 | ) |
| 359 | .sort((a, b) => { |
| 360 | const aStartsWith = a.name |
| 361 | .toLowerCase() |
| 362 | .startsWith(slashCommandFilter.toLowerCase()); |
| 363 | const bStartsWith = b.name |
| 364 | .toLowerCase() |
| 365 | .startsWith(slashCommandFilter.toLowerCase()); |
| 366 | |
| 367 | if (aStartsWith && !bStartsWith) return -1; |
| 368 | if (!aStartsWith && bStartsWith) return 1; |
| 369 | |
| 370 | return a.name.localeCompare(b.name); |
| 371 | }); |
| 372 | }; |
| 373 | |
| 374 | // Handle slash command selection |
| 375 | const selectSlashCommand = (commandName: string) => { |
no test coverage detected