[#153] Expand Alt+Number shortcuts for universal field navigation#8
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a universal Alt+Number keyboard shortcut system across the frontend, covering both “open the Nth item” behavior on list pages and “jump to field/section” behavior on detail/form pages. It also extracts shared “editable target” detection into a utility and updates the user manual to document the new shortcut scheme.
Changes:
- Added a reusable
useNumberShortcutshook forAlt+1…Alt+0navigation + optional field-jump behavior viadata-shortcut-index. - Wired the hook +
data-shortcut-indexattributes into many pages (tickets, companies, users, categories, levels, entitlements, articles). - Updated manual chapters to reflect the new shortcut behavior.
Reviewed changes
Copilot reviewed 29 out of 29 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| src/frontend/src/utils/keyboard.ts | New shared isEditableTarget helper extracted from components/pages. |
| src/frontend/src/hooks/useNumberShortcuts.ts | New hook implementing Alt+Number shortcuts for list navigation and field jumps. |
| src/frontend/src/pages/SupportTicketsPage.tsx | Replaced per-page Ctrl+Number handler with the shared shortcuts hook. |
| src/frontend/src/pages/SupportTicketDetailPage.tsx | Enabled field-jump shortcuts + added data-shortcut-index markers for key sections/fields. |
| src/frontend/src/pages/SupportTicketCreatePage.tsx | Enabled field-jump shortcuts + added indices to key inputs/selects/editors. |
| src/frontend/src/pages/TicketWorkbenchFormPage.tsx | Enabled field-jump shortcuts + added indices to workbench form controls. |
| src/frontend/src/pages/CompaniesPage.tsx | Enabled list item shortcuts (top 10). |
| src/frontend/src/pages/CompanyFormPage.tsx | Enabled field-jump shortcuts + added indices to company form controls. |
| src/frontend/src/pages/DirectoryUsersPage.tsx | Enabled list item shortcuts (top 10). |
| src/frontend/src/pages/DirectoryUserFormPage.tsx | Enabled field-jump shortcuts + added indices to initial user fields. |
| src/frontend/src/pages/CategoriesPage.tsx | Enabled list item shortcuts (top 10). |
| src/frontend/src/pages/CategoryFormPage.tsx | Enabled field-jump shortcuts + added indices to key category fields. |
| src/frontend/src/pages/LevelsPage.tsx | Enabled list item shortcuts (top 10). |
| src/frontend/src/pages/LevelFormPage.tsx | Enabled field-jump shortcuts + added indices to key level fields. |
| src/frontend/src/pages/EntitlementsPage.tsx | Enabled list item shortcuts (top 10). |
| src/frontend/src/pages/EntitlementsListPage.tsx | Enabled list item shortcuts (top 10). |
| src/frontend/src/pages/EntitlementFormPage.tsx | Enabled field-jump shortcuts + added indices to entitlement fields. |
| src/frontend/src/pages/ArticlesPage.tsx | Enabled list item shortcuts (top 10). |
| src/frontend/src/pages/ArticleFormPage.tsx | Enabled field-jump shortcuts + added indices to article fields. |
| src/frontend/src/components/layout/AuthenticatedHeader.tsx | Switched to shared isEditableTarget utility. |
| src/frontend/src/components/editor/LexicalEditor.tsx | Added support for passing data-shortcut-index into editor wrapper. |
| doc/manual/en/24-navigation.md | Documented global behavior for Alt+Number navigation + Escape blur behavior. |
| doc/manual/en/11-tickets.md | Updated ticket chapter to describe Alt+Number list + detail shortcuts. |
| doc/manual/en/15-companies.md | Added keyboard shortcut section for company pages. |
| doc/manual/en/16-users.md | Added keyboard shortcut section for user pages. |
| doc/manual/en/17-categories.md | Added keyboard shortcut section for category pages. |
| doc/manual/en/18-entitlements.md | Added keyboard shortcut section for entitlement pages. |
| doc/manual/en/19-levels.md | Added keyboard shortcut section for levels pages. |
| doc/manual/en/09-articles.md | Added keyboard shortcut section for article pages. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+26
to
+42
| const handleKeyDown = (event: KeyboardEvent) => { | ||
| // Allow Escape key to blur any active input | ||
| if (event.key === "Escape") { | ||
| if (document.activeElement instanceof HTMLElement) { | ||
| document.activeElement.blur(); | ||
| } | ||
| return; | ||
| } | ||
|
|
||
| if ( | ||
| event.defaultPrevented || | ||
| !event.altKey || | ||
| event.ctrlKey || | ||
| event.metaKey | ||
| ) { | ||
| return; | ||
| } |
Comment on lines
+404
to
+408
| <div | ||
| className="editor-shell bg-background overflow-hidden rounded-lg border shadow w-full" | ||
| data-shortcut-index={dataShortcutIndex} | ||
| tabIndex={dataShortcutIndex ? -1 : undefined} | ||
| > |
| <div className="space-y-4"> | ||
| <h2 | ||
| className="px-1 text-3xl font-bold tracking-tight" | ||
| className="px-1 text-3xl font-bold tracking-tight outline-none" |
Comment on lines
+60
to
+64
| * `Alt+2`: Jump to Description | ||
| * `Alt+3`: Jump to Business Hours | ||
| * `Alt+4`: Jump to SLA Name | ||
| * `Alt+5`: Jump to Resolve Time | ||
| * `Alt+6`: Jump to SLA Color |
Comment on lines
+65
to
+69
| * `Alt+2`: Jump to Domains | ||
| * `Alt+3`: Jump to Phone | ||
| * `Alt+4`: Jump to Location | ||
| * `Alt+5`: Jump to Note | ||
| * `Alt+6`: Jump to SLA Level |
Comment on lines
+56
to
+58
| * `Alt+1`: Jump to Name | ||
| * `Alt+2`: Jump to Entitlement | ||
| * `Alt+3`: Jump to Description |
Comment on lines
+76
to
+79
| * `Alt+4`: Jump to Phone | ||
| * `Alt+5`: Jump to Role | ||
| * `Alt+6`: Jump to Company | ||
| * `Alt+7`: Jump to Title |
Comment on lines
+83
to
+84
| * `Alt+2`: Jump to Path | ||
| * `Alt+3`: Focus the Editor |
Comment on lines
315
to
318
| ); | ||
| }} | ||
| data-shortcut-index="4" | ||
| /> |
Comment on lines
444
to
449
| } | ||
| : current, | ||
| ); | ||
| }} | ||
| data-shortcut-index="5" | ||
| /> |
6aa3548 to
976dae4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.