Repository navigation
Description
Bug: Slash Command Dropdown Selection Not Working
Description
The slash command dropdown modal appears when typing /, but selecting an item does nothing. The modal shows commands correctly, but clicking on an item or pressing Enter on a selected item has no effect.
Root Cause
There is a prop vs event naming mismatch between the SlashCommandDropdown component and its usage in base-node.svelte:
In slash-command-dropdown.svelte (line 11):
export let onselect: ((_command: SlashCommand) => void) | undefined = undefined;The component expects a callback prop called onselect and calls it directly (line 98):
onselect?.(command);In base-node.svelte (line 543):
<SlashCommandDropdown
on:select={handleSlashCommandSelect}
/>The parent component is passing an event listener with on:select, expecting a Svelte custom event to be dispatched.
Impact
- Users cannot select slash commands from the dropdown
- The only way to use slash commands is by typing them directly (e.g.,
/task,/header1) - This breaks the primary UX for node type conversion
Expected Behavior
When clicking on a slash command item or pressing Enter on a selected item, the dropdown should:
- Dispatch a custom Svelte event with the selected command
- Close the dropdown
- Insert the command content and convert the node type
Proposed Solution
Update slash-command-dropdown.svelte to use Svelte's event dispatcher pattern instead of callback props:
- Import
createEventDispatcherfrom 'svelte' - Create a dispatcher:
const dispatch = createEventDispatcher() - Replace
onselect?.(command)withdispatch('select', command) - Remove the
onselectprop - Update the
oncloseprop similarly
This matches the pattern used by NodeAutocomplete component which works correctly.
Files Affected
packages/desktop-app/src/lib/components/ui/slash-command-dropdown/slash-command-dropdown.svelte- Tests may need updates to use event mocking instead of callback props
Labels
bug, foundation, high-priority
Acceptance Criteria
-
slash-command-dropdown.svelteusescreateEventDispatcherfor events - Clicking a slash command item dispatches
selectevent with command data - Pressing Enter on selected item dispatches
selectevent - Clicking outside or pressing Escape dispatches
closeevent - Component interface matches
NodeAutocompletepattern - All existing tests pass
- Manual testing confirms slash commands work via dropdown selection
Activity
Fix slash command dropdown selection not working (closes #187)
Add integration tests for slash command callback wiring
Bug: Slash Command Dropdown Selection Not Working (#189)
feat(phase-3): Add comprehensive test coverage for Phase 3 operations…
Phase 3: Advanced & Regression Test Coverage (Sections 9-12, 28 tests) (
Fix 19 frontend test failures by adding database mode guards
Fix 19 frontend test failures by adding database mode guards (#410)
Bug: Slash Command Dropdown Selection Not Working (#189)
Phase 3: Advanced & Regression Test Coverage (Sections 9-12, 28 tests) (
Fix 19 frontend test failures by adding database mode guards (#410)
Bug: Slash Command Dropdown Selection Not Working (#189)
Phase 3: Advanced & Regression Test Coverage (Sections 9-12, 28 tests) (
Fix 19 frontend test failures by adding database mode guards (#410)
Bug: Slash Command Dropdown Selection Not Working (#189)
Phase 3: Advanced & Regression Test Coverage (Sections 9-12, 28 tests) (
Fix 19 frontend test failures by adding database mode guards (#410)