Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Open
MohammadKanaan wants to merge 2 commits into
usememos:mainfrom
MohammadKanaan:main
Open

add Cmd/Ctrl+Shift+F shortcut to toggle focus mode#6209
MohammadKanaan wants to merge 2 commits 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: Team

Run ID: 70ae7329-f659-49ec-af75-9fba05e08897

📥 Commits

Reviewing files that changed from the base of the PR and between de843f6 and f641a97.

📒 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
🚧 Files skipped from review as they are similar to previous changes (7)
  • web/tests/memo-editor-extensions.test.ts
  • web/tests/editor-keys.test.ts
  • web/src/components/MemoEditor/types/components.ts
  • web/src/components/MemoEditor/components/EditorContent.tsx
  • web/src/components/MemoEditor/index.tsx
  • web/src/components/MemoEditor/Editor/extensions.ts
  • web/src/components/MemoEditor/Editor/index.tsx

Included review availability: Your plan provides up to 10 included reviews per 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.

Merge Risk: ⚪ Minimal · up to f641a

The PR adds a Cmd/Ctrl+Shift+F shortcut for toggling focus mode; no actionable merge-blocking risk remains 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%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 7 files. 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 and concisely describes the main change: adding the Cmd/Ctrl+Shift+F shortcut to toggle Focus Mode.
Description check ✅ Passed The description references the linked issue that defines the requested Focus Mode shortcut, so it is related to the changeset.
Linked Issues check ✅ Passed The changes implement the requirements in issue #6105: they add Cmd/Ctrl+Shift+F bindings, invoke the existing Focus Mode toggle callback, support both macOS and other platforms, and include tests wit…
Out of Scope Changes check ✅ Passed The changes remain within scope. They update editor callback plumbing, register the requested shortcut, and add related tests. No unrelated API, storage, permission, deployment, or compatibility chang…
Full details: Linked Issues check

Explanation

The changes implement the requirements in issue #6105: they add Cmd/Ctrl+Shift+F bindings, invoke the existing Focus Mode toggle callback, support both macOS and other platforms, and include tests without changing document content.

Full details: Out of Scope Changes check

Explanation

The changes remain within scope. They update editor callback plumbing, register the requested shortcut, and add related tests. No unrelated API, storage, permission, deployment, or compatibility changes are present.

  • Fix all pre-merge checks with AI

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

@boojack
boojack force-pushed the main branch 2 times, most recently from 8c38d6b to dcef418 Compare August 30, 2026 04:49
@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

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