parse-dashboard icon indicating copy to clipboard operation
parse-dashboard copied to clipboard

feat: Add keyboard shortcuts for quick actions in data browser

Open mtrezza opened this issue 1 week ago β€’ 3 comments

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.

mtrezza avatar Dec 15 '25 17:12 mtrezza

πŸš€ 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
Docs
README.md
Added "Keyboard Shortcuts" section and navigation entry under "Other Configuration Options".
Text input UI
src/components/TextInput/TextInput.react.js, src/components/TextInput/TextInput.scss
TextInput: added onFocus prop and maxLength attribute; placeholder styling added in SCSS.
Dashboard routing & nav
src/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 UI
src/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 behavior
src/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 manager
src/lib/KeyboardShortcutsPreferences.js
New module exporting DEFAULT_SHORTCUTS, default KeyboardShortcutsManager (getKeyboardShortcuts, saveKeyboardShortcuts, resetKeyboardShortcuts, isServerConfigEnabled) and helpers isValidShortcut, createShortcut, matchesShortcut, backed by ServerConfigStorage.
Removed: settings glue
src/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.js and ParseApp methods 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 dataBrowserReloadData shortcut 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.

❀️ Share

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

coderabbitai[bot] avatar Dec 15 '25 17:12 coderabbitai[bot]

:white_check_mark: Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low 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.

parseplatformorg avatar Dec 15 '25 17:12 parseplatformorg

πŸŽ‰ This change has been released in version 8.2.0-alpha.7

parseplatformorg avatar Dec 15 '25 23:12 parseplatformorg