feat: Add keyboard shortcuts for quick actions in data browser
New Pull Request Checklist
- [x] Add changes to documentation (guides, repository pages, in-code descriptions)
Summary by CodeRabbit
-
New Features
- Customizable keyboard shortcuts for reloading data and toggling info panels, usable in the Data Browser
- New Settings page to configure, save, reset, and disable keyboard shortcuts; shortcuts can be stored on the server
- Text inputs now support focus callbacks and max-length limits
-
Documentation
- README: added Keyboard Shortcuts section with configuration and disabling instructions
-
Style
- Improved placeholder appearance and settings form button layout
βοΈ Tip: You can customize this high-level summary in your review settings.
π Thanks for opening this pull request! We appreciate your effort in improving the project. Please let us know once your pull request is ready for review.
π Walkthrough
Walkthrough
Adds server-backed keyboard shortcuts: new settings UI and route, a KeyboardShortcutsManager library with validation/matching and server persistence, DataBrowser integration to act on shortcuts, minor TextInput prop/style additions, README docs and small settings styling.
Changes
| Cohort / File(s) | Summary |
|---|---|
DocsREADME.md |
Added "Keyboard Shortcuts" section and navigation entry under "Other Configuration Options". |
Text input UIsrc/components/TextInput/TextInput.react.js, src/components/TextInput/TextInput.scss |
TextInput: added onFocus prop and maxLength attribute; placeholder styling added in SCSS. |
Dashboard routing & navsrc/dashboard/Dashboard.js, src/dashboard/DashboardView.react.js |
Registered /settings/keyboard-shortcuts route; added Keyboard Shortcuts nav item; added getCurrentRoute() helper and defensive route extraction. |
Settings UIsrc/dashboard/Settings/KeyboardShortcutsSettings.react.js, src/dashboard/Settings/DashboardSettings/DashboardSettings.react.js, src/dashboard/Settings/Settings.scss |
New KeyboardShortcutsSettings component (load/save/reset/validate shortcuts, duplicate checks, notifications); updated settings description to include Keyboard Shortcuts; added .form_buttons styling. |
Data browser behaviorsrc/dashboard/Data/Browser/DataBrowser.react.js |
Loads server keyboard shortcuts on mount, stores keyboardShortcuts state, extends handleKey to match dataBrowserReloadData and dataBrowserToggleInfoPanels via matchesShortcut, conditionally triggers refresh/toggle and prevents default. |
Library: shortcuts managersrc/lib/KeyboardShortcutsPreferences.js |
New module exporting DEFAULT_SHORTCUTS, default KeyboardShortcutsManager (getKeyboardShortcuts, saveKeyboardShortcuts, resetKeyboardShortcuts, isServerConfigEnabled) and helpers isValidShortcut, createShortcut, matchesShortcut, backed by ServerConfigStorage. |
Removed: settings gluesrc/dashboard/Settings/SettingsData.react.js, src/lib/ParseApp.js |
Removed SettingsData component and ParseApp methods fetchSettingsFields/saveSettingsFields used previously for batched settings retrieval/save. |
Sequence Diagram(s)
sequenceDiagram
participant User as User (keyboard)
participant UI as Settings UI
participant Manager as KeyboardShortcutsManager
participant Server as ServerConfigStorage
participant Browser as DataBrowser
User->>UI: open Keyboard Shortcuts settings
UI->>Manager: getKeyboardShortcuts(appId)
Manager->>Server: read settings.keyboard.binding.*
Server-->>Manager: stored bindings / empty
Manager-->>UI: merged shortcuts (defaults + stored)
UI-->>User: render fields
User->>UI: edit & Save
UI->>Manager: saveKeyboardShortcuts(appId, shortcuts)
Manager->>Server: write settings.keyboard.binding.* (per shortcut)
Server-->>Manager: success
Manager-->>UI: save result
Note over Browser,Manager: runtime keyboard handling
Browser->>Manager: (on mount) getKeyboardShortcuts(appId)
Manager->>Server: read bindings
Manager-->>Browser: shortcuts
User->>Browser: press key
Browser->>Manager: matchesShortcut(event, shortcut)?
Manager-->>Browser: true/false
Browser-->>Browser: invoke action (reload/toggle) if matched
Estimated code review effort
π― 4 (Complex) | β±οΈ ~45 minutes
- Areas needing extra attention:
src/lib/KeyboardShortcutsPreferences.jsβ validation, modifier handling, server read/write semantics and error paths.src/dashboard/Settings/KeyboardShortcutsSettings.react.jsβ async save/reset flows, duplicate detection, UI focus/select behavior, timed notifications.src/dashboard/Data/Browser/DataBrowser.react.jsβ integration with existing keyboard handling, focus/input guards, and conditional toggle/refresh logic.- Removal impact:
src/dashboard/Settings/SettingsData.react.jsandParseAppmethods removed β review call sites/consumers for regressions.
Possibly related PRs
- parse-community/parse-dashboard#2992 β modifies DataBrowser keyboard handling and input-focus guards; overlaps with the new shortcut handling logic.
- parse-community/parse-dashboard#3027 β touches DataBrowser refresh flow that the new
dataBrowserReloadDatashortcut invokes. - parse-community/parse-dashboard#2958 β adds server-config storage primitives used by the new
KeyboardShortcutsManager.
Pre-merge checks and finishing touches
β Failed checks (1 warning)
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Description check | β οΈ Warning | The PR description is largely incomplete, missing critical sections like Issue Description and Approach while only confirming documentation changes were made. | Complete the description by specifying the issue reference (Closes: #), detailing the implementation approach, and confirming all TODOs before merge are addressed. |
β Passed checks (2 passed)
| Check name | Status | Explanation |
|---|---|---|
| Title check | β Passed | The title accurately captures the main feature being addedβkeyboard shortcuts for quick actions in the data browserβand aligns with the substantial changes across multiple files. |
| Docstring Coverage | β Passed | Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. |
β¨ Finishing touches
- [ ] π Generate docstrings
π§ͺ Generate unit tests (beta)
- [ ] Create PR with unit tests
- [ ] Post copyable unit tests in a comment
π Recent review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
π₯ Commits
Reviewing files that changed from the base of the PR and between da42fb163754c5156ad046b62874ef017da929ff and 246bfbb38a27c36925e1996d88c51279fe4f82db.
π Files selected for processing (3)
src/dashboard/Dashboard.js(2 hunks)src/dashboard/Settings/SettingsData.react.js(0 hunks)src/lib/ParseApp.js(0 hunks)
π€ Files with no reviewable changes (2)
- src/dashboard/Settings/SettingsData.react.js
- src/lib/ParseApp.js
π§ Files skipped from review as they are similar to previous changes (1)
- src/dashboard/Dashboard.js
β° Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Docker linux/amd64
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 @coderabbitai help to get the list of available commands and usage tips.
:white_check_mark: Snyk checks have passed. No issues have been found so far.
| Status | Scanner | Total (0) | ||||
|---|---|---|---|---|---|---|
| :white_check_mark: | Open Source Security | 0 | 0 | 0 | 0 | 0 issues |
:computer: Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.
π This change has been released in version 8.2.0-alpha.7