Repository navigation
Keep keyboard focus in the child question banner - #5424
Conversation
Opening a question from a row or the collapsed header moves focus to "‹ Active child threads" (or the title link when there is one child). Back and Esc return focus to that child's row in the same banner. When an answered question leaves and focus had been inside the banner, focus returns to the banner instead of dropping to the page; focus elsewhere, such as another pane, is left alone. 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 470852f795
ℹ️ 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".
| useEffect(() => { | ||
| if (openChildThreadId !== null && focusBackOnOpen.current) { | ||
| focusBackOnOpen.current = false; | ||
| (backButtonRef.current ?? titleLinkRef.current)?.focus(); | ||
| } |
There was a problem hiding this comment.
Preserve focus when the back header changes
In the live ThreadDetailView flow, items is recomputed as child runtimes change, so while a question remains open the count can cross between one and multiple children. After this effect focuses the back button, such a change flips showBackHeader and replaces ChildQuestionBackHeader with the separate disclosure button (or vice versa), unmounting the focused element. Because currentInteractionId did not change, the later restoration effect returns early and focus falls to the page. Keep the header focus target mounted across this transition or explicitly hand focus to the replacement.
Useful? React with 👍 / 👎.
…to bb/child-threads-4c-banner-focus-thr_7xmbr7vsqz
…to bb/child-threads-4c-banner-focus-thr_7xmbr7vsqz # Conflicts: # apps/app/src/components/promptbox/banner/ThreadPromptContextBanner.tsx
…to bb/child-threads-4c-banner-focus-thr_7xmbr7vsqz # Conflicts: # apps/app/src/components/promptbox/banner/ThreadPromptContextBanner.child-questions.test.tsx # apps/app/src/components/promptbox/banner/ThreadPromptContextBanner.tsx
…to bb/child-threads-4c-banner-focus-thr_7xmbr7vsqz
…to bb/child-threads-4c-banner-focus-thr_7xmbr7vsqz # Conflicts: # apps/app/src/components/promptbox/banner/ThreadPromptContextBanner.tsx
…to bb/child-threads-4c-banner-focus-thr_7xmbr7vsqz # Conflicts: # apps/app/src/components/promptbox/banner/ThreadPromptContextBanner.child-questions.test.tsx # apps/app/src/components/promptbox/banner/ThreadPromptContextBanner.tsx
…to bb/child-threads-4c-banner-focus-thr_7xmbr7vsqz
…to bb/child-threads-4c-banner-focus-thr_7xmbr7vsqz # Conflicts: # apps/app/src/components/promptbox/banner/ThreadPromptContextBanner.tsx
…to bb/child-threads-4c-banner-focus-thr_7xmbr7vsqz
…to bb/child-threads-4c-banner-focus-thr_7xmbr7vsqz
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…to bb/child-threads-4c-banner-focus-thr_7xmbr7vsqz
## 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 #5424 and #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 |  |  | | Question opened in the banner | Mobile · 390×844 |  |  | | Step to the next waiting question | Desktop · 1280×720 |  |  | | Single child: question opened | Desktop · 1280×720 |  |  | | Open question line matches the list | Desktop · 1100×800 |  |  | | Open question line matches the list | Mobile · 390×844 |  |  | | Long question with a long option label | Mobile · 390×844 |  |  | BB-Thread-ID: thr_p3h5vu5u4j BB-Thread: [Redesign child threads](https://brsbl.getbb.app/projects/proj_khiw2za95v/threads/thr_7xmbr7vsqz) 🤖 Generated with [Claude Code](https://claude.com/claude-code) > AGENT GENERATED --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
Human comments
What was wrong
Opening or answering a question in the banner dropped keyboard focus to the page, so the next Tab started from the top.
What changed
How you verified
bba2ed6362: pending.67fac0a81f: answering in another pane left focus there.82cb2a1812, Chrome for Testing 155): Enter on a row focused the title link, and Cancel returned focus to the row.Screenshots
Before:
49bb0dec3c· After:470852f795· Captured at 2× · The red box marks keyboard focus; before, focus is on the page.BB-Thread-ID: thr_p3h5vu5u4j
BB-Thread: Redesign child threads
🤖 Generated with Claude Code