fix: Enter key not creating new line in memo mode#4967
Open
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
Open
fix: Enter key not creating new line in memo mode#4967devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
Conversation
- 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>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
✅ Deploy Preview for hyprnote canceled.
|
✅ Deploy Preview for char-cli-web canceled.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:Add missing
prosemirror-view/style/prosemirror.cssimport — 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-prosemirrorlibrary expects to be present.Remove redundant state management in
dispatchTransaction— The old handler manually calledthis.state.applyTransaction(tr)andthis.updateState(newState), duplicating whatuseEditorfrom@handlewithcare/react-prosemirroralready does internally. This double state application can cause conflicts between React state and the ProseMirror view state, potentially preventing transactions (likesplitBlockfrom Enter) from taking effect.Review & Testing Checklist for Human
prosemirror-view/style/prosemirror.cssimport adds styles like.ProseMirror-selectednode { outline: 2px solid #8cf }and selection-related styles that may affect the editor's visual appearance.onUpdate(save) still fires correctly — The simplifieddispatchTransactionnow checkstr.docChangedinstead oftransactions.some(t => t.docChanged). Confirm that edits are still being persisted.Notes
src/editor/chat/index.tsx) with the broken session editor — both use@handlewithcare/react-prosemirrorbut the session editor was missing the CSS import and had a more complexdispatchTransaction.Link to Devin session: https://app.devin.ai/sessions/078f377777df476b8a230c16b3a77899
Requested by: @ComputelessComputer