Add Command Palette component with global shortcut and route integration#267
Add Command Palette component with global shortcut and route integration#267
Conversation
- Implemented `CommandPaletteComponent` with keyboard navigation, route filtering, and localization support. - Integrated global `Cmd/Ctrl + K` shortcut for activation. - Updated `LayoutContainer` to include the Command Palette. - Extracted reusable route entry utilities and updated existing navigation logic for consistency. - Added tests for route entry extraction, palette functionality, and shortcut behavior.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: aeb1c878b8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const selectedIndex = ref(0) | ||
|
|
||
| const routeActions = computed<WeFaRouteEntry[]>(() => { | ||
| return routeCommandPaletteEntries(router.options.routes as RouteRecordRaw[]) |
There was a problem hiding this comment.
Read command entries from router matcher
This computes palette entries from router.options.routes, which only reflects the initial router config and does not include routes registered later with router.addRoute(...) (for example, plugin-driven routes such as those added in legalConsentPlugin.install). As a result, dynamically injected routes can never appear in the command palette even if they set meta.wefa.showInCommandPalette, so users lose navigation paths that exist in the app. Build entries from the live matcher (router.getRoutes()) instead of the static options array.
Useful? React with 👍 / 👎.
CommandPaletteComponentwith keyboard navigation, route filtering, and localization support.Cmd/Ctrl + Kshortcut for activation.LayoutContainerto include the Command Palette.Improvements needed:
descriptionand atitle?