Skip to content

Answer child thread questions inside the banner - #5423

Merged
brsbl merged 21 commits into
bb/child-threads-4a-compact-form-thr_7xmbr7vsqzfrom
bb/child-threads-4b-answer-in-banner-thr_7xmbr7vsqz
Oct 14, 2026
Merged

brsbl merged 21 commits into
bb/child-threads-4a-compact-form-thr_7xmbr7vsqzfrom
bb/child-threads-4b-answer-in-banner-thr_7xmbr7vsqz

Conversation

@brsbl

@brsbl brsbl commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

Child questions could only be answered in separate cards above the composer, so the banner listed questions you couldn't act on there.

What changed

  • Clicking a waiting child opens its question inside the banner.
  • Clicking the collapsed header only expands the list.
  • With more than one child, "‹ Active child threads" or Esc returns to the list.
  • "‹ 1 of n ›" steps between waiting questions, and answering moves to the next.
  • Cancel returns to the list and leaves the question waiting.
  • The open "child: question" line matches the list's 12px size.
  • A long question shows five lines, then scrolls.
  • Esc keeps the question open during text composition or when the form handled it.
  • Question cards above the composer still show in this layer; merge with Keep keyboard focus in the child question banner #5424 and Remove the child question cards above the composer #5391.

How you verified

  • Remote CI on 4c7677b80b: pending.
  • New tests check that answers reach the open child and the open form skips unrelated re-renders.
  • Dev app on cf39a34051: a long question and long labels fit a 390px screen.
  • Dev app on the stack top (82cb2a1812, Chrome for Testing 155): the header click expanded the list without opening a question.
  • Dev app on the stack top (82cb2a1812, Chrome for Testing 155): Cancel kept the child waiting, and answering resolved it.

Screenshots

Before: bdcec0c109 · After: 49bb0dec3c · Long-question row: before 0a20c99c5b, after da23883d86 · Open question line: before 921c407d42, after 7a7044dda3 · Captured at 2×

Screen / state Viewport Before After
Question opened in the banner Desktop · 1280×720 Before: waiting list, rows open the child thread After: question opened in the banner
Question opened in the banner Mobile · 390×844 Before: waiting list on mobile After: question opened in the banner on mobile
Step to the next waiting question Desktop · 1280×720 Before: no stepper After: second question, 2 of 2
Single child: question opened Desktop · 1280×720 Before: single child waiting After: single child's question opened
Open question line matches the list Desktop · 1100×800 Before: open question line at 13px After: open question line at 12px
Open question line matches the list Mobile · 390×844 Before: open question line on mobile After: open question line on mobile
Long question with a long option label Mobile · 390×844 Before: long question in its own card After: question capped at five lines, label wrapped

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

🤖 Generated with Claude Code

AGENT GENERATED

Clicking a waiting child, or the collapsed "child: question" header,
opens that child's question inside the banner with the compact form.
With more than one child the header becomes "‹ Active child threads",
which returns to the list, as does Esc. "‹ n of m ›" steps between
waiting questions, answering moves to the next one, and the title row
shows the child's resolved title. The question cards above the
composer still show in this layer.

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:14:12.899092Z 49bb0de 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: 49bb0dec3c

ℹ️ 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".

Comment on lines +1026 to +1030
interactionId: newestQuestion.interaction.id,
index: 0,
});
}
focus.onTriggerClick();

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 Preserve focus when opening the question view

When a keyboard user activates this collapsed header while more than one child exists, focus.onTriggerClick() queues focus for collapseRef, but opening the question removes the collapse row and replaces the focused trigger with the back header. The focus-handoff effect therefore has no mounted target and focus falls back to the document body; the back button and Escape path similarly unmount the focused control without restoring focus. Add an explicit handoff to the back header, question form, or restored row so keyboard navigation can continue.

Useful? React with 👍 / 👎.

brsbl and others added 18 commits October 13, 2026 02:38
…b/child-threads-4b-answer-in-banner-thr_7xmbr7vsqz
…b/child-threads-4b-answer-in-banner-thr_7xmbr7vsqz
…b/child-threads-4b-answer-in-banner-thr_7xmbr7vsqz
…b/child-threads-4b-answer-in-banner-thr_7xmbr7vsqz
…b/child-threads-4b-answer-in-banner-thr_7xmbr7vsqz
…b/child-threads-4b-answer-in-banner-thr_7xmbr7vsqz
…b/child-threads-4b-answer-in-banner-thr_7xmbr7vsqz
…b/child-threads-4b-answer-in-banner-thr_7xmbr7vsqz
…b/child-threads-4b-answer-in-banner-thr_7xmbr7vsqz
…b/child-threads-4b-answer-in-banner-thr_7xmbr7vsqz
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