Skip to content

Add the thread context card behind an early-adopter experiment - #6529

Merged
ymichael merged 4 commits into
mainfrom
bb/thread-details-card-thr_an3vhi6xak
Oct 29, 2026
Merged

ymichael merged 4 commits into
mainfrom
bb/thread-details-card-thr_an3vhi6xak

Conversation

@ymichael

@ymichael ymichael commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

A running thread's context (parent thread, changed files, pull request) lives in the context row above the composer. It scrolls out of mind once you are reading the transcript, it competes with the composer for space, and plugins could only add to it as composer-time segments. #6481 asks for a place in each thread pane, below the header, where bb owns placement and plugins own the contents.

What changed

Behind the threadContextCard experiment (on for early adopters), each thread pane gets a thread context card at its upper-right. A pane now shows its thread context one of two ways, a banner (the context row above the composer) or a card, and bb picks one per pane:

  • Placement (bb-owned): a wide pane shows it beside the transcript; a medium pane moves the transcript aside to fit it (gutter / shift, measured from the pane). The header button pins or unpins it (threadContextCard.pinned, a synced UI preference, default on). A narrow desktop pane or window (right panel open, splits, a half-screen window) opens it from the header button as a popover, the shared bottom drawer below 768px. Phones (a narrow touch screen, the rule the message action bar uses) keep the composer context row and show no card.
  • Contents: bb's parent row and a Child threads section (ThreadContextCardCore.tsx), the Git plugin's Changes row (+N −M, opens the Diff tab), and GitHub PR Status's PR row (the banner's own label, now shared as PullRequestSummaryLabel, with a … menu: open, copy link, merge, ready/draft). A row's action replaces its trailing on hover or focus. Row menus open just below the card, aligned to its edges. A card with nothing in it shows an empty state.
  • Composer context row: context segments render in both kinds, so a plugin that hasn't added a card entry keeps its segment above the composer. A segment that also has a card entry hides itself while experimental_useThreadContextKind() is card. bb's parent, Git changed-files and PR segments do this. Threads shown inside a panel or as a transcript are always banner.
  • Plugin API (experimental): app.slots.experimental_threadContextCardRow and app.slots.experimental_threadContextCardSection (the card's counterparts of the Info tab's row and section slots), the host row component experimental_ThreadContextCardRow, and experimental_useThreadContextKind(): "banner" | "card". The segment input is unchanged from main. Core's entries go through the same provider and row component, and core's parent segment uses the same function as the hook. Audit entry in docs/api_to_audit.md; Plugin Guide surface, wireframe region and anatomy updated; plugin SDK 0.6.102 → 0.6.103.
  • Outside the experiment (everyone): the PR auto-merge ⚡ icon is replaced by words. The banner shows · Auto-merge when no other next step is shown (nothing when queued, since "Queued to merge" says it); the Info tab shows a muted "Auto-merge on" that truncates instead of overlapping.
  • Docs/CLI surfaces: docs/configuration.md (experiment + preference), bb guide customization template, Settings → Experiments copy, bb-guide frontend-thread-details-card.md (new, linked from SKILL.md), frontend-registration.md, frontend-components.md, API indexes. The Ladle SDK shim gains four missing exports so the PR plugin gallery loads; galleries for card rows and PR states added.

No server/daemon wire changes.

How you verified

  • pnpm exec turbo run typecheck lint test --filter='...[origin/main]': typecheck and lint green across 254 tasks. The test failures were unrelated: two app flakes and an MCP timeout test that pass on their own, plus the Electron preload smoke test, which fails the same way on origin/main on this machine. After rebasing on the latest main, the affected packages were rerun green (39 tasks), plus @bb/server/@bb/cli typecheck and lint, and the server docs/skills/experiments tests (125).
  • New tests: PluginThreadContextCard.test.tsx (ordering, crash isolation, per-pane scoping, pin toggle, popover close on row run, and the kind each pane reports, including a thread nested in a panel), a banner segment test that the parent segment yields to the card, PR segment tests for the card kind and auto-merge wording.
  • bb CLI against a start:worktree server: experiment toggle round-trip, threadContextCard.pinned get/set/reset and rejection of non-booleans. bb git status|files, bb pull-request show and bb thread show output was byte-identical to an origin/main server on a copy of the same data. The guide and skill docs ship on the branch only.
  • Before/after screenshots from an origin/main server and the branch server on identical data: wide, medium, narrow and phone widths, light theme, empty, parent-only and children-only cards, PR hover and menu, the Settings experiments list and the Plugin Guide. With the experiment off, the branch renders the same as main.

Fixes #6481

AGENT GENERATED

🤖 Generated with Claude Code

@ymichael
ymichael force-pushed the bb/thread-details-card-thr_an3vhi6xak branch 2 times, most recently from 9664cf7 to bcc50db Compare October 29, 2026 20:40
@ymichael ymichael changed the title Add the thread details card behind an early-adopter experiment Add the thread context card behind an early-adopter experiment Oct 29, 2026
ymichael and others added 4 commits October 29, 2026 13:52
Only a compact viewport with a coarse pointer (a phone) keeps the composer
context row instead of the card, the rule MessageActionBar already uses.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Rename the thread details card to the thread context card and replace its
row and section slots with one experimental_threadContextCard slot, where a
title makes an entry a section. experimental_useThreadContextKind() reports
whether a pane shows thread context as a banner or a card, so a context
segment that also has a card entry hides itself there while other plugins'
segments keep showing. The threadContextCard field leaves the segment input.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
experimental_threadContextCardRow and experimental_threadContextCardSection
mirror the Info tab's row and section slots again.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.

feat(plugins): add a floating-menu slot in the agent stream

1 participant