Repository navigation
feat(site/src/pages/AgentsPage): show ask_user_question options as numbered one-line answers - #31555
ibetitsmike wants to merge 4 commits into
Conversation
aa1b52b to
1661b99
Compare
|
All contributors have signed the CLA ✍️ ✅ |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1661b99580
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cd7be1a091
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f26a8f639e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 922760c145
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
DanielleMaywood
left a comment
There was a problem hiding this comment.
This review was performed by ai-review, an automated review bot.
7 inline findings and 1 below.
whole PR
SCOPE-1: This PR changes 2163 lines in 13 files (limit 1000). Split it into smaller PRs.
Remedy: split
Coverage
Coverage: 13 of 13 files reviewed; 35 rules.
Candidates: 296 found, 253 outside changed lines, 4 already discussed, 39 evaluated.
Findings: 8 (22 sites, 3 pre-existing sites), 0 over budget, 0 failed.
Model: deepseek/deepseek-v4.1-flash; 32 questions, 32 answered, 0 abstained, 0 cached; 0 uncalibrated findings held back; 32269 input and 9120 output tokens.
| <div className="w-full"> | ||
| {isRunning && ( | ||
| return isInteractive ? ( | ||
| // oxlint-disable-next-line jsx-a11y/no-noninteractive-element-interactions -- Takes keys from the radios and the focused question text; the radios announce them with aria-keyshortcuts. |
There was a problem hiding this comment.
LINT-1: New oxlint-disable-next-line suppression for jsx-a11y/no-noninteractive-element-interactions. Is it needed, or can the code be fixed instead?
Remedy: ask
There was a problem hiding this comment.
Xum posted this reply for Mike.
Yes, it is needed. The form handles number keys and Enter for the whole question step: the keys bubble up from the radios and from the focused question text, and the radios announce them with aria-keyshortcuts. A <form> is a non-interactive element to this rule, and moving the handler onto each radio would miss keys pressed on the question text. ThemeSwatch.tsx on main uses the same suppression for the same reason. Leaving this open in case you see a structure that avoids it.
| }, | ||
| onSuccess: (_data, message) => { | ||
| setSubmittedResponseText(message); | ||
| onSuccess: () => { |
There was a problem hiding this comment.
REACT-8: Instead of onSuccess, call await mutateAsync(...) and handle the result after it, with try/catch for errors.
Remedy: use-await
There was a problem hiding this comment.
Xum posted this reply for Mike.
Not changing this. .claude/docs/FRONTEND_PATTERNS.md and site/AGENTS.md say to use mutate() with onSuccess/onError unless the result drives control flow. Here onSuccess only clears the saved draft, and the form reads the outcome from isSuccess, variables, and error, so mutateAsync would add a try/catch with nothing to do in it. Leaving this open for you to decide.
| await userEvent.keyboard(" "); | ||
| expect(secondRadio).toBeChecked(); | ||
|
|
||
| await userEvent.tab(); |
There was a problem hiding this comment.
TEST-1 (pre-existing, non-blocking): Story KeyboardNavigation asserts in its play function. Stories are covered by visual regression; keep play to state setup and move behaviour assertions to a Vitest test.
Remedy: move
Same at 1 other site:
site/src/pages/AgentsPage/components/ChatElements/tools/AskUserQuestionTool.stories.tsx:316: StoryKeyboardOtherSubmitasserts in itsplayfunction. Stories are covered by visual regression; keepplayto state setup and move behaviour assertions to a Vitest test.
There was a problem hiding this comment.
Xum posted this reply for Mike.
Leaving this for a separate change. Both stories and their play assertions are on main, and this PR only updates their option text and queries for the new layout, so moving the assertions to Vitest is outside this PR's scope.
922760c to
6b94d7d
Compare
…mbered one-line answers The options are now one complete answer each (#31310), so the form gives each answer its own numbered row that number keys pick, renders the question as Markdown, and keeps unsent answers per call in local storage so a reload does not lose them. This is the net change of mike/codagt-1460-question-options at 922760c, collapsed into one commit to rebase it onto main without replaying the merges from the layer below.
6b94d7d to
2998c42
Compare
…-question-options
…op comments that restate the code Deletes doc comments that only repeat a name or describe the code below them, and separates the form's setup steps with blank lines.
…rate steps in the tool block renderer
Stack
This stack lets the agent in Coder Agents web UI chats ask a question with
ask_user_questionwithout ending its turn. Chats created through the API and plan mode keep the blocking tool.ask_user_questionwhose options are one-line answers, and sends a web push.Refs CODAGT-1460
Why
The question text and its options read as one block, and each option was a short title plus a description, so the answer that went back to the agent ("Backend") said less than what the user read. #31310 makes each option one complete answer; this PR gives the form a layout for that.
What changes (
site/src/pages/AgentsPage)Kbd), and the whole first line of a row is the radio. The Other row is the same frame: its badge is the radio, and the borderless field fills the rest. Rows useRadioGroupPrimitive.Itemdirectly, because the sharedRadioGroupItemis the 16 px circle.<form>, so digits typed in the chat input never answer; that needs anoxlint-disableforno-noninteractive-element-interactions, and each radio announces its key witharia-keyshortcuts. A shortcut hint shows at 640 px and wider with a fine pointer.questionDraft.tssaves unsent answers and the current step in local storage per tool call, together with the questions they answer, so a remount or a reload keeps them. A saved draft whose questions differ is ignored, and a draft is removed once the chat's stream ends with a newer question in its place. Storage errors do not block the form.aria-describedby.questionAnswers.ts,QuestionStep.tsxandquestionShortcuts.tsxhold the answer helpers, the option rows and question step, and the key handling, which keepsAskUserQuestionTool.tsxnear 500 lines.Validation
Vitest (
AskUserQuestionTool.test.tsx,questionDraft.test.ts) and the Storybook tests for the touched stories pass, as do biome, oxlint,tscand the pre-commit hook. Pixel screenshots change for every question story, plus the new ones (NumberKeySelection,OtherAnswerTyped,Submitting,LegacyOptionDescriptions,LongUnbrokenAnswers). Pixel's headless browser does not matchpointer: fine, so the hint does not appear in snapshots.