Skip to content

feat: add command palette for navigation#790

Open
shogun444 wants to merge 1 commit into
Talenttrust:mainfrom
shogun444:feature/navigation-command-palette
Open

feat: add command palette for navigation#790
shogun444 wants to merge 1 commit into
Talenttrust:mainfrom
shogun444:feature/navigation-command-palette

Conversation

@shogun444

Copy link
Copy Markdown

Description

Closes #726

Adds a keyboard-accessible command palette for application navigation.

What changed

  • Added a new CommandPalette component mounted from src/app/layout.tsx
  • Added global Cmd+K / Ctrl+K keyboard shortcut to open the palette
  • Added searchable navigation entries for:
    • Home
    • Contracts
    • Milestones
    • Reputation
  • Implemented keyboard navigation with:
    • Arrow Up / Arrow Down
    • Enter to navigate
    • Escape to close
  • Reused the existing useDialogFocusTrap hook for focus management and restoration
  • Added reduced-motion support using the existing useMediaQuery hook
  • Prevented the shortcut from opening while typing inside editable elements (input, textarea, select, and contenteditable)
  • Ensured duplicate navigation results are not displayed
  • Added comprehensive tests covering keyboard interaction, filtering, navigation, accessibility behavior, and focus management

Type of Change

  • Bug fix (non-breaking change that resolves an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Refactor (no functional change, internal code improvement)
  • Documentation update

Pre-flight Checklist

  • npm run lint passes with no errors
  • npm test passes with no failures
  • npm run build completes successfully

Testing & Coverage

  • Module test coverage for impacted files meets or exceeds the 95% minimum threshold
  • If this PR adds or modifies UI components, accessibility tests were written using the shared utilities in src/test-utils/a11y.tsx

What was tested?

Added automated tests covering:

  • Opening the palette with Cmd+K and Ctrl+K
  • Preventing the shortcut while typing in editable fields
  • Navigation filtering by label and keywords
  • Keyboard navigation using Arrow keys
  • Navigation via Enter
  • Mouse selection
  • Closing with Escape
  • Focus restoration after closing
  • Duplicate result prevention
  • Empty-state rendering
  • Reduced-motion behavior

A total of 18 new tests were added.

Project verification:

  • npm run lint
  • npm test (1278 tests across 74 suites passing)
  • npm run build

Accessibility & Security Notes

Accessibility

  • Keyboard accessible via Cmd+K / Ctrl+K
  • Proper combobox, listbox, and option ARIA roles
  • aria-activedescendant used for active option tracking
  • Focus is trapped while the palette is open and restored on close
  • Reduced-motion preferences are respected

Security

N/A — this change only adds client-side navigation functionality and does not modify authentication, wallet logic, authorization, or API behavior.

@drips-wave

drips-wave Bot commented Jul 25, 2026

Copy link
Copy Markdown

@shogun444 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

Add a command-palette entry for navigation

1 participant