Skip to content

fix(worktree): fix sidebar search filtering for text and bare numbers#3423

Merged
gregpriday merged 1 commit intodevelopfrom
feature/issue-3420-worktree-sidebar-search-broken
Mar 16, 2026
Merged

fix(worktree): fix sidebar search filtering for text and bare numbers#3423
gregpriday merged 1 commit intodevelopfrom
feature/issue-3420-worktree-sidebar-search-broken

Conversation

@gregpriday
Copy link
Collaborator

Summary

  • Removes the # prefix requirement from number-based worktree search — bare numbers like 3351 now match by exact issueNumber/prNumber, consistent with #3351
  • Fixes alwaysShowActive and alwaysShowWaiting bypassing matchesFilters when a search query is present; active/waiting worktrees now respect the filter when the user is actively searching
  • Unifies the pinned-worktree query path in App.tsx (worktreeMatchesQuery) and the scrollable path (matchesFilters) so both use the same number-vs-text logic

Resolves #3420

Changes

  • src/lib/worktreeFilters.ts — drop startsWith("#") guard so parseExactNumber result is used for any numeric query
  • src/App.tsxworktreeMatchesQuery updated to match; alwaysShowActive/alwaysShowWaiting now only bypass filtering when there is no active query
  • src/components/Worktree/WorktreeOverviewModal.tsx — same number-search fix applied to the modal's filter path
  • src/lib/__tests__/worktreeFilters.test.ts — new tests covering bare-number matching and text filtering correctness

Testing

Unit tests pass (npm test -- worktreeFilters). Typecheck and lint clean. The four acceptance criteria from the issue are covered by new and existing tests.

- 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
@gregpriday
Copy link
Collaborator Author

Review status: Ready

Cross-PR holistic review — no file overlap or semantic conflicts with other open PRs (#3421, #3422, #3424). All 4 PRs are independent and safe to merge in any order.

@gregpriday gregpriday merged commit 8aa516e into develop Mar 16, 2026
4 checks passed
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.

Worktree sidebar search broken: no filtering and number search requires # prefix

1 participant