Skip to content

add Cmd/Ctrl+Shift+F shortcut to toggle focus mode - #6209

Open
MohammadKanaan wants to merge 1 commit into
usememos:mainfrom
MohammadKanaan:main
Open

add Cmd/Ctrl+Shift+F shortcut to toggle focus mode#6209
MohammadKanaan wants to merge 1 commit into
usememos:mainfrom
MohammadKanaan:main

Conversation

@MohammadKanaan

Copy link
Copy Markdown

Closes #6105.

@MohammadKanaan
MohammadKanaan requested a review from a team as a code owner August 18, 2026 13:39
@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 87d11ebc-9dbb-4efe-bc05-b624be14803e

📥 Commits

Reviewing files that changed from the base of the PR and between c9324f9 and ace7cae.

📒 Files selected for processing (7)
  • web/src/components/MemoEditor/Editor/extensions.ts
  • web/src/components/MemoEditor/Editor/index.tsx
  • web/src/components/MemoEditor/components/EditorContent.tsx
  • web/src/components/MemoEditor/index.tsx
  • web/src/components/MemoEditor/types/components.ts
  • web/tests/editor-keys.test.ts
  • web/tests/memo-editor-extensions.test.ts

Included review availability: Your plan includes up to 10 reviews per rolling hour; 9 remain after this review.


Walkthrough

The memo editor adds an optional onToggleFocusMode callback. The editor registers Meta/Ctrl+Shift+F key bindings and invokes the callback through a ref. EditorContent and the memo editor pass the callback through the component tree. Tests cover both platform shortcuts and verify that they do not change the document.

Suggested reviewers: boojack

Merge Risk: ⚪ Minimal · up to ace7c

This PR adds a keyboard shortcut for toggling focus mode, with no actionable merge-blocking risk remaining beyond normal checks and review.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the Cmd/Ctrl+Shift+F shortcut and its focus-mode toggle behavior.
Description check ✅ Passed The description links the pull request to issue #6105, which directly covers the implemented focus-mode shortcut.
Linked Issues check ✅ Passed The changes implement Cmd/Ctrl+Shift+F for focus-mode toggling, preserve document content, and remain frontend-only as required by #6105.
Out of Scope Changes check ✅ Passed The changes are limited to editor key bindings, callback propagation, and tests for the requested frontend focus-mode shortcut.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Aug 18, 2026

Copy link
Copy Markdown

Greptile Summary

The PR adds an in-editor Cmd/Ctrl+Shift+F shortcut that invokes the existing focus-mode transition without modifying memo content.

  • Adds Meta/Control focus-mode bindings to the CodeMirror keymap.
  • Threads the focus-mode callback from MemoEditor through EditorContent into the editor boundary.
  • Adds tests for both platform modifier variants.

Confidence Score: 5/5

The PR appears safe to merge, with no concrete blocking or independently actionable issues identified.

The new key bindings reach the existing focus-mode handler through a ref-backed callback, current production callers always provide that callback, and tests cover both modifier variants while confirming memo content remains unchanged.

Important Files Changed

Filename Overview
web/src/components/MemoEditor/Editor/extensions.ts Adds both Meta-Shift-F and Ctrl-Shift-F bindings ahead of standard editor keymaps and marks handled events as consumed.
web/src/components/MemoEditor/Editor/index.tsx Uses the existing ref-backed callback pattern so the stable CodeMirror instance invokes the latest focus-mode handler.
web/src/components/MemoEditor/components/EditorContent.tsx Forwards the optional focus-mode callback through the React-to-CodeMirror boundary.
web/src/components/MemoEditor/index.tsx Connects the keyboard shortcut to the existing focus-mode transition handler.
web/tests/editor-keys.test.ts Verifies both modifier variants invoke the callback once without changing editor content.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Key[Cmd/Ctrl + Shift + F] --> CodeMirror[CodeMirror keymap]
  CodeMirror --> Editor[Editor callback ref]
  Editor --> Content[EditorContent callback]
  Content --> MemoEditor[MemoEditor focus-mode handler]
  MemoEditor --> State[Toggle focus-mode state]
Loading

Reviews (1): Last reviewed commit: "feat(editor): add Cmd/Ctrl+Shift+F short..." | Re-trigger Greptile

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.

Add shortcut for focus mode

1 participant