Skip to content

feat: shortcut-registry#380

Open
gjermundgaraba wants to merge 1 commit intobacknotprop:mainfrom
gjermundgaraba:feat/shortcut-registry
Open

feat: shortcut-registry#380
gjermundgaraba wants to merge 1 commit intobacknotprop:mainfrom
gjermundgaraba:feat/shortcut-registry

Conversation

@gjermundgaraba
Copy link
Copy Markdown

Background

I wanted to add a shortcut, and when I started to look into the code, I felt an enormous itch to not add another shortcut until there was a more sustainable solution. So, I spent a few good hours on it over the weekend to try to design a usable system.

I am more than happy to iterate on this, if this is something you are interested in :)

Sorry for the amount of code in this PR, but I wanted to make a proper solution ^^

Summary

  • Introduces a centralized keyboard shortcut registry (packages/ui/shortcuts/) with typed scope definitions, a binding parser, and runtime dispatcher — replacing scattered ad-hoc keydown handlers across the codebase
  • Migrates plan editor, review editor, and shared UI components to use registry-based shortcuts
  • KeyboardShortcuts.tsx help modal now renders dynamically from the registry instead of hardcoded lists
  • Each app (editor, review-editor) defines its own shortcut scopes and composes them into a surface-level registry
  • Marketing site gets an Astro component that auto-generates shortcut reference docs from the registry

@backnotprop
Copy link
Copy Markdown
Owner

Going to have a look!

@backnotprop
Copy link
Copy Markdown
Owner

Started some review! I will try to get through it this week and I can also fix the conflicts

@gjermundgaraba
Copy link
Copy Markdown
Author

Sounds good! Let me know if can assist or adjust anything. :)

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.

2 participants