feat: add cmd+k command palette#90
Open
ulascanzorer wants to merge 13 commits into
Open
Conversation
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.
Summary
Task Reference: [MYMR-191]
Adds a global ⌘K / Ctrl+K command palette that lets any authenticated user jump to projects (across every team they belong to), tasks (across every project they belong to), and the
/settingsroute from any route underAppShell. Replaces the two disabledJump/Search or jumpstubs inTopBarandSidebar(expanded + compact) with live affordances that open the same palette.The palette is built from scratch on top of the existing
motion+useModalChromemodal primitives (nocmdkdependency, no new packages), with a proper WAI-ARIA combobox + listbox keyboard model: Up/Down/Home/End/Enter/Esc,role=\"combobox\"+role=\"listbox\"+role=\"option\", andaria-activedescendantdriving the highlight. Task search is debounced 300 ms and capped at 10 rows per source; the SQL query joinstaskstoprojectsand filters byprojects.organizationId IN current_user_orgs()(defense-in-depth on top of RLS).Stacked on the MYMR-208 branch.
Type of change
Testing
bun run dev(palette opens via ⌘K + every trigger; arrows / Enter / Esc behave; cross-project task search returns results scoped to the caller's orgs; deep link?task=<id>selects the task on landing and is stripped from the URL).bun run lint)bun run typecheck)bun test tests/data/task.test.ts): empty / whitespace queries return[]; cross-org isolation; taskRef short-circuit; tag substring match. The full suite has one pre-existing failure intests/realtime/access.test.ts:147(unrelated to this change; reproducible on the parent branch).Notes for reviewer
WorkspaceClientholds selection in component state). The palette deep-links via/project/<id>?task=<taskId>;WorkspaceClientnow seedsselectedTaskIdfrom that query param on mount and strips it immediately so back-navigation doesn't re-select stale tasks. Minimal surgical change to keep task-jump useful.CompactNavIconextension. The collapsed sidebar'sCompactNavIconpreviously only supported disabled rows. Extended with one optionalonClickprop; disabled styling is untouched whenonClickis absent.useEffect. The palette uses the prev-tracker render-phase reset pattern (mirrorsWorkspaceClient'sprevSelectedTaskId) for open/close, debounced-query, and option-list-length resets. The fetch effect only writes via its async transition callback.withUserContext(ctx.userId, ...)AND filters bycurrent_user_orgs(); both layers must be wrong for cross-team leakage. New test covers the cross-org boundary explicitly.