Skip to content

Bug: Slash Command Dropdown Selection Not Working #187

Closed

Description

@malibio

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:

  1. Dispatch a custom Svelte event with the selected command
  2. Close the dropdown
  3. 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:

  1. Import createEventDispatcher from 'svelte'
  2. Create a dispatcher: const dispatch = createEventDispatcher()
  3. Replace onselect?.(command) with dispatch('select', command)
  4. Remove the onselect prop
  5. Update the onclose prop 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.svelte uses createEventDispatcher for events
  • Clicking a slash command item dispatches select event with command data
  • Pressing Enter on selected item dispatches select event
  • Clicking outside or pressing Escape dispatches close event
  • Component interface matches NodeAutocomplete pattern
  • All existing tests pass
  • Manual testing confirms slash commands work via dropdown selection

Activity

  1. self-assigned this
    on Oct 8, 2025
  2. added 2 commits that reference this issue on Oct 8, 2025
    a8ae495
    3dfe508
  3. added 3 commits that reference this issue on Oct 8, 2025
    e963665
    27061ad
    0a3d477
  4. added 6 commits that reference this issue on Feb 4, 2026
    2bdf8ae
    d66b18e
    672199a
    73bfbba
    806ef4e
    3d91ea5
  5. added 3 commits that reference this issue on Feb 26, 2026
    03f04cf
    8c74b72
    1f461e3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions