Skip to content

fix(frontend): elicitation chat polish — friendly names, card elevation, stepper mode - #5217

Merged
ardaerzin merged 21 commits into
big-agentsfrom
fe-fix/elicitation-chat-polish
Jul 11, 2026
Merged

fix(frontend): elicitation chat polish — friendly names, card elevation, stepper mode#5217
ardaerzin merged 21 commits into
big-agentsfrom
fe-fix/elicitation-chat-polish

Conversation

@ardaerzin

@ardaerzin ardaerzin commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Dogfooding feedback on the released elicitation UI, with Claude Code's AskUserQuestion UI as the design bar for the form interactions.

Chat chrome

  • Friendly attribution in chat: "Asked by mcp__agenta-tools__request_input" → the shared resolveToolDisplay label. Raw wire names remain in Build-mode inspect and traces.
  • Elevation over borders for choice cards (the providers-grid treatment): unselected options are borderless elevated fills (colorFillQuaternary, hover colorFillTertiary); only the selected card carries an accent border. Kills the wall-of-outlines in dark; light keeps its quiet look.

Stepper mode (author-controlled)

  • "x-ag-stepper": true on requestedSchema renders multi-question forms one question at a time with free-roam Back/Next and a final review step (label→answer rows, click to jump, Required markers). Fields stay mounted and are CSS-hidden per step so antd registration (defaults, typed values) survives.
  • Failed Accept jumps to the first failing question (goToField handle).
  • The active question renders as a header (label + description at title prominence, field label hidden) with a compact progress pill ("2/5").
  • Skip on optional questions (clears the value — a schema default the user didn't endorse doesn't ride along); Enter advances with a ⏎ hint on Next.

Choice-card interactions

  • Inline Other input: always visible inside the Other tile (no click-to-reveal). Single-select commits as you type; multi keeps Enter/blur chip commits. Clearing the input only clears a value the input owns — a listed selection survives.
  • Digit hotkeys: cards carry 1..9 badges; pressing the digit selects (Other gets the next digit). Scoped to focus within the group; ignored while typing or with modifiers.
  • Enter on a single-select card picks and advances in one press; Space keeps toggle-only checkbox semantics.

Pure control logic (typeCustomValue, resolveDigitSelection, digitKeyIndex) lives in schemaFormOptions.ts with unit tests; the __ag_enum_other__ sentinel invariant stays pinned.

entity-ui 185 tests + tsc + lint green. QA: a multi-question x-ag-stepper elicitation + any choice-card form, both themes.

…n over borders

Dogfooding feedback on the released elicitation UI:

- The widget attribution leaked the raw MCP wire name on the Claude
  harness ("Asked by mcp__agenta-tools__request_input"). Chat-facing copy
  now uses the shared resolveToolDisplay label; the raw name stays
  reachable where it belongs (Build-mode inspect, traces).
- Choice cards traded borders for elevation (the providers-grid
  treatment): unselected options are borderless elevated fills, hover
  brightens the fill, and the single selected card per group carries the
  one accent border. A stack of outlined boxes read exhausting in the
  dark theme; light keeps its quiet look via the same fill tokens.
@vercel

vercel Bot commented Jul 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agenta-documentation Ready Ready Preview, Comment Jul 11, 2026 3:25pm

Request Review

@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 15d2fd5b-054d-481a-b684-60d06600200b

📥 Commits

Reviewing files that changed from the base of the PR and between 1e75acf and 3e1ef8a.

📒 Files selected for processing (1)
  • web/packages/agenta-entity-ui/src/gatewayTool/components/SchemaForm.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • web/packages/agenta-entity-ui/src/gatewayTool/components/SchemaForm.tsx

📝 Walkthrough

Summary by CodeRabbit

  • New Features
    • Multi-question forms can now display one question at a time with progress tracking and a final review screen.
    • Added keyboard navigation, digit shortcuts, optional-question skipping, and improved support for “Other” responses.
    • Choice-based questions can advance automatically after a selection.
  • Bug Fixes
    • The Accept button remains disabled until all required fields are completed.
    • Validation errors now navigate directly to the first incomplete field.
    • Tool attribution displays a clearer name.

Walkthrough

Adds x-ag-stepper schema guidance and support for one-question-at-a-time elicitation forms with review, required-field gating, keyboard choice interactions, custom “Other” values, and validation-focused navigation.

Changes

Elicitation stepper flow

Layer / File(s) Summary
Schema contract and author guidance
.agents/skills/..., api/oss/src/core/workflows/static_catalog.py, sdks/python/agenta/sdk/agents/adapters/agenta_builtins.py, web/packages/agenta-shared/src/utils/elicitation.ts
Schema contracts accept x-ag-* hints, and authoring/tool guidance documents x-ag-stepper for multi-question forms.
Elicitation widget integration
web/oss/src/components/AgentChatSlice/components/clientTools/ElicitationWidget.tsx
The widget passes stepper mode to SchemaForm, disables Accept until required fields are filled, focuses the first invalid field, updates attribution, and shows remaining-answer guidance.
SchemaForm stepper and choice interactions
web/packages/agenta-entity-ui/src/gatewayTool/components/SchemaForm.tsx, web/packages/agenta-entity-ui/src/gatewayTool/components/schemaFormOptions.ts, web/packages/agenta-entity-ui/tests/unit/schemaFormOptions.test.ts
SchemaForm adds navigation, progress, review, field jumping, keyboard choice controls, custom “Other” handling, and array label suppression; helper logic is unit tested.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant RequestInput as request_input tool
  participant ElicitationWidget
  participant SchemaForm
  participant User
  RequestInput->>ElicitationWidget: Send requestedSchema with x-ag-stepper
  ElicitationWidget->>SchemaForm: Configure stepper form
  User->>SchemaForm: Answer and review questions
  SchemaForm-->>ElicitationWidget: Return values or validation errors
  ElicitationWidget->>RequestInput: Submit accepted form
Loading

Possibly related PRs

  • Agenta-AI/agenta#5155: Extends the same elicitation and request_input interaction flow with schema hints and stepper rendering.
  • Agenta-AI/agenta#5177: Overlaps the same ElicitationWidget/SchemaForm layer and enum “Other” handling.
  • Agenta-AI/agenta#5188: Also modifies the embedded build-an-agent skill instructions.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main frontend elicitation UI polish, including friendly attribution, card elevation, and stepper mode.
Description check ✅ Passed The description matches the PR's elicitation UI polish, stepper mode, choice-card behavior, and related tests.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fe-fix/elicitation-chat-polish

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.

A form with several questions (choice-card groups especially) is a wall
of scrolling; the user loses track of which question they are on. Agents
can now opt a form into one-question-at-a-time presentation via
"x-ag-stepper": true on requestedSchema (author-controlled — the x-ag
presentation-hint channel the validator already tolerates).

- SchemaForm stepper: progress header ("Question 2 of 5"), free-roam
  Back/Next, and a final review step listing label → answer (no option
  lists) with click-to-jump rows; unanswered required questions show a
  Required marker. Fields stay MOUNTED and are CSS-hidden per step —
  unmounting would drop antd registration (the collapsed-defaults bug
  class). Validation stays at Accept; a failure jumps to the failing
  question via the new goToField handle.
- request_input description teaches the hint; the shared payload type
  admits x-ag keys on requestedSchema.
…Claude env vars

Removed DAYTONA_AUTOSTOP, DAYTONA_AUTOARCHIVE, DAYTONA_AUTODELETE, and
CLAUDE_CODE_OAUTH_TOKEN environment variables from the runner service.

Changed ngrok tunnel profile from `with-tunnel` (on by default) to
`remote` (off by default). Removed the conditional entrypoint logic that
gracefully exited when NGROK_AUTHTOKEN was unset; now the token is
required when the profile is active. Simplified command to direct
…eys, stepper header/skip/enter

- ChoiceCards Other tile: always-visible input (no click-to-reveal); single-select
  commits as you type, multi keeps Enter/blur chip commit
- Number badges 1..9 on choice cards; digit keypress selects (Other gets next digit)
- Stepper: active question label+description promoted to header, field labels hidden
- Compact progress pill (2/5) replaces the question counter line
- Skip button on optional questions (clears the value); Enter advances with a ⏎ hint
  on Next; Space keeps checkbox toggle semantics
@ardaerzin ardaerzin changed the title fix(frontend): elicitation chat polish — friendly tool names + card elevation fix(frontend): elicitation chat polish — friendly names, card elevation, stepper mode Jul 11, 2026
…ped answer

