feat(ui): quick switcher - Ctrl/Cmd+K palette to jump anywhere (LC-260) #308
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/lc-260-quick-switcher"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Adds a command-palette quick switcher (LC-260).
Ctrl/Cmd+Kopens 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), andsearch_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_idis parsed leniently so the home view's empty value doesn't 400.templates/switcher_modal.html: singleton modal in the persistent shell, mirroringshortcuts_modal.html(.modal-backdrop/.modal-panel, Esc + backdrop close,__lcDialogTrap). The input opts into the sharedsearch.jscombobox nav (Arrow/Enter clicks the highlighted anchor). The IIFE handles theCtrl/Cmd+Kchord, 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.Ctrl/Cmd+K.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 testandjust test-saaspass.QA note
The open/close,
Ctrl/Cmd+Kchord, 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.