Skip to content

Hide the thread context card when it has nothing to show - #6618

Merged
ymichael merged 6 commits into
mainfrom
bb/hide-empty-ui-elements-thr_ntd5tnky8c
Oct 30, 2026
Merged

ymichael merged 6 commits into
mainfrom
bb/hide-empty-ui-elements-thr_ntd5tnky8c

Conversation

@ymichael

@ymichael ymichael commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

In wide panes the thread context card is pinned by default, and the pinned card always rendered. When every row and section rendered nothing (no changes, PRs or related threads yet), it showed a "Nothing to show yet" card beside the transcript that nobody asked for. In the shift layout it also reserved transcript width for that empty card.

What changed

apps/app/src/components/plugin/PluginThreadContextCard.tsx:

  • In wide panes the card measures whether it has content (a MutationObserver over the same body selector the CSS empty-state rules use) and stays hidden while empty. useThreadContextCardContentInset only reserves width when the card is shown.
  • On an empty thread, the header button shows or hides the same card beside the transcript for that thread only. It does not change the synced threadContextCard.pinned preference, so hiding an empty card does not unpin the card on threads with content. On threads with content the button still pins and unpins as before.
  • Narrow panes (under 1072px) keep the popover. The card now uses rounded-md to match the popover, and the popover drops its shadow to match the card.

How you verified

  • New tests in PluginThreadContextCard.test.tsx: shows an empty card from the header without changing the pin preference checks that the empty card is hidden with no inset, that the header shows and hides it, and that content arriving afterwards is still pinned. It fails without the change.
  • pnpm exec turbo run test --filter=@bb/app -- PluginThreadContextCard (15/15) and pnpm exec turbo run typecheck lint --filter=@bb/app clean.
  • Clicked through on a pnpm start:worktree server with an empty thread and a thread with child threads at 1700px and 900px: the empty card starts hidden and the header shows and hides it; toggling it leaves the other thread pinned (or unpinned); a reveal does not carry over to later visits; the card and popover both have 6px corners and the popover has no shadow.

AGENT GENERATED

🤖 Generated with Claude Code

ymichael and others added 6 commits October 29, 2026 17:50
The pinned card rendered its "Nothing to show yet" state whenever every
row and section was empty. It now stays hidden and reserves no transcript
width until it has content; the header button opens the empty state in a
popover on demand.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Pinning the card on an empty thread kept it hidden, so the click showed
nothing. The first measurement after a pin now opens the popover when the
card turns out empty.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
In wide panes the header button now always pins or unpins the card beside
the transcript. On an empty thread the card starts hidden; clicking the
button shows it with the empty state for that thread instead of opening a
popover.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Showing or hiding the card on an empty thread now only affects that
thread, so hiding it does not unpin the card on threads with content.
The card corners now match the narrow-pane popover.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ymichael
ymichael merged commit de5ef8f into main Oct 30, 2026
48 checks passed
@ymichael
ymichael deleted the bb/hide-empty-ui-elements-thr_ntd5tnky8c branch October 30, 2026 16: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.

1 participant