-
Notifications
You must be signed in to change notification settings - Fork 84
Added keyboard shortcuts for field actions in Action Center #6919
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added keyboard shortcuts for field actions in Action Center #6919
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
fc9bb3e to
2e400be
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Greptile Overview
Greptile Summary
This PR adds keyboard shortcuts for field actions in the Action Center to improve user efficiency when processing discovered assets. The implementation includes a new useFieldActionHotkeys hook that handles shortcuts for approve (a), confirm (c), ignore (i), restore (r), open drawer (o), and open classification select (e).
Key changes:
- New
useFieldActionHotkeyshook with context-aware keyboard shortcuts - Auto-sync drawer content with focused list item during keyboard navigation
- Renamed
DROPDOWN_ACTIONS_DISABLED_TOOLTIPtoACTIONS_DISABLED_MESSAGEfor reuse across tooltips and hotkey warnings - Added
urnprop toClassificationSelectwithdata-classification-selectattribute for DOM targeting
Issues found:
- Missing
updateSelectedListItemin dependency arrays for fouruseHotkeyscalls, which could cause stale closures and incorrect behavior when the function reference changes
Confidence Score: 4/5
- This PR is safe to merge after fixing the missing dependency arrays
- The implementation is well-structured with proper separation of concerns, but has critical dependency array issues in the hotkeys hook that could lead to stale closures. Once the missing
updateSelectedListItemdependency is added to the four useHotkeys calls, the PR will be safe to merge. - Pay close attention to
useFieldActionHotkeys.ts- fix the missing dependencies before merging
Important Files Changed
File Analysis
| Filename | Score | Overview |
|---|---|---|
| clients/admin-ui/src/features/data-discovery-and-detection/action-center/fields/useFieldActionHotkeys.ts | 4/5 | New hook implementing keyboard shortcuts for field actions with proper DOM manipulation and context-aware behavior |
| clients/admin-ui/src/features/data-discovery-and-detection/action-center/fields/page.tsx | 5/5 | Integrated the new hotkeys hook and added drawer sync effect, renamed constant for clarity |
6 files reviewed, 4 comments
...n-ui/src/features/data-discovery-and-detection/action-center/fields/useFieldActionHotkeys.ts
Show resolved
Hide resolved
...n-ui/src/features/data-discovery-and-detection/action-center/fields/useFieldActionHotkeys.ts
Show resolved
Hide resolved
...n-ui/src/features/data-discovery-and-detection/action-center/fields/useFieldActionHotkeys.ts
Show resolved
Hide resolved
...n-ui/src/features/data-discovery-and-detection/action-center/fields/useFieldActionHotkeys.ts
Show resolved
Hide resolved
speaker-ender
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we think the behavior here is fine I can approve but I'd like to revisit some of these patterns.
More specifically, making the actions generic + dynamic so that way it's easy to re-use for other screens.
clients/admin-ui/src/features/data-discovery-and-detection/action-center/fields/page.tsx
Outdated
Show resolved
Hide resolved
9d25084 to
863d3c5
Compare
863d3c5 to
f9d4514
Compare
Ticket ENG-1599
Description Of Changes
Added keyboard shortcuts to the Action Center fields page to improve user efficiency when processing discovered assets. Users can now:
ato approve the focused itemcto confirm/promote the focused itemito ignore/mute the focused itemrto restore/un-mute the focused itemoto open the details drawer for the focused itemeto open the classification select dropdown for assigning data categories (whether in the drawer or on the list item, depending if the drawer is open)Escapeto close the classification select and return focus to the listThe shortcuts are context-aware and will display warning messages when actions are unavailable for the current item's status. The implementation includes a new
useFieldActionHotkeyshook that handles all keyboard shortcut logic, and the drawer now auto-updates to show the focused item's details when navigating with arrow keys.Code Changes
useFieldActionHotkeyshook to handle keyboard shortcuts for field actionsFIELD_ACTION_HOTKEYSconstant defining shortcut keysDROPDOWN_ACTIONS_DISABLED_TOOLTIPtoACTIONS_DISABLED_MESSAGEfor reuse across tooltips and hotkey warningsurnprop toClassificationSelectcomponent withdata-classification-selectattribute for DOM targetinguseEffectin page component to sync drawer content with focused list item during keyboard navigationSteps to Confirm
jandkkeys to navigate through the field listaon a field with a data category to approve itcon a field with a data category to confirm itito ignore a fieldron an ignored field to restore itoto open the details drawereto open the classification select dropdownEscapeto closePre-Merge Checklist
CHANGELOG.mdupdatedmaindowngrade()migration is correct and works