Skip to content

Add a compact inline layout for pending question forms - #5422

Merged
brsbl merged 13 commits into
bb/child-threads-3-banner-list-thr_7xmbr7vsqzfrom
bb/child-threads-4a-compact-form-thr_7xmbr7vsqz
Oct 14, 2026
Merged

brsbl merged 13 commits into
bb/child-threads-3-banner-list-thr_7xmbr7vsqzfrom
bb/child-threads-4a-compact-form-thr_7xmbr7vsqz

Conversation

@brsbl

@brsbl brsbl commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

A pending question could only render as a full card, which is too large to sit inside the composer's child threads banner.

What changed

  • Pending question forms can render inline at a compact size, without card chrome or "Requested by".
  • The compact form hides its question when the host already shows that exact text.
  • An inline approval hides its heading when the host already shows it.
  • Built-in plugin forms get the compact layout through bb's question form host.
  • Long option labels wrap, and long descriptions truncate with a hover title.
  • An inline form shares the composer's height with other pending cards.
  • An inline host can close the form, so Cancel goes back instead of cancelling.
  • All question UI uses one 12px scale: medium-weight question, regular options, no bold headers.
  • The plugin SDK is unchanged, and the registry's copy keeps its default size.
  • Nothing renders inline until the next layer.

How you verified

  • Remote CI on 515d88a800: pending.
  • New tests cover compact labels, prompt visibility, inline attribution, approval titles, height sharing, and inline Cancel.
  • Dev app on cf39a34051: a long label wrapped without sideways scroll at 390 and 1280 px.
  • Dev app on bd874a3367 (Chrome for Testing 155): Codex question and approval cards used the 12px scale.

Screenshots

Before: 6b9f70eb7a · After: bd874a3367 · Captured at 2× · Codex plugin rebuilt at each revision · Codex worded the approval question differently in each run

Screen / state Viewport Before After
Question card Desktop · 1280×720 Before: 13px card, bold header and question After: one 12px scale, hierarchy from weight
Question card Mobile · 390×844 Before: question card on mobile After: question card on mobile
Question card, Other answer typed Desktop · 1280×720 Before: Other answer box After: Other answer box at 12px
Approval card Desktop · 1280×720 Before: bold approval header After: medium-weight 12px approval header
Approval card Mobile · 390×844 Before: approval card on mobile After: approval card on mobile

BB-Thread-ID: thr_p3h5vu5u4j
BB-Thread: Redesign child threads

🤖 Generated with Claude Code

AGENT GENERATED

PendingInteractionShell gains an inline presentation that renders the
question form at compact density without the card chrome or the
"Requested by" line. The question form host carries density and the
text a host already shows above the form, so the form drops only an
exact repeat of that text; an inline approval likewise hides a heading
the host already shows. Built-in plugin forms read the same host from
bb, and the registry's copy keeps the default density. Nothing renders
inline yet.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@brsbl
brsbl added this pull request to stack #5425 October 13, 2026 08:56
@brsbl
brsbl marked this pull request as ready for review October 13, 2026 09:09
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T09:13:05.525514Z bdcec0c Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bdcec0c109

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

