Skip to content

fix(web): keep sidebar search results when opening threads - #30278

Open
voltcrash wants to merge 3 commits into
pingdotgg:mainfrom
voltcrash:voltcrash/keep-sidebar-search-results
Open

voltcrash wants to merge 3 commits into
pingdotgg:mainfrom
voltcrash:voltcrash/keep-sidebar-search-results

Conversation

@voltcrash

Copy link
Copy Markdown
Contributor

Problem

Opening a sidebar search result discards the query and results. Inspecting the wrong conversation means retyping the same query to try the next match.

Fixes #30276.

Change

Keep the sidebar search when a result opens, for both clicks and Enter. Escape and the clear button still exit search; message-content matches still open Find at the matching text.

Scope and approval

Submitted under the very small, focused obvious-bug exception: remove the query reset from result selection so browsing existing search matches does not destroy the search. No new setting, search mode, ranking, or persisted state. Web and desktop share this sidebar; native mobile has a separate flow and is unchanged.

Verification

  • Added Sidebar.search.browser.test.tsx, mounting the real app against the existing fake environment. It fails on main because selecting the first match empties the query; passes with the fix while opening a second match by keyboard, then clearing with the button and Escape.
  • vp run check:changed upstream/main passes: format, lint, knip, affected typechecks, 140 tests in 6 files, and React Compiler verification.
  • Real Chromium client, Linux, 1280×800, isolated worktree state with two Replay (dev) conversations: before, opening a result clears search; after, successive result clicks retain the query and both results. Content-only search for clamp still opens Find with clamp; clear and Escape return to the normal sidebar.
  • Not checked in a standalone Electron app, native mobile, other browsers, or real relay/tunnel connections. No server or wire behavior changed.
Before selecting a result After selecting a result
Before: query disappears and the normal sidebar returns After: query and both matches remain visible

Recordings: before · after: open two matches without retyping.

Reviewed with review-loop: 1 round with Claude Opus 5.5. Reviewer verdict: approved.

Created with GPT-6.1 Sol in the Codex harness through T3 Code.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Nov 3, 2026
@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Selecting a sidebar thread search result now preserves the query and results while navigating to the thread. Browser tests cover click and keyboard selection, and clearing the search.

Changes: Sidebar thread search

Layer / File(s) Summary
Preserve search during thread navigation
apps/web/src/components/Sidebar.tsx, apps/web/src/components/Sidebar.search.browser.test.tsx
Thread selection no longer clears the search query. Browser tests check that the query and results remain after click or keyboard selection, and that clearing the search empties the input and hides the results.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Possibly related issues

Merge Risk: Minimal · up to f913b

Search results should remain available while opening threads, with explicit clearing still available. No actionable merge-blocking risk is identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: retaining sidebar search results when opening threads.
Description check Passed The description includes the problem, change, scope and approval rationale, focused verification with observed results, screenshots, recordings, linked issue, and untested environments.
Linked Issues check Passed Issue [#30276] requires result selection by click or Enter to preserve the sidebar query and results, while clear and Escape exit search. apps/web/src/components/Sidebar.tsx removes the query reset …
Out of Scope Changes check Passed The pull request changes only the sidebar result-selection behavior and adds a focused browser regression test. Both changes directly support issue [#30276]. No unrelated feature, server behavior, mob…
Full details: Linked Issues check

Explanation

Issue [#30276] requires result selection by click or Enter to preserve the sidebar query and results, while clear and Escape exit search. apps/web/src/components/Sidebar.tsx removes the query reset during result selection. Sidebar.search.browser.test.tsx covers result navigation, keyboard selection, retained results, and clearing the search. The summary also states that message-content matches still open Find.

Full details: Out of Scope Changes check

Explanation

The pull request changes only the sidebar result-selection behavior and adds a focused browser regression test. Both changes directly support issue [#30276]. No unrelated feature, server behavior, mobile flow, setting, ranking, or persisted state change is reported.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between cd5af66 and f913bb9.

Files selected for processing: 2

  • apps/web/src/components/Sidebar.search.browser.test.tsx
  • apps/web/src/components/Sidebar.tsx
Files with no reviewable changes: 1

  • apps/web/src/components/Sidebar.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

@juliusmarminge juliusmarminge added bugfix Fix PR opened by an issue lead; enters the PR loop pr:gate-failed A land gate failed labels Nov 3, 2026
@maria-rcks

Copy link
Copy Markdown
Collaborator

Note

Written by gpt-6.1-sol on behalf of Maria

Verified in a real dev environment

verified unchanged head f0ab7466d820aa5c1340397b5c32ff9a4d61a99d on linux with the real dev server, repo Playwright, and /usr/bin/google-chrome.

  • reproduced on github/main (15707a84b0): searching sidebar orchard returned two conversations; clicking alpha opened it but emptied the query and removed the search results.
  • created a project for a real git repository and both conversations through the app. real Codex gpt-6.1-sol turns completed through the local proxy. stopped main, then used the same app-created conversation data on the exact pr head.
  • on the pr, clicking a result and selecting another with arrow keys and Enter opened the expected conversations while retaining the query and both results.
  • the clear button and Escape still cleared search. a message-only search for zephyrcontentonly still opened find with the same query and highlighted both matches. a fresh Codex turn on the pr returned pr head provider verified. in the client.
  • checked light mode at 1440×900 and dark mode at 1280×800.
  • vp run check:changed HEAD^ passed through blacksmith after installing its browser prerequisites: format, lint, both knip passes, affected typechecks, 140 tests in 6 files, and React Compiler verification. existing GitHub CI checks also passed.

before: main clears the query after opening alpha.

main clears the sidebar search after opening alpha

after: the same conversation opens with the query and both results retained.

pr retains the sidebar query and both results after opening alpha

Not verified

standalone Electron, native iOS/Android, macOS/Windows, other browsers, and relay/tunnel connections were not exercised on this linux VM. native mobile uses a separate sidebar flow and is unchanged by this diff.

@voltcrash
voltcrash force-pushed the voltcrash/keep-sidebar-search-results branch from f0ab746 to cd5af66 Compare November 7, 2026 11:30

Copy link
Copy Markdown
Member

Evidence

Real web app, Chromium, 1280×800, light theme; fresh synthetic state on each commit. Search Orchard, click the first match, then re-enter the same term on both sides and use ArrowDown + Enter to open the other match. Finally exercise Clear and Escape.

The scenario failed on base and passed on head: base lost the query and results after click and Enter; head retained both. Clear and Escape exited search on both.

Interaction Before After
Commit b3fdf2b10f f913bb9163
Click Before: click clears search After: click retains search
Enter Before: Enter clears search After: Enter retains search
Clear Before: Clear exits search After: Clear exits search
Escape Before: Escape exits search After: Escape exits search
Recording Before After

Exact successful scenario. Recordings omit startup pairing screens.

AI-assisted; verified with the tests and tools listed above.

Not shown:

  • Message-content results opening Find: a supplemental run searched the synthetic message text but returned no selectable result, so this path was not demonstrated.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Fix PR opened by an issue lead; enters the PR loop pr:gate-failed A land gate failed size:XS 0-9 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Sidebar search clears when opening a matching thread

3 participants