Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(web): collapsible question panel in the composer #6588

ClosedPollyGlot(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/6588/headopened View on GitHub

Summary

Adds a chevron toggle to collapse the question panel (AskUserQuestion) that is embedded in the chat composer, mirroring the collapse affordance of the Claude app while keeping the free-text answer field fully usable.

Scope: web/desktop only. The mobile app already has its own collapse (the pending user-input card folds into a compact bar in the composer slot), so no mobile changes are included.

Behavior

  • The panel header (badge + question counter) becomes a full-width toggle with a chevron on the right (Collapsible primitive, animated, aria-expanded + explicit aria-label).
  • Collapsed, the header turns into a compact bar: badge, N/M counter, the question truncated to one line, and a check echo of the current answer (selected option label, N selected for multi-select, or the custom text). The composer textarea ("Type your own answer...") and the Previous/Submit actions stay visible and functional.
  • Collapse is manual only, tracked per request id in ChatView (survives the panel's two render sites in ChatComposer). A new request always arrives expanded, and moving to another question re-expands the panel.
  • The 1-9 option shortcuts are disabled while collapsed.

Screenshots

Before (no collapse available)After, expanded (chevron added)
beforeafter expanded
After, collapsedAfter, collapsed with a selection echo
after collapsedafter collapsed echo

Testing

  • 9 new unit tests on the pure logic (selection echo derivation, collapse-state toggling/reset) in pendingUserInput.test.ts; web suite green (252 files, 2438 tests).
  • vp run -r typecheck (tsgo) passes.
  • Manually verified in the dev app with a seeded 2-question pending input: toggle, truncation, echo, shortcut gating, and question-change re-expansion.

🤖 Generated with Claude Code


Note

Low Risk UI-only composer header behavior backed by pure formatting logic and tests; no auth, API, or data-path changes.

Overview When the composer AskUserQuestion panel is collapsed, the header now shows the current answer next to the truncated question (check icon + label), not just the question text.

A new derivePendingUserInputSelectionEcho helper formats draft answers for display: single label, N selected for multi-select, custom text when present, or nothing when unanswered. The collapsed bar uses the same optimistic single-select label as the option buttons so the echo does not flicker during server round-trips.

Unit tests cover the echo helper’s empty, single/multi-select, and custom-answer cases.

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

Note

Show selected answer summary in collapsed composer question panel

  • Adds derivePendingUserInputSelectionEcho in pendingUserInput.ts that returns a concise string for the current answer: the label for a single selection, 'N selected' for multiple, or the raw string for custom answers.
  • Updates ComposerPendingUserInputPanel.tsx to show a check icon and the echo text in the collapsed card header alongside the question.
  • Uses an optimistic single-select value (when its questionId matches the active question) to avoid flicker during server round-trips.
Macroscope summarized 6ad0792.
    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      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: 80432d82-ebe9-4b68-be43-b2cd45662ceb

      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.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    3. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Approved 6ad0792

      Self-contained UI enhancement that adds visual feedback showing the selected answer in a collapsed question panel. Changes include a pure utility function with comprehensive tests and minimal component updates—no runtime behavior changes beyond the new display.

      You can customize Macroscope's approvability policy. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    4. Closing: #6773 landed the collapsible question panel first and covers this. Thanks @Jardo-51.

      The only piece left over here was echoing the current answer next to the truncated question in the collapsed header, so a collapsed card still says what was picked. Small and cosmetic, and not what this PR set out to do, so I'd rather it come back as its own focused PR than ride in under a stale title.

Sign in to join this conversation.