Skip to content

Resolve archived thread names in sidebar mentions - #2527

Merged
brsbl merged 1 commit into
mainfrom
bb/fix-thread-name-rendering-thr_huyx3zg3n4
Aug 27, 2026
Merged

Resolve archived thread names in sidebar mentions#2527
brsbl merged 1 commit into
mainfrom
bb/fix-thread-name-rendering-thr_huyx3zg3n4

Conversation

@brsbl

@brsbl brsbl commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

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

  • Route canonical structured thread mentions through the existing batched thread-name resolver when sidebar metadata is unavailable.
  • Keep the visual pill and the row's accessible label synchronized with the resolved name.
  • Show a neutral Thread label while resolution is pending instead of flashing a raw ID; preserve existing literal behavior for legacy noncanonical and naked thread IDs.
  • Add a sidebar regression test covering an archived/out-of-cache mention, including its pending label, resolved label, and accessible row name.

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.
  • Chrome for Testing 152: archived-thread name rendering, no raw-ID flash, accessible row name, hard reload, client navigation, and a direct pointer click on the pill all passed without console errors.
  • Deterministic responsive evidence passed at the mobile, compact-sidebar, desktop, and very-large-desktop viewport classes, including the adjacent breakpoint checks at 389/390/391, 767/768/769, 1023/1024/1025, and 1919/1920/1921 CSS px.

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 31a190ddb5f0ffb86cb8dcd80482497663de2685

Before: the sidebar mention pill renders a raw thread ID

After — PR head 02bba578d9dc5391ff3ad208199668dd29f296de

After: the sidebar mention pill renders the archived thread name

Full responsive visual-evidence record

BB-Thread-ID: thr_huyx3zg3n4

AGENT GENERATED

@brsbl
brsbl marked this pull request as ready for review August 27, 2026 06:31
@brsbl
brsbl merged commit ad79bbb into main Aug 27, 2026
15 checks passed
@brsbl
brsbl deleted the bb/fix-thread-name-rendering-thr_huyx3zg3n4 branch August 27, 2026 06:44
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
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