feat(ui): unify the two sidebar search boxes (LC-369) #380
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/lc-369-search-consolidation"
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?
Closes LC-369. Part of the LC-364 redesign epic.
What
Collapses the two stacked sidebar search inputs into one combobox with a Messages / People segmented control, and relocates the unread-only filter to a proper icon toggle on the room-list header. File:
server/templates/partials/sidebar.html.#sidebar-search-inputcombobox + a two-button segmented control (Messages / People). Clicking a tab rewrites the input'shx-get(/searchvs/users/search) and placeholder, then re-fires the current query into the shared#sidebar-search-resultspopover. Both endpoints stay reachable and unchanged.search.jsstill owns ArrowUp/Down/Enter nav over[role=option]rows; the saved-searches-on-empty popover (messages mode) still works. The saved-search delete button and the two route doc comments are repointed from the old#search-msg-results/#search-people-resultsids to the unified container.aria-label+ styled tooltip;aria-pressed(flipped by the existing__lcToggleUnreadOnly) drives an accent fill, and it still toggles the CSSdata-lc-unread-onlyattribute that hides read rows.Notes
The tab switcher is one document-level delegated handler wired once via
window.__lcSearchTabsWired(the sidebar partial OOB-swaps, so the inline script must not stack listeners). Two new i18n keys (sidebar-search-tab-messages,sidebar-search-tab-people) added toenandes.Testing
./dev/cargo check -p lets-chat-server- clean.just build-css- clean.just testandjust test-saas- both green (incl.i18n_catalog).🤖 Generated with Claude Code
Collapse the two stacked sidebar search inputs ("Search messages..." and "Search people...") into one combobox with a Messages / People segmented control, and relocate the unread-only filter to a proper icon toggle on the room-list header. The segmented control swaps which backend the single input targets: a tab click rewrites the input's hx-get (/search vs /users/search) and placeholder, then re-fires the current query into the shared #sidebar-search-results popover. Both endpoints stay reachable and unchanged; search.js still owns keyboard nav over [role=option] rows, and the saved-searches-on-empty behavior (messages mode) is preserved. The tab switcher is one document-level delegated handler wired once (the sidebar partial OOB-swaps, so the inline script must not stack listeners). The saved-search delete button and the two route doc comments are repointed from the old #search-msg-results / #search-people-results ids to the unified container. The unread-only filter, previously a small text toggle, becomes a funnel icon button with aria-label + styled tooltip; aria-pressed (flipped by the existing __lcToggleUnreadOnly) drives an accent fill, and it still toggles the CSS data-lc-unread-only attribute. Two new i18n keys (sidebar-search-tab-messages / -people) added to en and es. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>