Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(web): collapse the question prompt from its header #6773

MergedJardo-51(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/6773/headmerged by juliusmarminge View on GitHub

What Changed

The pending-question panel above the composer (ComposerPendingUserInputPanel) can now be collapsed from its header.

  • The header row is a disclosure control, built on the existing ~/components/ui/collapsible primitive. Clicking it hides the question, the multi-select hint and the option list; clicking it again restores them.
  • Collapsed, the header keeps its section label and question counter and echoes the question itself on one truncated line, so the strip still says what is being asked.
  • A chevron marks the affordance and points at the body: down while it is open, up while it is collapsed.
  • Collapsed prompts stop listening for the 1–9 option shortcuts, since the numbers they refer to are off screen. The composer's custom-answer field keeps working, so a prompt can still be answered while collapsed.
  • The collapsed question's id is stored rather than a bare flag, so a prompt that advances to its next question reopens. That matters because it happens without a click — sending from the composer advances the active question.

One file of behavior plus a test file. No contract, server or provider surface is touched.

Why

Resolves #4431. When a question has a long body or many options, the panel grows tall enough to cover most of the thread, so the reasoning that led to the question is hard to read while answering it. On a laptop that is most of the window.

Collapsing to the header is the smallest thing that fixes it: the prompt stays visible and answerable, but it stops competing with the thread for space. Mobile already has an expand/collapse choreography for its own PendingUserInputCard (pendingUserInputLayout.ts); this closes the same gap on web.

UI Changes

Before

The question covers the entire thread:

Screenshot from 2026-08-15 11-49-24

After

There is a chevron icon indicating that clicking the header will collapse the panel:

Screenshot from 2026-08-15 11-35-13

Collapsed panel after clicking the header:

Screenshot from 2026-08-15 11-36-13

Video

https://github.com/user-attachments/assets/cae1e446-1372-42ba-90e8-199694b887bb

In words: expanded is unchanged from today. Collapsed, the panel is a single header row — uppercase section label, the 1/2 counter when a prompt has several questions, the question on one truncated line, and the chevron on the right — sitting on the composer's top edge where the full panel used to be. Open and close run through the collapsible's standard 200ms height transition; there is no continuous animation.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes — to follow, see above
  • I included a video for animation/interaction changes — the only motion is the shared collapsible's existing height transition

Two things worth flagging for review rather than leaving you to find them:

  • No test covers the collapsed branch. apps/web tests run in the node environment with renderToStaticMarkup and no DOM, so nothing there can click the trigger. The alternative was a defaultCollapsed prop existing purely for the test, which seemed worse than the gap; since the disclosure is built on the shared primitive, the open/close mechanics and the ARIA wiring are covered by it rather than by this file. Happy to add the prop if you would rather have the assertion.
  • Crossing the mobile composer's collapsed/expanded boundary reopens the prompt. ChatComposer renders this panel from two mutually exclusive branches, so focusing or blurring the mobile composer remounts the card and drops the collapsed state. Fixing it means lifting the state into ChatComposer, which widens the diff past the requested change, so I left it. Say the word if you want it in scope.

🤖 Generated with Claude Code (Claude Opus 5)


Note

Low Risk Scoped UI change in the composer pending-question panel; no API, auth, or data-path changes.

Overview The composer pending user input panel can be collapsed from its header so long questions and option lists stop covering the chat thread.

The section header becomes a disclosure control (shared Collapsible primitive): expanded behavior matches today; collapsed keeps the label, multi-question counter, a one-line truncated question, and a chevron. Number-key (1–9) shortcuts are disabled while collapsed because options are hidden; composer custom answers still work.

Collapse state is tracked by active question id, so when the prompt advances to the next question (including via composer send) the card reopens without a manual expand. New static markup tests assert the header is an accessible toggle (aria-expanded, aria-controls) and that the panel starts expanded.

Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit c26aed8d197ebd001aec1a386d87b59e2d77ab7a. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).

Note

Add collapsible toggle to question prompt header in chat composer

  • Each prompt card header in ComposerPendingUserInputCard is now a button that collapses or expands the question body, starting expanded by default.
  • When collapsed, a one-line truncated question is shown in the header and a chevron icon rotates to indicate state; a data-pending-user-input-toggle attribute reflects "collapsed" or "expanded".
  • Number-key selection shortcuts are disabled when the panel is collapsed to prevent selecting hidden options.
  • Adds a test in ComposerPendingUserInputPanel.test.tsx asserting initial expanded state and correct ARIA attributes on the trigger.
Macroscope summarized c26aed8.
    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    2. Important

      Review skipped

      Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

      ⚙️ Run configuration

      Configuration used: Repository UI

      Review profile: CHILL

      Plan: Pro Plus

      Run ID: 91326431-e031-4b27-b1bc-795955bd7ae8

      You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

      Use the checkbox below for a quick retry:

      • 🔍 Trigger review

      Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

      ❤️ Share
      Comment `@coderabbitai help` to get the list of available commands.
    3. Approvability

      Verdict: Approved c26aed8

      This PR adds a straightforward UI enhancement (collapsibility) to an existing panel using existing UI primitives. Changes are self-contained with tests and appropriate accessibility handling.

      You can customize Macroscope's approvability policy. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    4. juliusmarminge merged this40ab7bf

    5. juliusmarminge closed this

Sign in to join this conversation.