Skip to content

Fix file content search reset per worktree#294

Merged
AmethystLiang merged 2 commits intomainfrom
improve-file-content-search-reset
Apr 4, 2026
Merged

Fix file content search reset per worktree#294
AmethystLiang merged 2 commits intomainfrom
improve-file-content-search-reset

Conversation

@AmethystLiang
Copy link
Copy Markdown
Contributor

Problem

  • File content search state was global, so switching or deleting worktrees could leave the sidebar showing stale query text, filters, collapse state, and results from a different worktree.
  • The reset path around worktree removal was not covered by store cascade tests, which made this regression easy to reintroduce.

Solution

  • Scope file search state by worktree in the editor store and update the search sidebar to read and write the active worktree's state.
  • Drop cached file-search state when a worktree is removed, with an inline why-comment documenting the cleanup requirement.
  • Add cascade tests for search-state cleanup/preservation and extract the include/exclude filter UI into a small component to keep the sidebar implementation within repo lint limits.

@AmethystLiang AmethystLiang merged commit 2f11087 into main Apr 4, 2026
1 check passed
@AmethystLiang AmethystLiang deleted the improve-file-content-search-reset branch April 4, 2026 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant