Skip to content

fix: Enter key not creating new line in memo mode#4967

Open
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
fix/1775745801-enter-key-memo-mode
Open

fix: Enter key not creating new line in memo mode#4967
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
fix/1775745801-enter-key-memo-mode

Conversation

@devin-ai-integration
Copy link
Copy Markdown
Contributor

Summary

Fixes #4964 — Enter key doesn't create a new line in the session editor's memo (raw) mode.

Two changes in apps/desktop/src/editor/session/index.tsx:

  1. Add missing prosemirror-view/style/prosemirror.css import — The chat editor already imports this, but the session editor was missing it. This CSS provides baseline ProseMirror functional styles (white-space: break-spaces, position: relative, etc.) that the @handlewithcare/react-prosemirror library expects to be present.

  2. Remove redundant state management in dispatchTransaction — The old handler manually called this.state.applyTransaction(tr) and this.updateState(newState), duplicating what useEditor from @handlewithcare/react-prosemirror already does internally. This double state application can cause conflicts between React state and the ProseMirror view state, potentially preventing transactions (like splitBlock from Enter) from taking effect.

Review & Testing Checklist for Human

  • Verify Enter key works in memo mode — Open a session note, switch to memo/raw mode, type some text, and press Enter. A new line should be created without needing Cmd+Enter.
  • Verify Enter key still works in list modes — In bullet list, ordered list, and task list modes, Enter should still split list items (and lift empty items as before).
  • Verify Cmd+Enter still inserts hard breaks — The hard break shortcut should remain functional.
  • Check for visual regressions — The new prosemirror-view/style/prosemirror.css import adds styles like .ProseMirror-selectednode { outline: 2px solid #8cf } and selection-related styles that may affect the editor's visual appearance.
  • Verify onUpdate (save) still fires correctly — The simplified dispatchTransaction now checks tr.docChanged instead of transactions.some(t => t.docChanged). Confirm that edits are still being persisted.

Notes

  • The fix was identified by comparing the working chat editor (src/editor/chat/index.tsx) with the broken session editor — both use @handlewithcare/react-prosemirror but the session editor was missing the CSS import and had a more complex dispatchTransaction.
  • This is a Tauri desktop app, so the fix could not be tested end-to-end in this environment. Manual testing on the desktop app is strongly recommended.

Link to Devin session: https://app.devin.ai/sessions/078f377777df476b8a230c16b3a77899
Requested by: @ComputelessComputer

- Add missing prosemirror-view/style/prosemirror.css import (matching chat editor)
- Simplify dispatchTransaction to avoid redundant state management that
  conflicts with useEditor's own state handling in @handlewithcare/react-prosemirror

Closes #4964

Co-Authored-By: John <john@hyprnote.com>
@devin-ai-integration
Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 9, 2026

Deploy Preview for hyprnote canceled.

Name Link
🔨 Latest commit a5c80bf
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote/deploys/69d7bc36477c9b0008d8ec4d

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 9, 2026

Deploy Preview for char-cli-web canceled.

Name Link
🔨 Latest commit a5c80bf
🔍 Latest deploy log https://app.netlify.com/projects/char-cli-web/deploys/69d7bc36cd1c2d0008f2e514

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Editor: Enter key doesn't create new line in memo mode (requires Cmd+Enter)

1 participant