{label}
{density === "compact" ? (
<span className="flex min-w-0 flex-1 items-baseline gap-2">
<span className="shrink-0 text-sm text-foreground">{label}</span>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Allow compact option labels to shrink within the row

When a compact form contains an option label wider than the available child-thread banner, shrink-0 preserves the label's max-content width, forcing the description, shortcut, or entire row beyond the container and potentially creating horizontal scrolling. Option labels are provider-supplied strings with no maximum length, so the compact label should be allowed to shrink and wrap or truncate within the row.

Useful? React with 👍 / 👎.

brsbl and others added 12 commits October 13, 2026 02:13
The inline presentation and the text its host shows above the form were
two contexts that were always set together. One context now carries
the host's text, and its absence means the card presentation.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…child-threads-4a-compact-form-thr_7xmbr7vsqz
Question prompts use medium weight, options are regular, and card
headers drop semibold, so hierarchy comes from weight and color
instead of size. Cards share the compact form's option alignment and
prompt spacing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…child-threads-4a-compact-form-thr_7xmbr7vsqz
…child-threads-4a-compact-form-thr_7xmbr7vsqz
…child-threads-4a-compact-form-thr_7xmbr7vsqz
…child-threads-4a-compact-form-thr_7xmbr7vsqz
@brsbl
brsbl merged commit 9865f0d into main Oct 14, 2026
47 checks passed
@brsbl
brsbl deleted the bb/child-threads-4a-compact-form-thr_7xmbr7vsqz branch October 14, 2026 18:42
ymichael added a commit that referenced this pull request Nov 24, 2026
…st everywhere with a Back control in the child threads card (#8071)

## Human comments

## What was wrong

In a parent thread's Active child threads card, Cancel meant two
different things:

- **bb's own question form** (for example Claude Code's
AskUserQuestion): Cancel only closed the card, and the child kept
waiting.
- **A plugin form** (Secrets, Pi dialogs, Codex MCP elicitation,
community forms): Cancel ended the request, or stopped the child's turn
for a provider's question.

bb's form behaved differently because it could tell it was in the card.
A private runtime slot (`__bbPluginRuntime.questionFormHost`) gave it
`density`, `promptShownAbove` and `closeInline`. Plugins only got the
public `ExperimentalQuestionFormHost`, which lacked those fields; the
registry's flavor hardcoded them to defaults.

The card's "close" meaning came from #5422/#5423. With a single child
the card had no Back control, so Cancel doubled as Back.

This closes audit a-thread F2 and the blocker named for
core-contributions rank 15.

## What changed

**One Cancel, one meaning.** Cancel on a pending interaction form ends
the request wherever the form renders: it cancels a plugin request, or
stops the turn for a provider request.
- `usePendingInteractionCancel` is the only implementation. Core's
`UserQuestionAnswerForm` uses it, and so does the `cancel` prop that
`PluginPendingInteractionComposer` passes to plugin forms.
- The shared `QuestionForm` no longer turns Cancel into "close the
card".
- For plugin forms this is main's behaviour. For bb's own question in
the card, Cancel now stops the child's turn instead of closing the card.

**The card owns Back.**
- `ThreadPromptContextBanner` shows the **‹ Active child threads** back
header whenever a question is open, including with a single child.
- Escape still returns to the list. Both leave the question waiting.

**Public API** (`@get-bb/plugin-sdk` 0.6.196):
- `ExperimentalQuestionFormHost` gains `density: "default" | "compact"`
and `promptShownAbove: string | null`. These are the layout fields
core's host already had.
- `closeInline` stays private and is removed from the inline context,
because no form needs to close the card.
- `PluginPendingInteractionProps.submit()` and `cancel()` get JSDoc.
`cancel` is documented as placement-independent.

**Core and plugins read the host the same way:**
- shared-ui's `QuestionForm` (also the registry item) reads the host
through `experimental_useQuestionFormHost`.
- `vite-core-plugin-sdk-app.ts` binds shared-ui's
`@get-bb/plugin-sdk/app` imports to
`src/lib/shared-ui-plugin-sdk-app.ts`.
- `core-plugin-sdk-app.test.ts` checks that binding's members are the
plugin runtime's own.
- The host context moves from shared-ui into the app
(`question-form-host-context.ts`).

**Removed:**
- The private shim: the `questionFormHost` runtime slot,
`SHARED_UI_QUESTION_FORM_HOST_SPECIFIER`, the build rewrite and the
export-manifest entry.
- The registry's `question-form-host` flavor and its `pluginFlavors`
entry.
- The `provider-codex` and `provider-pi` tsconfig paths to that flavor.

**Docs:**
- `docs/api_to_audit.md`: core callers, consumers, and a new audit item
on the two inline fields.
- The Plugin Guide symbol `ExperimentalQuestionFormHost`.
- bb-plugin-authoring references: `frontend-hooks-and-ui.md` and
`backend-cli-agents.md`.
- `docs/forkable-plugins.md`.

**Community callers:** brsbl's content-calendar and thread-organizer,
and koenvg's pi-subagents, keep main's Cancel behaviour. pi-subagents
can now read `density` and `promptShownAbove` from the public type.

## How you verified

**Tests.** Each fails on the previous behaviour and passes on the
branch.
- `PluginPendingInteractionComposer.test.tsx`: a four-row table (plugin
or provider origin, in the card or in the thread's own composer).
`cancel()` cancels the request or stops the turn in every row, and the
form reads `density` and `promptShownAbove` from
`experimental_useQuestionFormHost()`.
- `ThreadPromptContextBanner.child-questions.test.tsx`:
- Back from a single child's question returns to the list without
stopping the child.
  - Cancel in the card stops the child's turn.
- `core-plugin-sdk-app.test.ts` also covers the shared-ui binding.

**Live, on `pnpm start:worktree`**, main `f1b65545c3a` vs this branch,
driven with the dev `bb` CLI. Fixtures: a Claude Code child asking with
AskUserQuestion, and `bb secret request` run against a child thread.

| Check | main | Branch |
|---|---|---|
| Cancel on bb's own question in the card | Card closed; question still
`pending`, child `active` | Child `idle`, nothing pending: turn stopped
|
| ‹ Back with a single child | No Back control | Back to the list;
question still `pending` |
| Cancel on the Secrets form in the card | `Secret request cancelled
(user).` | `Secret request cancelled (user).` |
| Served plugin bundles | — | Reference only
`experimental_useQuestionFormHost`, not the `questionFormHost` slot |

**Commands** (after rebasing on `af25b0b5a60`, SDK 0.6.196):
- `pnpm exec turbo run typecheck lint test` for @bb/app, @bb/shared-ui,
@get-bb/plugin-sdk, @bb/plugin-registry, @bb/plugin-build,
provider-codex, provider-pi, ask-user-question, secrets, bb-guide and
plugin-api-docs: 38/38 tasks; app 7471 tests in 706 files.

> AGENT GENERATED

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

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.

1 participant