Skip to content

docs(editor): align PlateEditor onSave JSDoc with Mod+Shift+S chord#1386

Open
mvanhorn wants to merge 1 commit into
MODSetter:mainfrom
mvanhorn:osc/1373-platefile-jsdoc-mod-shift-s
Open

docs(editor): align PlateEditor onSave JSDoc with Mod+Shift+S chord#1386
mvanhorn wants to merge 1 commit into
MODSetter:mainfrom
mvanhorn:osc/1373-platefile-jsdoc-mod-shift-s

Conversation

@mvanhorn
Copy link
Copy Markdown
Contributor

@mvanhorn mvanhorn commented May 12, 2026

Aligns the PlateEditor onSave JSDoc with the registered keyboard chord. The doc said ⌘+S / Ctrl+S but the SaveShortcutPlugin registers Mod+Shift+S. The Shift requirement is intentional (it avoids the browser's "Save Page As" conflict), so the right fix is to update the doc comment, not the chord — same conclusion the issue reaches.

Description

Changes the JSDoc on PlateEditorProps.onSave in surfsense_web/components/editor/plate-editor.tsx from "⌘+S / Ctrl+S shortcut is registered" to "⌘+Shift+S / Ctrl+Shift+S shortcut is registered (avoiding the browser's ⌘+S / Ctrl+S 'Save Page As' conflict) and a save button appears in the toolbar." The actual chord at line 135 (keys: [[Key.Mod, Key.Shift, "s"]]) is unchanged.

Motivation and Context

FIX #1373

Misleading doc comments on a public component prop are the kind of interface drift that nudges future contributors toward "fixing" the wrong side. Keeping JSDoc honest is cheap and prevents a regression where someone removes Key.Shift to match the doc.

Screenshots

None applicable — single-line JSDoc edit, no rendered output.

API Changes

  • This PR includes API changes

Change Type

  • Bug fix
  • New feature
  • Performance improvement
  • Refactoring
  • Documentation
  • Dependency/Build system
  • Breaking change
  • Other (specify):

Testing Performed

  • Tested locally
  • Manual/QA verification

Verified by grepping the file: the JSDoc now matches the Key.Mod, Key.Shift, "s" chord array in SaveShortcutPlugin.

Checklist

  • Follows project coding standards and conventions
  • Documentation updated as needed
  • Dependencies updated as needed
  • No lint/build errors or new warnings
  • All relevant tests are passing

AI disclosure: authored with Claude as a coding assistant; I reviewed the change before pushing.

High-level PR Summary

This PR corrects the JSDoc comment for the PlateEditor component's onSave prop to accurately reflect the keyboard shortcut that is actually registered. The documentation previously stated ⌘+S / Ctrl+S, but the implementation uses ⌘+Shift+S / Ctrl+Shift+S to avoid conflicts with the browser's native "Save Page As" functionality. The updated comment now matches the actual Mod+Shift+S chord implementation and explains the rationale for including the Shift key.

⏱️ Estimated Review Time: 5-15 minutes

💡 Review Order Suggestion
Order File Path
1 surfsense_web/components/editor/plate-editor.tsx

Need help? Join our Discord

Summary by CodeRabbit

  • Documentation
    • Clarified the editor's save keyboard shortcut uses ⌘+Shift+S (Mac) or Ctrl+Shift+S (Windows/Linux) to avoid browser conflicts, and a save button is available in the toolbar.

Review Change Stack

The JSDoc on the PlateEditorProps.onSave prop advertised the save
shortcut as Mod+S / Ctrl+S, but the registered chord in the
SaveShortcutPlugin is Mod+Shift+S. The Shift requirement is intentional
to avoid the browser's "Save Page As" dialog; update the doc comment so
it matches the implementation and notes the rationale.

Fixes MODSetter#1373
@vercel
Copy link
Copy Markdown

vercel Bot commented May 12, 2026

@mvanhorn is attempting to deploy a commit to the Rohan Verma's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 12, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 72d00e12-f572-455e-add6-b4b81cff1661

📥 Commits

Reviewing files that changed from the base of the PR and between d6618b8 and 96adde7.

📒 Files selected for processing (1)
  • surfsense_web/components/editor/plate-editor.tsx

📝 Walkthrough

Walkthrough

This PR corrects the JSDoc for the onSave prop in PlateEditor to document the actual ⌘+Shift+S / Ctrl+Shift+S keyboard shortcut instead of the outdated ⌘+S / Ctrl+S reference. The fix also clarifies that this shortcut design avoids the browser's native "Save Page As" conflict and that a save button is available in the toolbar.

Changes

PlateEditor save shortcut documentation

Layer / File(s) Summary
Update onSave JSDoc to reflect actual shortcut
surfsense_web/components/editor/plate-editor.tsx
JSDoc for the onSave prop is corrected to document the implemented ⌘+Shift+S / Ctrl+Shift+S shortcut (avoiding browser "Save Page As" conflict) and toolbar save button availability.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

A rabbit reads the docs with care,
And spots a shortcut mismatch there—
With Shift+S, the browser's spared,
The JSDoc now declares what's squared! 🐰✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: updating JSDoc documentation to align with the actual Mod+Shift+S keyboard chord implementation.
Linked Issues check ✅ Passed The PR fully addresses issue #1373 by updating the JSDoc to document the actual Mod+Shift+S shortcut and noting the browser conflict avoidance, meeting all acceptance criteria.
Out of Scope Changes check ✅ Passed The PR contains only a single JSDoc update to align documentation with implementation, with no out-of-scope changes or unrelated modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

@mvanhorn
Copy link
Copy Markdown
Contributor Author

Heads up @MODSetter -- the CI failures here are all repo-side config, not from this docs-only PR:

  • TypeScript/JavaScript Quality: pnpm/action-setup@v4 errors with Multiple versions of pnpm specified. The workflow sets version: latest while package.json has "packageManager": "pnpm@10.24.0". Easiest fix: drop the explicit version: latest from the workflow inputs and let pnpm/action-setup read it from packageManager.
  • Vercel: 'Authorization required to deploy' -- a team-access permission on your side.
  • recurseml/analysis: 'Error occurred during analysis'.
  • Submodule: fatal: No url found for submodule path 'hermes-agent' in .gitmodules -- the entry is in the tree but not declared.

This PR only touches JSDoc in PlateEditor.onSave to match the Mod+Shift+S chord; no workflow or pnpm config changes. Happy to wait on these CI fixes before re-running.

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.

Fix PlateEditor JSDoc — actual save shortcut is Mod+Shift+S, not ⌘+S

1 participant