docs(editor): align PlateEditor onSave JSDoc with Mod+Shift+S chord#1386
docs(editor): align PlateEditor onSave JSDoc with Mod+Shift+S chord#1386mvanhorn wants to merge 1 commit into
Conversation
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
|
@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. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR corrects the JSDoc for the ChangesPlateEditor save shortcut documentation
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 |
|
Heads up @MODSetter -- the CI failures here are all repo-side config, not from this docs-only PR:
This PR only touches JSDoc in |
Aligns the
PlateEditoronSaveJSDoc with the registered keyboard chord. The doc said⌘+S / Ctrl+Sbut theSaveShortcutPluginregistersMod+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.onSaveinsurfsense_web/components/editor/plate-editor.tsxfrom "⌘+S / Ctrl+Sshortcut is registered" to "⌘+Shift+S / Ctrl+Shift+Sshortcut 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.Shiftto match the doc.Screenshots
None applicable — single-line JSDoc edit, no rendered output.
API Changes
Change Type
Testing Performed
Verified by grepping the file: the JSDoc now matches the
Key.Mod, Key.Shift, "s"chord array inSaveShortcutPlugin.Checklist
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
PlateEditorcomponent'sonSaveprop 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+Sto avoid conflicts with the browser's native "Save Page As" functionality. The updated comment now matches the actualMod+Shift+Schord implementation and explains the rationale for including the Shift key.⏱️ Estimated Review Time: 5-15 minutes
💡 Review Order Suggestion
surfsense_web/components/editor/plate-editor.tsxSummary by CodeRabbit
⌘+Shift+S(Mac) orCtrl+Shift+S(Windows/Linux) to avoid browser conflicts, and a save button is available in the toolbar.