antd setFieldValue fires no onValuesChange, so Skip cleared the field but
left the localStorage draft holding the pre-skip value; reloading restored
the answer the user explicitly declined, and one-click Accept would have
submitted it.
Playbook bodies deliberately do NOT re-state it (the don't-re-teach rule):
the build-an-agent loop step 1 tells the builder when to set x-ag-stepper,
and the authoring skill's platform fact tells playbook writers it exists.
In chat, Enter means send — the composer footer says '↵ Send' right below
the form, so a Next button advertising ⏎ is a conflicting affordance.
Navigation is click + digit keys; Next becomes a plain default button.
…icator + fill

Fifth round on the dark-mode yellow-wall: the root mistake was keeping the
accent BORDER as the selection signal. The filled indicator already says
selected; selection now reads as a stronger fill (Secondary vs Quaternary),
no border anywhere on cards. The inline Other input becomes a borderless
inset on the container bg (no nested focus rings, no spellcheck squiggles),
and digit badges move to the right edge, full card height, quiet text.
Back/Next were a whole extra row above Accept/Decline, and the default-
variant Next carried a border nothing else has. Navigation is now a
minimal ‹ n/N › pager in the header (text-type icon buttons, no borders),
with Skip folded in as a quiet text button that appears only on optional
questions. Review stays reachable via › past the last question.
…x magic number

The typographic measure (65ch) is content-relative and scales with the
font; the M1-era pixel cap predates choice cards and the stepper.
max-w-prose (65ch) resolved to ~the same ~500px as the old cap at this
font size — a no-op. 672px gives choice-card descriptions and the
header pager visible breathing room.
… options

Stepper: ArrowLeft/Right move between questions, guarded wherever a caret
or dropdown owns the arrows (inputs, textareas, Select, DatePicker).
Choice cards: ArrowUp/Down move focus card-to-card with wrap; selection
stays Enter/Space/click so browsing never mutates the answer.
…cus, auto-advance

Answering a form took multiple Tab presses per question because every
card was its own Tab stop and step changes moved focus nowhere. Three
mechanisms, modeled on what the user is doing (answer, move on):

- Roving tabindex: one Tab stop per card group (selected card, else the
  first); arrows walk cards inside it.
- On step change the answer surface receives focus automatically (never
  on mount — the composer may own focus), so digits/arrows/typing land
  with zero Tab presses.
- A single-select card pick auto-advances to the next question after a
  short beat; multi-select and text fields keep explicit navigation.

Full-keyboard chain: 2 → (auto) → 1 → (auto) → type → → → review → Accept.
Plain ←/→ were rightly guarded inside text inputs (the caret owns them),
which left text-question steps unreachable by keyboard. Cmd/Ctrl+←/→ now
pages deterministically everywhere — inputs included — while plain arrows
keep their native meaning (caret movement, dropdown navigation) and ↑/↓
keeps walking choice cards without any modifier.
The dominant always-enabled primary invited submitting unfinished forms
(navigation is deliberately muted next to it). Accept now enables only
when all required fields hold a value — defaults count, so a fully
prefilled form stays one-click acceptable; Decline/Dismiss remain
always-available.
'Answer the required questions first' read as a scolding. Now it informs:
'2 required answers to go'.
Discoverability fix at the structural level: the dominant primary slot
was a disabled Accept (dead weight) while the actual next action hid in
12px chevrons. While stepping, the primary button IS Next (Review on the
last question, via a new nextStep handle + onStepChange host callback);
Accept rides along muted and takes the primary slot back on review. A
thin segmented progress bar across the card top makes multi-step-ness
visible at a glance; the compact pager stays for direct control.
The primary Next in the action row didn't land — reverted (nextStep/
onStepChange API removed with it, no dead surface). Discoverability
instead: the ‹ › pager chevrons take the accent tint, and question
titles carry their number ('2. Where should release notes be
published?'), pairing with the segmented progress bar.
@ardaerzin
ardaerzin marked this pull request as ready for review July 11, 2026 14:47
@dosubot dosubot Bot added size:XL This PR changes 500-999 lines, ignoring generated files. enhancement New feature or request Frontend UX labels Jul 11, 2026
@ardaerzin

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 2c5181c2-55a3-4c92-9f56-8a5d04ce4ba2

📥 Commits

Reviewing files that changed from the base of the PR and between 1666116 and 1e75acf.

📒 Files selected for processing (8)
  • .agents/skills/write-template-playbooks/SKILL.md
  • api/oss/src/core/workflows/static_catalog.py
  • sdks/python/agenta/sdk/agents/adapters/agenta_builtins.py
  • web/oss/src/components/AgentChatSlice/components/clientTools/ElicitationWidget.tsx
  • web/packages/agenta-entity-ui/src/gatewayTool/components/SchemaForm.tsx
  • web/packages/agenta-entity-ui/src/gatewayTool/components/schemaFormOptions.ts
  • web/packages/agenta-entity-ui/tests/unit/schemaFormOptions.test.ts
  • web/packages/agenta-shared/src/utils/elicitation.ts

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Jul 11, 2026
Make the single-select auto-advance idempotent per question: advance only if still on the question that was answered. Prevents rapid re-picks (two pending timers) or a stale timer after manual navigation from skipping a question.
@ardaerzin

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@ardaerzin
ardaerzin merged commit 9111c8b into big-agents Jul 11, 2026
21 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request Frontend lgtm This PR has been approved by a maintainer size:XL This PR changes 500-999 lines, ignoring generated files. UX

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants