Skip to content

Editor regression: cursor jumps to start, @mentions broken, slash commands stopped working #1

Description

@dev-Ninjaa

Description

After recent editor-related changes, the editor has become unstable and difficult to use.

There are three critical regressions affecting the core writing experience:

  1. Cursor unexpectedly jumps to the start/left of the block
  2. @ note mentions are not working
  3. / slash commands are not triggering

These issues make continuous writing unreliable and break core editor functionality.


Expected Behavior

  • Cursor remains stable while typing
  • Typing @:
    • Opens the note mention menu
    • Filters notes by title
    • Inserts a reference using noteId
    • Should show the metion like @xyz exactly and in blue color and clickable and when clicked will take to that note.
  • Typing /:
    • Opens the SlashMenu
    • Allows block type insertion (existing behavior)

Actual Behavior

  • Cursor jumps to the beginning of the block while typing
  • @ does nothing (no menu, no filtering)
  • / does nothing (SlashMenu does not open)
  • Editor becomes frustrating to use for longer writing sessions

Suspected Causes

Likely related to recent changes in:

  • editor/ui/Block.tsx
  • contentEditable rendering logic
  • Focus / blur handling
  • Conditional rendering for note mentions
  • Keyboard event interception

Possible causes include:

  • DOM node replacement causing caret position loss
  • Mention rendering switching between focused/unfocused states
  • Keyboard events being swallowed by mention logic
  • Conflicts between mention menu and slash menu listeners

Files to Investigate

  • editor/ui/Block.tsx
  • editor/ui/Editor.tsx
  • editor/ui/SlashMenu.tsx
  • Note mention menu implementation
  • Any recent changes touching:
    • onInput
    • onKeyDown
    • contentEditable
    • innerText / innerHTML

Steps to Reproduce

  1. Open any note
  2. Click into the editor
  3. Start typing
    → Cursor jumps to the beginning
  4. Type @
    → No mention menu appears
  5. Type /
    → Slash menu does not open

Environment

  • App: Pulm (local-first notes app)
  • Platform: Web (Tauri planned later)
  • Storage: localStorage
  • Branch: dev
  • Browser: Chromium-based (reproducible across browsers)

Severity

High / Blocking

This impacts the core editor UX and should be resolved before further feature development or desktop packaging.


Development Notes

Branch Policy

All development should happen on the dev branch.

- Do NOT push directly to `main`
- Create feature branches from `dev`
- Open pull requests targeting `dev`
- `main` is reserved for stable releases only

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions