Skip to content

Global command pallete#158

Open
Rohan-Shridhar wants to merge 5 commits into
nensii21:mainfrom
Rohan-Shridhar:global-command-pallete
Open

Global command pallete#158
Rohan-Shridhar wants to merge 5 commits into
nensii21:mainfrom
Rohan-Shridhar:global-command-pallete

Conversation

@Rohan-Shridhar

@Rohan-Shridhar Rohan-Shridhar commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Implemented a global command palette (Ctrl+K / Cmd+K) that lets users quickly search and navigate to app pages, projects, and developers from anywhere in DevLink, with full keyboard navigation and responsive design.


Related Issue

Closes #109


Type of Change

Please check the relevant option(s):

  • Bug fix
  • New feature
  • Documentation update
  • Performance improvement
  • Refactoring
  • UI/UX enhancement
  • Tests
  • Other

Changes Made

Describe the key changes included in this pull request.

  • Added useCommandPalette hook to manage open/close state and register the global Ctrl+K / Cmd+K keyboard listener
  • Added CommandPalette component: modal overlay with autofocused search input, grouped results (Pages, Projects, Developers), arrow-key/Tab navigation, Enter-to-select, and ARIA roles for accessibility
  • Added useCommandSearch hook with 250ms debounce, parallel search across projects and developers, AbortController-based request cancellation, and static page filtering via substring match
  • Wired CommandPalette into the root layout, with router-based navigation to the correct route on selection (pages, /projects/[slug], /developers/[username])
  • Added a discoverable "⌘K" trigger badge in the navbar for users who don't know the shortcut
  • Responsive styling: full-width modal on mobile, centered max-w-xl panel on desktop, minimum 44px tap targets

Testing

Describe how you tested your changes.

  • Tested locally
  • Existing tests pass
  • Added new tests
  • UI verified
  • Cross-browser tested (if applicable)

Additional testing notes:

  • Verified Ctrl+K opens the palette on Windows/Linux and Cmd+K on Mac
  • Verified Escape and backdrop click close the palette
  • Verified ArrowUp/ArrowDown/Tab cycle through results correctly, including wrap-around, and skip group headers
  • Verified Enter navigates to the correct route for pages, projects, and developers, then closes the palette
  • Verified debounce prevents excessive API calls while typing
  • Verified stale requests are cancelled when typing quickly
  • Verified layout on mobile viewport (<640px) and desktop
  • Verified screen reader announces listbox/option roles correctly

Checklist

Before submitting this pull request, confirm the following:

  • My code follows the project's coding standards.
  • I have tested my changes locally.
  • I have updated the documentation where necessary.
  • My changes do not introduce new warnings or errors.
  • I have reviewed my own code.
  • This pull request focuses on a single feature or fix.
  • I have linked the related issue.

Additional Notes

No new external dependencies were added — search matching uses a lightweight in-house substring filter rather than a fuzzy-search library, keeping the bundle size impact minimal. Happy to swap in cmdk or Fuse.js if maintainers prefer a library-based approach.

…d shortcut and navigation - Add useCommandPalette hook for Ctrl/Cmd+K toggle - Add CommandPalette modal with grouped results, arrow-key nav, ARIA roles - Responsive Tailwind v4 styling for mobile and desktop Refs nensii21#109
…ts, developers - Add useCommandSearch with 250ms debounce and AbortController cancellation - Add substring match utility for static page filtering - Stub searchProjects/searchUsers in lib/api.ts if not already present Refs nensii21#109
…- Mount global CommandPalette in app/layout.tsx wired to useCommandSearch - Add router-based navigation on item select for pages, projects, developers - Add discoverable ⌘K trigger badge in navbar Refs nensii21#109
@nensii21

nensii21 commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Thanks for the contribution. Some of the required CI checks is currently failing. Please take a look at the workflow logs, identify the cause, and push a fix. Once all required checks pass, I'll review and proceed with the PR.

@Rohan-Shridhar

Copy link
Copy Markdown
Contributor Author

@nensii21 , PR passes all the required checks now, and the conflict with main is also resolved

@nensii21

nensii21 commented Jul 9, 2026

Copy link
Copy Markdown
Owner
image Conflicts have been arised due to your code. Please solve all conflicts.

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 Global Command Palette

2 participants