Skip to content

feat(composer): one collapsible question card for both deliveries - #596

Merged
Tryanks merged 2 commits into
mainfrom
feat/question-card-collapsible
Oct 6, 2026
Merged

Tryanks merged 2 commits into
mainfrom
feat/question-card-collapsible

Conversation

@Tryanks

@Tryanks Tryanks commented Oct 6, 2026

Copy link
Copy Markdown
Owner

Summary

A long agent question (Claude AskUserQuestion, Codex requestUserInput) used to render its whole text unbounded above the composer; on a phone it filled the screen and pushed the input off it. Both deliveries now share one card: a one-line strip that stays, and an answer area that folds away and scrolls inside a share of the window.

 Composer
   render_user_input_panel(pending, window)
-    blocking  → full card: header, question (unbounded), options (240px scroll), custom answer, prev/next/done, pager
-    async     → strip + chips, collapsible, dismissible
+    strip: icon · title · (collapsed: truncated question) · prev · n/total · next · ▾/▴ · (async: ✕)
+    body (when expanded):
+      scroll area, max_h = clamp(40% of viewport, 120..360)
+        question text
+        option rows (digit hints only while blocking)
+      custom answer
+      hint · Done (multi-select, all answered)
on(new request)   ui_expanded = delivery.is_blocking()
on(strip click)   ui_expanded = !ui_expanded
on(prev/next)     ui_expanded = true; move
on(✕, async only) hide locally; "Question from the agent" button brings it back

Behaviour that stays: single-select auto-advances and submits, multi-select finishes with Done, digits 1-9 in the empty composer answer a blocking question, Enter in the composer submits the custom answer while blocked.

Evidence

  • Before: the screenshot in the request — a blocking question's text filling a phone screen, composer off-screen.
    After: desktop app at 700×620 with a ~1200-char AskUserQuestion from Claude Code: card capped at 248 px, question scrolls inside it, composer visible; strip click collapses it to one line showing Design We are considering the overall design direc…, click again restores it.

  • Tests (cargo nextest run -p tcode-ui user_input): 4 passed.

    • async_question_strip_controls kept: strip buttons act once without reaching the strip underneath; async arrives closed, can be hidden, has a way back. Selectors renamed ui-async-* → ui-* since they are no longer async-only.
    • blocking_question_collapses_but_stays added: blocking arrives open, folds, never shows ✕, prev/next reopen it.

Checks run: cargo fmt --all --check, cargo clippy -p tcode-ui --all-targets --locked -- -D warnings, cargo nextest run -p tcode-ui. Not run: full-workspace clippy (only crates/ui changed), dark theme, a real phone or the phone example (it needs a paired host; the compact path differs only in touch sizes).

Merge Danger

Door: two-way

One component, no protocol or state change outside the composer; revert is a single commit.

Blast Radius: composer

Visual change to every agent question on every client. Async questions lose the chip layout and gain option descriptions and the same rows as blocking ones.

The agent question card now keeps a one-line strip and folds its answer
area away, so the conversation behind it can be read while deciding, and
the question with its options scrolls inside a share of the window so a
long question no longer pushes the composer off a phone screen. Blocking
questions arrive open and cannot be hidden; non-blocking ones arrive
closed and can be hidden as before.
@Tryanks
Tryanks force-pushed the feat/question-card-collapsible branch from 04a0770 to 3f30370 Compare October 6, 2026 07:35
@Tryanks
Tryanks merged commit 0c903d9 into main Oct 6, 2026
7 checks passed
@Tryanks
Tryanks deleted the feat/question-card-collapsible branch October 6, 2026 07:45
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