Skip to content

Let the @ picker match threads past the first 200 - #5476

Merged
ymichael merged 2 commits into
mainfrom
slopcop/issue-5475
Oct 14, 2026
Merged

ymichael merged 2 commits into
mainfrom
slopcop/issue-5475

Conversation

@bb-slop-cop

@bb-slop-cop bb-slop-cop Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Human comments

What was wrong

The composer @ picker matches threads against the sidebar's in-memory thread list, but cut that list to the first 200 entries before matching (buildThreadMentionCandidates in apps/app/src/hooks/queries/thread-queries.ts). The cap came over from the older GET /threads?limit=200 fetch when #1884 moved the picker onto sidebar data. The sidebar list is ordered project by project with personal threads last, so past 200 active threads, later projects and all personal threads become unmentionable, even by exact title.

What changed

  • Match against every sidebar thread: the 200-entry slice is removed and the wrapper folded into selectThreadMentionCandidates. The picker still shows at most 8 thread rows. The short startup fallback fetch before the sidebar loads keeps its 200 limit.
  • One hook-level regression test (usePromptMentions.coverage.test.tsx): 215 sidebar threads; an exact search for the last one must return it.

Deviations from the issue's proposals, deliberately not included:

  • Refetching the sidebar on every mention open (staleTime: 0): the rename and new-project cases do not reproduce in the real app. Realtime delivered both instantly on unfixed main, and reconnects already invalidate the cache. The change would add a full sidebar-bootstrap download on every @.
  • Gating path rows on the settled query: the change lives in the shared usePathSuggestions, which the right-panel file search (NewTabFileSearch) also uses. There it would blank results and show "Searching files..." on every keystroke. In the @ picker the stale rows linger for about 120 ms, so this is left for a picker-scoped follow-up if wanted.

How you verified

  • The regression test fails on unfixed main and passes with the fix.
  • pnpm exec turbo run test --filter=@bb/app -- src/hooks/usePromptMentions src/hooks/usePathSuggestions src/hooks/queries/thread-queries src/hooks/queries/sidebar-navigation-query src/hooks/threadMentionSuggestions src/hooks/pathMentionSuggestions src/hooks/promptMentionCandidates: 64 tests across 9 files pass.
  • pnpm exec turbo run lint typecheck --filter=@bb/app passes.
  • Manual, pnpm start:worktree with 215 seeded threads: typing @Bulk thread 1 in the new-thread composer was missing that thread before (results started at 199) and lists it first after. On the unfixed build, a CLI rename (bb thread update --title) and a CLI-created project both appeared in the picker immediately.

Fixes #5475

AGENT GENERATED

🤖 Generated with Claude Code

Drop the sidebar refetch on every mention open and the shared path-row
gating: realtime already delivers renames and new projects, and the path
gating blanked file-search results on every keystroke.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ymichael ymichael changed the title Refresh mention candidates and suppress outdated path rows Let the @ picker match threads past the first 200 Oct 14, 2026
@ymichael
ymichael merged commit 6b8a999 into main Oct 14, 2026
28 checks passed
@ymichael
ymichael deleted the slopcop/issue-5475 branch October 14, 2026 19:54
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.

Composer @ picker serves stale and missing threads and projects (realtime-only cache, 200-entry cap, ungated path rows)

2 participants