Skip to content

Conversation

@ThomasK33
Copy link
Member

Summary

Improve the ask_user_question tool UX with three enhancements:

  1. Auto-advance for single-select questions - When a user picks an option for a single-select question, automatically move to the next question without requiring a "Next" button click
  2. Selection type indicator - Add clear text below each question showing "Select one option" or "Select one or more options"
  3. Show option descriptions - Display the option tooltip/description text in both the review summary and completed view

Changes

  • Add useEffect to auto-advance when single-select option is chosen (skips "Other" since text input is needed)
  • Add hasUserInteracted ref to prevent auto-advance on initial render
  • Add selection type hint text below question
  • Add getDescriptionForAnswer helper to look up descriptions
  • Update summary view to show descriptions below answers
  • Update completed view to show descriptions below answers

📋 Implementation Plan

Plan: Improve ask_user_question UX

Summary

Enhance the multi-choice questionnaire UI with:

  1. Auto-advance for single-select questions (skip manual "Next" click)
  2. Clear selection type indicator (show "Select one" vs "Select multiple")
  3. Show option descriptions in answer summary (both during review and after completion)

Current Behavior

  • All questions require clicking "Next" button to proceed
  • No visual indication of whether question is single-select or multi-select
  • Answer summary only shows the selected label text, not the description

Proposed Changes

File: src/browser/components/tools/AskUserQuestionToolCall.tsx

1. Auto-advance for single-select questions (~+15 LoC)

When a user selects an option for a non-multiSelect question:

  • Immediately advance to the next question (or summary if last question)
  • Skip the "Next" button click for single-select questions
  • Keep "Next" button behavior for multi-select questions (user needs to confirm selections)

Implementation:

  • Add useEffect that watches draftAnswers changes
  • When current question is single-select AND has a selection → advance activeIndex
  • Use a ref to track if the advance was triggered by user action (not initial state)

2. Selection type indicator (~+10 LoC)

Add a small text hint below the question text:

  • Single-select: "Select one option"
  • Multi-select: "Select one or more options"

This makes it immediately clear to the user what kind of input is expected.

3. Show descriptions in answer displays (~+30 LoC)

A. In the summary view (during execution):
Currently shows: ✓ Header: Label
Proposed: Show the description in a smaller muted text below when hovering or always inline.

B. In the completed view (after submission):
Currently shows: • Question: Answer
Proposed: Add the description for the selected option(s) in a muted text line below.

Implementation:

  • Create a helper function to look up the description for a given answer label from the question's options
  • Update the summary view (lines ~500-525) to include descriptions
  • Update the completed view (lines ~546-551) to include descriptions

Estimated LoC Change

Change Net LoC
Auto-advance effect +15
Selection type indicator +10
Description in summary +15
Description in completed view +15
Total ~+55

Alternative Considered

Use radio buttons for single-select vs checkboxes for multi-select

This would visually distinguish the two modes, but:

  • Requires importing/creating a radio button component
  • The current checkbox UI with auto-advance is clear enough
  • The text indicator ("Select one" vs "Select multiple") is more explicit

Decision: Keep checkboxes but add text indicator for clarity.


Generated with mux • Model: anthropic:claude-opus-4-5 • Thinking: high

@chatgpt-codex-connector
Copy link

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

- Auto-advance to next question for single-select options (no manual Next click needed)
- Add selection type indicator ('Select one' vs 'Select one or more')
- Show option descriptions in summary view during review
- Show option descriptions in completed view after submission

Change-Id: I556f4d4411446e57f3eae3d186405072f141234d
Signed-off-by: Thomas Kosiewski <tk@coder.com>
Add module-level cache for draft answers keyed by toolCallId.
Prevents loss of freetext input when switching workspaces.
Cache is cleaned up when tool completes.

Change-Id: I96b06fc1d968c5cb3c00c9c0dc16c87e5fbf5d18
Signed-off-by: Thomas Kosiewski <tk@coder.com>
When app restarts with a partial.json, both the empty placeholder from
chat.jsonl and the partial with content were being loaded. Due to
identical historySequence values and non-deterministic sort order,
the empty placeholder could appear as the 'last message', hiding the
ask_user_question tool call.

Fix: check partial's historySequence before emitting historical events,
and skip any chat.jsonl message with the same sequence number.

Change-Id: I2fed08f0274bef4f63c3062496b0452a15c2f29b
Signed-off-by: Thomas Kosiewski <tk@coder.com>
The ask_user_question tool blocks waiting for user input. If the app
restarts during this wait, the partial must be persisted so it can be
restored. Previously, the partial write was throttled and might not
complete before app shutdown, causing the tool call to be lost.

Now we immediately flush the partial after adding ask_user_question,
ensuring it survives app restarts.

Change-Id: Idcac0fedb96299a1ef3e3d95eccca1629587a86b
Signed-off-by: Thomas Kosiewski <tk@coder.com>
- Extract getDescriptionsForLabels helper to reduce duplication (-7 LoC)
- Consolidate option toggle handlers into unified loop (-30 LoC)
- Add test verifying flushPartialWrite method exists
- Clarify agentSession comment about partial/placeholder handling

Change-Id: Icfd98514aead223ce15d60d4972e7c3d9819c10d
Signed-off-by: Thomas Kosiewski <tk@coder.com>
Change-Id: Ife3b35dc81a0b8e128f3349621adfe42ee62970a
Signed-off-by: Thomas Kosiewski <tk@coder.com>
@ThomasK33 ThomasK33 added this pull request to the merge queue Dec 16, 2025
Merged via the queue into main with commit 66f4934 Dec 16, 2025
20 checks passed
@ThomasK33 ThomasK33 deleted the questions-2vtx branch December 16, 2025 07:55
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