Conversation
📝 WalkthroughWalkthroughThe PR adds device-aware behavior to EditDropLexical: it detects app/mobile contexts and propagates an Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant EditDropLexical
participant KeyboardPlugin
participant EditorHandler
User->>EditDropLexical: Focus & keypress (Enter/Escape)
Note right of EditDropLexical: derives isMobileOrApp via useDeviceInfo()
EditDropLexical->>KeyboardPlugin: handleKey(event, isMobileOrApp)
alt isMobileOrApp == true
KeyboardPlugin-->>EditDropLexical: suppress Enter (no submit)
KeyboardPlugin->>EditorHandler: allow Escape/onCancel if applicable
else isMobileOrApp == false
KeyboardPlugin->>EditorHandler: trigger onSave on Enter or onCancel on Escape
end
EditorHandler-->>User: update UI / saved state
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9a7972ba14
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
components/waves/drops/EditDropLexical.tsx (1)
378-390:⚠️ Potential issue | 🟠 MajorMobile/app Enter branch currently blocks both submit and newline insertion.
At line 389, returning
truemarksKEY_ENTER_COMMANDas handled, which stops propagation to Lexical's default Enter handlers. This prevents both form submission (intended) and newline insertion (unintended). On mobile/app, users cannot press Enter to add line breaks; only Shift+Enter works.Change to
return falseso that Lexical's default Enter behavior runs and inserts line breaks, while still preventing the save/cancel logic from executing.Proposed fix
- if (isMobileOrApp) { - return true; - } + if (isMobileOrApp) { + return false; + }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@components/waves/drops/EditDropLexical.tsx` around lines 378 - 390, The mobile/app branch in the KEY_ENTER_COMMAND handler (registered via editor.registerCommand in removeEnterListener) incorrectly returns true which marks the Enter key as handled and blocks Lexical's default newline insertion; update the handler so that when isMobileOrApp is true it returns false instead (while keeping the earlier checks that return false if mentionsRef.current?.isMentionsOpen() or waveMentionsRef.current?.isWaveMentionsOpen()) so Lexical's default Enter behavior inserts line breaks on mobile but the save/cancel logic elsewhere remains unaffected.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@components/waves/drops/EditDropLexical.tsx`:
- Around line 378-390: The mobile/app branch in the KEY_ENTER_COMMAND handler
(registered via editor.registerCommand in removeEnterListener) incorrectly
returns true which marks the Enter key as handled and blocks Lexical's default
newline insertion; update the handler so that when isMobileOrApp is true it
returns false instead (while keeping the earlier checks that return false if
mentionsRef.current?.isMentionsOpen() or
waveMentionsRef.current?.isWaveMentionsOpen()) so Lexical's default Enter
behavior inserts line breaks on mobile but the save/cancel logic elsewhere
remains unaffected.
|



Summary by CodeRabbit
New Features
Tests