Repository navigation
Add keyboard shortcut help dialog to discover available shortcuts (? key) - #68200
Conversation
1bf713e to
cb89317
Compare
|
Interesting! I think we should get rid of the keyboard tooltip on the Grid view while we are at it then. |
bbovenzi
left a comment
There was a problem hiding this comment.
Final note. I think we should keep a json file of all the existing shortcuts in one place instead of the useShortcut building the list on render.
A single file source of truth will be much easier for maintainers to know what shortcuts already.
|
@bbovenzi Just to make sure I understand the suggestion correctly, are you primarily looking for:
The current implementation intentionally uses the live registry so the dialog only shows shortcuts that are actually available in the current context. |
The first one. I think having a single source of truth in the code would help with maintainability. We can have nested objects in the json block for global vs per page shortcuts though. |
79fe957 to
7740a25
Compare
|
How about keeping the catalog as a .ts file instead of JSON? Happy to switch to JSON if you'd prefer, though. |
|
An idea: Should the shortcut keys themselves also be localized/translated? |
|
Nit: should the shortcuts we show be scoped down to the current page? |
|
@choo121600 yes a ts file works for me. |
198fb34 to
6219251
Compare
6219251 to
a61bbdf
Compare
a61bbdf to
40028d1
Compare
pierrejeambrun
left a comment
There was a problem hiding this comment.
Not blocking but we probably need to clean the translation from remaining "Press ... for ... that could come directly from the common.json shortcuts key.
* Add keyboard shortcut help dialog to discover available shortcuts (? key) (#68200) * feat: keyboard shortcuts help dialog (press ?) * remove unnecessary useCallback and useMemo hooks * drop grid keyboard shortcut tooltip * centralize shortcut definitions in a single catalog * use nesting to reuse concept translation keys * register code viewer fullscreen shortcut in the catalog (cherry picked from commit 70bb308) * [v3-3-test] Clean up graph/grid UI (#69883) Backport of #69883 to v3-3-test. Applied on top of the #68200 backport, so the only branch-specific adaptation is dropping the showPresetFilters change to GridFilters.tsx — the Preset Filters feature (#68484) is not on v3-3-test. (cherry picked from commit 707b1cc) --------- Co-authored-by: Yeonguk Choo <[email protected]>
* Add keyboard shortcut help dialog to discover available shortcuts (? key) (#68200) * feat: keyboard shortcuts help dialog (press ?) * remove unnecessary useCallback and useMemo hooks * drop grid keyboard shortcut tooltip * centralize shortcut definitions in a single catalog * use nesting to reuse concept translation keys * register code viewer fullscreen shortcut in the catalog (cherry picked from commit 70bb308) * [v3-3-test] Clean up graph/grid UI (#69883) Backport of #69883 to v3-3-test. Applied on top of the #68200 backport, so the only branch-specific adaptation is dropping the showPresetFilters change to GridFilters.tsx — the Preset Filters feature (#68484) is not on v3-3-test. (cherry picked from commit 707b1cc) --------- Co-authored-by: Yeonguk Choo <[email protected]>


Why
The UI includes many keyboard shortcuts, but there is currently no way to discover them.
This PR adds a help dialog that can be opened with ? and shows the shortcuts available on the current page, grouped by category.
How
Shortcuts register themselves when mounted, so the dialog always reflects the shortcuts that are actually available.
A thin
useShortcutwrapper arounduseHotkeysprovides this functionality without changing existing shortcut behaviour.Was generative AI tooling used to co-author this PR?
claude opus 4.8
{pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.