-
Notifications
You must be signed in to change notification settings - Fork 12
Persist search sheet state across close/reopen #5534
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
FadhlanR
wants to merge
11
commits into
main
Choose a base branch
from
cs-12109-host-persist-search-sheet-state-query-filters-view-results
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
4677447
Persist search sheet state across close/reopen
FadhlanR ee03547
Fix backtracking assertions in persisted search sheet
FadhlanR faf77a3
Seed search sheet results on reopen and persist scroll position
FadhlanR 04c73c6
Update search-sheet blur tests to expect persistence
FadhlanR 37a7867
Report loading across the deferred search start
FadhlanR adea530
Rework search-sheet persistence to a service-owned resource
FadhlanR e42d46b
Decouple search panel from sheet service; fix scroll restore
FadhlanR a423790
Hide search results until the reopen scroll restore sticks
FadhlanR bf847b7
Reopen filter-only searches to their results view
FadhlanR c4792c8
Merge origin/main; migrate search-sheet-state to SessionService
FadhlanR bf76d9c
Fix import order after SessionService rename
FadhlanR File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Claude Code 🤖] Reopen gate misses filter-only searches — confirms the Codex bot's flag on this line, verified against the code path.
The claim. Reopening a filter-only persisted search (a type or realm selected, empty term) sends the sheet to the compact prompt instead of the results view, so the restored results stay hidden until the user changes the search.
The mechanism. This gate keys on
this.searchSheetState.searchKey.trim(), but the service treats a search as active when there's a term or a type or a realm — seehasActiveSearchinservices/search-sheet-state.ts, which is exactly what drives whethermainQuery(and so the resource) produces results. Concrete path: code mode's "Find instances" callsopenSearch('', ref)(detail-panel.gts→searchForInstances) →doExternallyTriggeredSearch('', ref)insearch-sheet/index.gtssetssearchKey = ''andselectedTypes = [ref]. A plain click-outside close keeps that state; reopening via the search button lands here →''.trim()is falsy →SearchSheetModes.SearchPrompt. Prompt ⇒isCompactis true, and insheet-results.gtsthe main-query sections render only in the non-compact{{else}}branch — the{{#if @isCompact}}branch shows recents only. The type-filtered rows are live in the resource but never shown.The fix. Gate on the service's own notion of an active search — it already covers term / URL / type / realm in one place, so the check can't drift the way a term-only re-derivation here already has. Make
hasActiveSearchpublic (dropprivateon the getter) and:hasActiveSearchis also true for a URL key (it's non-empty), so the URL-paste reopen — which likewise only renders its section in the results view — keeps working; the existing acceptance test for that stays green.Scope. Regression in this PR's new reopen behavior; should-fix here (small, and the single-source gate stops the term-vs-active-search drift from recurring). Not a crasher — blocking is your call.
Generated by Claude Code