Repository navigation
Answer child thread questions inside the banner - #5423
Conversation
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]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
…b/child-threads-4b-answer-in-banner-thr_7xmbr7vsqz
Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
💡 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".
| interactionId: newestQuestion.interaction.id, | ||
| index: 0, | ||
| }); | ||
| } | ||
| focus.onTriggerClick(); |
There was a problem hiding this comment.
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 👍 / 👎.
…b/child-threads-4b-answer-in-banner-thr_7xmbr7vsqz
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…b/child-threads-4b-answer-in-banner-thr_7xmbr7vsqz
… open form Co-Authored-By: Claude Opus 5.5 <[email protected]>
…b/child-threads-4b-answer-in-banner-thr_7xmbr7vsqz
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…question Co-Authored-By: Claude Opus 5.5 <[email protected]>
…b/child-threads-4b-answer-in-banner-thr_7xmbr7vsqz
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…b/child-threads-4b-answer-in-banner-thr_7xmbr7vsqz
…b/child-threads-4b-answer-in-banner-thr_7xmbr7vsqz
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…b/child-threads-4b-answer-in-banner-thr_7xmbr7vsqz
…b/child-threads-4b-answer-in-banner-thr_7xmbr7vsqz
…only headers Co-Authored-By: Claude Opus 5.5 <[email protected]>
…b/child-threads-4b-answer-in-banner-thr_7xmbr7vsqz
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…b/child-threads-4b-answer-in-banner-thr_7xmbr7vsqz
…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]>
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
How you verified
4c7677b80b: pending.cf39a34051: a long question and long labels fit a 390px screen.82cb2a1812, Chrome for Testing 155): the header click expanded the list without opening a question.82cb2a1812, Chrome for Testing 155): Cancel kept the child waiting, and answering resolved it.Screenshots
Before:
bdcec0c109· After:49bb0dec3c· Long-question row: before0a20c99c5b, afterda23883d86· Open question line: before921c407d42, after7a7044dda3· Captured at 2×BB-Thread-ID: thr_p3h5vu5u4j
BB-Thread: Redesign child threads
🤖 Generated with Claude Code