Resolve archived thread names in sidebar mentions - #2527
Merged
Conversation
brsbl
marked this pull request as ready for review
August 27, 2026 06:31
ymichael
added a commit
that referenced
this pull request
Aug 27, 2026
## Human comments ## What was wrong The archived-thread title regression added in #2527 replaced the shared `sdk.threads.resolveMentions` method without restoring it. Because later tests in `ThreadRow.test.tsx` reuse that SDK object, they could inherit the canned result and become order-dependent or falsely green. ## What changed The resolver regression now restores its exact spy in `finally`, including when rendering or an assertion throws. The file teardown also asserts that the shared resolver is no longer mocked, preserving the isolation invariant for future tests. This is test-only: no production, wire, CLI, SDK, or documentation behavior changed. ## How you verified - Before the cleanup, the targeted Turbo run failed its teardown isolation assertion, and the full file reported 42 failures after the leaking test. - `pnpm exec turbo run test --filter=@bb/app -- src/components/sidebar/ThreadRow.test.tsx` — 71 passed. - `pnpm exec prettier --check apps/app/src/components/sidebar/ThreadRow.test.tsx` — passed. - `git diff --check origin/main...HEAD` — passed. - Rebasing from `ad79bbb5` onto current `origin/main` preserved the stable patch ID exactly. Follow-up to #2527; no issue. > AGENT GENERATED
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.
Human comments
What was wrong
Serialized
@thread:<id>mentions in sidebar titles used only the active sidebar cache. When the referenced thread was archived and dropped from that cache, the title renderer eagerly created a resolved-looking pill whose label was the raw thread ID, bypassing the existing bounded mention-resolution route even though that route can resolve archived threads.What changed
Threadlabel while resolution is pending instead of flashing a raw ID; preserve existing literal behavior for legacy noncanonical and naked thread IDs.No server/daemon wire, CLI, SDK, configuration, or public contract changed.
How you verified
pnpm exec turbo run test --filter=@bb/app -- src/components/sidebar/ThreadRow.test.tsx— 71 passed; the regression fails on the merge base because the resolver is never called.pnpm exec turbo run test --filter=@bb/app -- src/views/thread-detail/ThreadDetailHeader.test.tsx src/components/thread/ThreadTitleMentions.resources.test.ts src/components/ui/markdown-thread-mentions.test.tsx— 50 passed.pnpm exec turbo run typecheck --filter=@bb/app— passed.pnpm exec turbo run lint --filter=@bb/app— passed with existing unrelated warnings.Visual evidence
Both captures use the same archived target thread, source thread, route, viewport, and persisted fixture; only the compared revision changes.
Before — merge base
31a190ddb5f0ffb86cb8dcd80482497663de2685After — PR head
02bba578d9dc5391ff3ad208199668dd29f296deFull responsive visual-evidence record
BB-Thread-ID: thr_huyx3zg3n4