Skip to content

feat: implement keyboard shortcuts for power users#392

Open
Ugasutun wants to merge 2 commits into
MettaChain:mainfrom
Ugasutun:main
Open

feat: implement keyboard shortcuts for power users#392
Ugasutun wants to merge 2 commits into
MettaChain:mainfrom
Ugasutun:main

Conversation

@Ugasutun
Copy link
Copy Markdown

@Ugasutun Ugasutun commented Jun 1, 2026

Closes #114

📝 Description

This PR introduces global keyboard shortcuts to improve navigation speed and productivity for frequent users, resolving #114. It establishes a centralized keyboard event listener system to capture single-key shortcuts, modal dismissals, and sequential chorded shortcuts (e.g., G then P), while ensuring input fields are respected so typing naturally inside text fields isn't interrupted.

🛠️ Key Changes

1. Global Keyboard Listener & Context Awareness

  • Implemented a custom React hook/global event listener to capture keydown events.

  • Added boundary checks so shortcuts are automatically ignored when a user is actively typing inside an input, textarea, or content-editable element.

2. Implemented Shortcuts

  • / : Instantly focuses the main global search bar.

  • Escape : Dismisses the active modal overlay or dialog window.

  • ? : Toggles an overlay displaying a helpful cheat sheet of all available shortcuts.

  • GP : Sequence key chord that navigates the user directly to the Properties route.

  • GD : Sequence key chord that navigates the user directly to the Dashboard route.

3. UI Polish

  • Added minor accessibility indicators (e.g., a small visual [/] badge in the search bar placeholder when not focused).

  • Created the shortcuts help modal triggered by the ? key.

📋 Acceptance Criteria Checklist

Shortcut | Action | Status | Notes -- | -- | -- | -- / | Focus search bar | [ ] | Instantly sets focus and highlights text if applicable. Escape | Close modal/dialog | [ ] | Closes top-most open modal smoothly. ? | Show keyboard shortcuts help | [ ] | Toggles the visual shortcut reference guide. G + P | Go to Properties | [ ] | Listens for sequence and triggers router navigation. G + D | Go to Dashboard | [ ] | Listens for sequence and triggers router navigation.

🧪 Verification & Manual Testing Steps

1. General Interactions

  • Open the app and press ? to confirm the shortcuts instruction modal displays correctly.

  • Press Escape to close that modal.

  • Press / and verify your cursor is placed instantly into the global search bar. Type some text to ensure shortcuts like G or P don't trigger while you are typing inside it.

2. Chord Navigation Sequences

  • Click away from any inputs, then tap G followed quickly by P. Verify the app routes to the Properties view.

  • Tap G followed quickly by D. Verify the app routes back to the main Dashboard.

- Add KeyboardShortcutsProvider with global event handling
- Focus search on / key press
- Close modal/dialog on Escape key
- Show help dialog on ? key
- Navigate to Properties on G+P sequence
- Navigate to Dashboard on G+D sequence
- Add SequenceIndicator for visual feedback
- Add useKeyboardShortcut hook for component integration
- Add comprehensive test coverage
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Jun 1, 2026

@Ugasutun Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@nanaf6203-bit
Copy link
Copy Markdown
Contributor

@Ugasutun please go through your code, these changes are too much for the task assigned to you.

@Ugasutun
Copy link
Copy Markdown
Author

Ugasutun commented Jun 6, 2026

I was just trying to improvise. I don't know if I can still change it. Sorry for the late reply

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.

Improvement: Add keyboard shortcuts for power users

2 participants