Skip to content

Show the user's answer as a reply after an AskUserQuestion resolves#165

Open
Zeus-Deus wants to merge 1 commit into
mainfrom
show-user-answer-visually
Open

Show the user's answer as a reply after an AskUserQuestion resolves#165
Zeus-Deus wants to merge 1 commit into
mainfrom
show-user-answer-visually

Conversation

@Zeus-Deus

Copy link
Copy Markdown
Owner

Problem

When an agent asks an AskUserQuestion-style multiple-choice prompt (modeled as a permission_request with request_kind: "user-input"), the interactive picker renders above the composer (ComposerPendingInputPanel). Once you answer, that panel disappears — and the transcript row was collapsed to a static muted "Answered" string. So the thread never showed what you picked, and it didn't read as if you had replied.

Fix

Purely presentational — no backend, reducer, or data-model changes. The selection was already stored on the resolved request as the decision's updated_input.answers; the renderer was just discarding it.

  • New UserInputAnswer component reads updated_input.answers off the resolved request and renders it as a right-aligned reply bubble, deliberately reusing UserMessage styling (same card fill, border, and the asymmetric 14px 14px 5px 14px radius) so a submitted answer reads as a genuine user reply. Multi-question prompts label each answer by its question header; a resolved request with no readable answer (e.g. cancelled) falls back to the plain "Answered" marker so the row is never blank.
  • MessageList user-input branch: pointer while pending, "Submitting answers…" while responding, UserInputAnswer once resolved.
  • Tests: responding marker, resolved answer echo, multi-question headers, no-answer fallback.
  • Dev mock: seeds a resolved AskUserQuestion for design QA.

Before / After

Before — the answer is invisible; nothing between the subagents card and the next row:

before

After — the chosen option ("Feature-detect and degrade") renders as a reply bubble:

after

Verification

  • npm run check (tsc) clean
  • Full JS suite: 707/707 passing
  • Visually confirmed in the running app (screenshots above)

When an agent asks an AskUserQuestion-style multiple-choice prompt
(request_kind "user-input"), the interactive picker renders above the
composer. Once answered, that panel disappears and the transcript row
collapsed to a static muted "Answered" string — so the thread never
showed what was picked and it didn't read as a reply.

The selection was already stored on the resolved request as the
decision's updated_input.answers. Render it back as a right-aligned
reply bubble that mirrors UserMessage styling, so a submitted answer
reads as a genuine user reply.

- New UserInputAnswer component reads updated_input.answers off the
  resolved request; multi-question prompts get each answer labeled by
  its question header; falls back to the plain "Answered" marker when a
  resolved request carries no readable answer (e.g. cancelled).
- MessageList user-input branch: pointer while pending, "Submitting
  answers…" while responding, UserInputAnswer once resolved.
- Tests cover responding marker, resolved answer echo, multi-question
  headers, and the no-answer fallback.
- Dev mock seeds a resolved AskUserQuestion for design QA.
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