Skip to content

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

Open
ymichael wants to merge 2 commits into
mainfrom
bb/hide-empty-ui-elements-thr_ntd5tnky8c
Open

ymichael wants to merge 2 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:

  • The pinned 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 pinned card has content.
  • While the pinned card is empty, the header button acts as the popover trigger (as in narrow panes), so clicking it shows the empty state. Once content arrives, the card appears and the button goes back to pin/unpin.
  • Pinning the card when it turns out empty opens that popover right away, so the Pin click always shows something.

How you verified

  • New tests in PluginThreadContextCard.test.tsx, each failing without its change: keeps an empty pinned card hidden until the header opens it and opens the empty state when pinning a card that turns out empty.
  • pnpm exec turbo run test --filter=@bb/app -- PluginThreadContextCard ThreadPromptContextBanner (passing).
  • pnpm exec turbo run typecheck lint --filter=@bb/app clean.
  • Not checked in a running app.

AGENT GENERATED

🤖 Generated with Claude Code

ymichael and others added 2 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 <noreply@anthropic.com>
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 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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