Skip to content

Add Command Palette component with global shortcut and route integration#267

Draft
srozen wants to merge 1 commit intomainfrom
command-palette-component
Draft

Add Command Palette component with global shortcut and route integration#267
srozen wants to merge 1 commit intomainfrom
command-palette-component

Conversation

@srozen
Copy link
Contributor

@srozen srozen commented Mar 11, 2026

  • 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.

Improvements needed:

  • The current display is a bit weird as it simply takes available information form the route being the name, the icon and the path. There should be a prettier way to define the information reported in the command palette, maybe something specifically dedicated to that (with fallback), e.g. a description and a title ?
  • Adapt the search to work with those fields
  • Remove the icon display as this does not serve a good UX with routes having icons and others not
  • Add keyboard navigation hints at the footer of the command palette
  • Align the style with WeFa standards (make it a bit more pretty and clean)

- 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.
@srozen srozen self-assigned this Mar 11, 2026
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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[])

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@srozen srozen marked this pull request as draft March 12, 2026 15:24
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