fix(worktree): fix sidebar search filtering for text and bare numbers#3423
Merged
gregpriday merged 1 commit intodevelopfrom Mar 16, 2026
Merged
Conversation
- Remove redundant startsWith("#") guard in matchesFilters — parseExactNumber already handles both #123 and 123
- Gate alwaysShowActive/alwaysShowWaiting bypasses on !hasActiveQuery so text search actually filters the list
- Replace ad-hoc worktreeMatchesQuery with parseExactNumber-based logic for consistent pinned worktree filtering
- Apply same bypass fix to WorktreeOverviewModal for consistency
- Add tests for bare-number matching by issueNumber, prNumber, text fallback rejection, and whitespace padding
Collaborator
Author
This was referenced Mar 16, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
#prefix requirement from number-based worktree search — bare numbers like3351now match by exactissueNumber/prNumber, consistent with#3351alwaysShowActiveandalwaysShowWaitingbypassingmatchesFilterswhen a search query is present; active/waiting worktrees now respect the filter when the user is actively searchingApp.tsx(worktreeMatchesQuery) and the scrollable path (matchesFilters) so both use the same number-vs-text logicResolves #3420
Changes
src/lib/worktreeFilters.ts— dropstartsWith("#")guard soparseExactNumberresult is used for any numeric querysrc/App.tsx—worktreeMatchesQueryupdated to match;alwaysShowActive/alwaysShowWaitingnow only bypass filtering when there is no active querysrc/components/Worktree/WorktreeOverviewModal.tsx— same number-search fix applied to the modal's filter pathsrc/lib/__tests__/worktreeFilters.test.ts— new tests covering bare-number matching and text filtering correctnessTesting
Unit tests pass (
npm test -- worktreeFilters). Typecheck and lint clean. The four acceptance criteria from the issue are covered by new and existing tests.