feat(ui): quick switcher - Ctrl/Cmd+K palette to jump anywhere (LC-260) #308

Merged
longjacksonle merged 2 commits from feat/lc-260-quick-switcher into main 2026-06-14 04:32:28 +02:00

What

Adds a command-palette quick switcher (LC-260). Ctrl/Cmd+K opens a centered modal whose single input live-filters the viewer's rooms (current enclave), DM conversations, and people; Enter or click navigates to the chosen one. An empty query shows rooms + DMs as a sensible default. This is the fast-jump the app was missing - today you scroll the sidebar.

How

  • GET /switcher?q=&enclave_id= (routes::switcher) returns a flat, access-correct, capped listbox fragment, assembled from the queries the sidebar and people-search already use: list_rooms_in_enclave (name-filtered), list_user_dm_rooms + find_user_by_id (label-filtered), and search_users (people, to start a new DM). Results respect room visibility, DM membership, profile visibility, and blocks. A person already shown as a DM is de-duplicated (both rows would point at the same /dm/{id}). enclave_id is parsed leniently so the home view's empty value doesn't 400.
  • templates/switcher_modal.html: singleton modal in the persistent shell, mirroring shortcuts_modal.html (.modal-backdrop/.modal-panel, Esc + backdrop close, __lcDialogTrap). The input opts into the shared search.js combobox nav (Arrow/Enter clicks the highlighted anchor). The IIFE handles the Ctrl/Cmd+K chord, stamps the current enclave id read from the sidebar nav id, focuses/clears the input, and fires a default fetch on open. Esc stop-propagates so it closes the palette rather than just clearing the highlight.
  • The LC-252 shortcuts overlay now lists Ctrl/Cmd+K.
  • Strings localized in en + es.

Current-enclave room scope (consistent with the sidebar; rooms are enclave-scoped). Cross-enclave room jump is a deliberate follow-up. No new DB table or env var. Not operator-visible.

Tests

routes_switcher.rs: room match, DM-peer match, no-duplicate-person, empty-query-excludes-people, and the access gate (a private room a non-admin cannot see is absent). just test and just test-saas pass.

QA note

The open/close, Ctrl/Cmd+K chord, enclave-id stamping, and keyboard nav are JS-driven, so worth a quick manual pass before merge: open with Ctrl/Cmd+K from a room and from home; type to filter rooms/DMs/people; Arrow + Enter navigates; click navigates; Esc and backdrop close; confirm room results are scoped to the current enclave and that a room you can't access never appears.

## What Adds a command-palette quick switcher (LC-260). `Ctrl/Cmd+K` opens a centered modal whose single input live-filters the viewer's rooms (current enclave), DM conversations, and people; Enter or click navigates to the chosen one. An empty query shows rooms + DMs as a sensible default. This is the fast-jump the app was missing - today you scroll the sidebar. ## How - `GET /switcher?q=&enclave_id=` (`routes::switcher`) returns a flat, access-correct, capped listbox fragment, assembled from the queries the sidebar and people-search already use: `list_rooms_in_enclave` (name-filtered), `list_user_dm_rooms` + `find_user_by_id` (label-filtered), and `search_users` (people, to start a new DM). Results respect room visibility, DM membership, profile visibility, and blocks. A person already shown as a DM is de-duplicated (both rows would point at the same `/dm/{id}`). `enclave_id` is parsed leniently so the home view's empty value doesn't 400. - `templates/switcher_modal.html`: singleton modal in the persistent shell, mirroring `shortcuts_modal.html` (`.modal-backdrop`/`.modal-panel`, Esc + backdrop close, `__lcDialogTrap`). The input opts into the shared `search.js` combobox nav (Arrow/Enter clicks the highlighted anchor). The IIFE handles the `Ctrl/Cmd+K` chord, stamps the current enclave id read from the sidebar nav id, focuses/clears the input, and fires a default fetch on open. Esc stop-propagates so it closes the palette rather than just clearing the highlight. - The LC-252 shortcuts overlay now lists `Ctrl/Cmd+K`. - Strings localized in en + es. Current-enclave room scope (consistent with the sidebar; rooms are enclave-scoped). Cross-enclave room jump is a deliberate follow-up. No new DB table or env var. Not operator-visible. ## Tests `routes_switcher.rs`: room match, DM-peer match, no-duplicate-person, empty-query-excludes-people, and the access gate (a private room a non-admin cannot see is absent). `just test` and `just test-saas` pass. ## QA note The open/close, `Ctrl/Cmd+K` chord, enclave-id stamping, and keyboard nav are JS-driven, so worth a quick manual pass before merge: open with Ctrl/Cmd+K from a room and from home; type to filter rooms/DMs/people; Arrow + Enter navigates; click navigates; Esc and backdrop close; confirm room results are scoped to the current enclave and that a room you can't access never appears.
feat(ui): quick switcher - Ctrl/Cmd+K palette to jump anywhere (LC-260)
Some checks failed
check-secrets / Kingfisher (push) Successful in 6s
check-secrets / Nosey parker (push) Successful in 6s
check-secrets / TruffleHog (push) Successful in 6s
check-secrets / Kingfisher (pull_request) Successful in 4s
check-secrets / TruffleHog (pull_request) Successful in 5s
check-secrets / Nosey parker (pull_request) Successful in 6s
Check / clippy + fmt + tests (pull_request) Failing after 10s
efc0956e7c
Adds a command-palette quick switcher. Ctrl/Cmd+K opens a centered modal whose single input live-filters the viewer's rooms (current enclave), DM conversations, and people, and navigates to the chosen one on Enter or click. An empty query shows rooms + DMs as a default.

GET /switcher returns a flat, access-correct, capped listbox fragment built from the same queries the sidebar and people-search already use (list_rooms_in_enclave, list_user_dm_rooms, search_users), so results respect room visibility, DM membership, profile visibility, and blocks. People already shown as a DM are de-duplicated. The modal shell mirrors shortcuts_modal.html (modal-backdrop/panel, Esc + backdrop close, __lcDialogTrap focus trap) and reuses the shared search.js combobox nav (Arrow/Enter); it stamps the current enclave id read from the sidebar nav id so room results scope correctly, and the empty enclave_id from the home view parses cleanly. Ctrl/Cmd+K toggles open/close.

The LC-252 shortcuts overlay now lists Ctrl/Cmd+K. Strings localized in en + es. Tests cover room/DM/person matches, the no-duplicate-person rule, the empty-query default, and the access gate (a private room a non-admin cannot see is absent).

#LC-260
#LC-261

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Merge remote-tracking branch 'origin/main' into feat/lc-260-quick-switcher
All checks were successful
check-secrets / Nosey parker (push) Successful in 3s
check-secrets / TruffleHog (pull_request) Successful in 5s
check-secrets / Kingfisher (pull_request) Successful in 8s
check-secrets / TruffleHog (push) Successful in 6s
check-secrets / Nosey parker (pull_request) Successful in 6s
check-secrets / Kingfisher (push) Successful in 7s
Create release / Create release from merged PR (pull_request) Has been skipped
Check / clippy + fmt + tests (pull_request) Successful in 2m19s
7b2b7c6f1c
# Conflicts:
#	server/src/routes/mod.rs
longjacksonle deleted branch feat/lc-260-quick-switcher 2026-06-14 04:32:28 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/lets-chat!308
No description provided.