Skip to content

feat(web): question cards for agent elicitations (ZOD078) - #46

Merged
orivibes merged 1 commit into
mainfrom
feat/zod078-elicitation
Sep 30, 2026
Merged

orivibes merged 1 commit into
mainfrom
feat/zod078-elicitation

Conversation

@orivibes

@orivibes orivibes commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Agent form questions now appear as answerable cards inside their Matrix thread. Submitting, skipping, or cancelling returns a correlated response to the daemon; cards wait for daemon confirmation before showing a terminal state. Implements the web half of ZOD078 PLAN.md.

Supports typed fields, single/multiple choice, descriptions, editable defaults, Claude custom answers, required-field feedback, daemon field errors, permission checks, stale answers, and confirmed answer values after reload. Adds question notifications and an awaiting-input indicator that replaces typing while a question remains open. Includes a web minor changeset.

Validation:

  • Full web suite: 955 tests passed; typecheck and production build passed.
  • 42 Storybook screenshots reviewed across light/dark themes, including real ThreadView and awaiting-input scenes. Browser console/error checks were clean.
  • Browser interaction checks confirmed selected/custom answer serialization, required-field feedback, keyboard focus, and checkbox Space behavior.
  • Earlier high-concurrency integration failures also reproduced on clean origin/main; the final bounded-concurrency run passed without changing shared test setup.

Paired daemon PR: zooid-ai/zooid#101. Per the cycle plan, merge the daemon first, then this PR. Ori performs the real Claude ask → answer → same-turn continuation and interrupt smoke after merge. Restart journaling/reconciliation is intentionally deferred; orphan requests remain visible after a daemon restart.

Not verified:

  • UX Tester did not inspect Skipped, Cancelled, Interrupted, AnsweredThenContinued, or TypingIndicator Awaiting / TwoAwaiting.
  • Checkbox Space toggling and the focus ring weren't checked by UX Tester. My own earlier browser check covered checkbox Space; that is not UX-verified.
  • Dark mode was only checked on MultipleQuestions, AwaitingConfirmation and OpenQuestion.
  • UX Tester's round 2 ended early because Storybook on :6106 was stopped mid-run.

@zooidbot zooidbot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Architect review against the ZOD078 PLAN. Verdict: matches the plan, no blockers. CI is green. A UX Tester pass on the stories is pending; results will follow in the thread.

What I checked and found correct

  • A card can only be closed by the requesting agent's own elicitation_resolved, matched on request_id, request_event_id and the thread root. Rejections are matched to my response_event_id, so another viewer's invalid answer doesn't paint errors on my card.
  • The card never shows a terminal state before the daemon confirms: the flow is sending → awaiting_confirmation → resolved. Confirmed content is shown after reload.
  • There's one validator, and it lives in the daemon (decision 8). The card only shows daemon fieldErrors / stale. Previews stay unrendered metadata (decision 6).
  • "Awaiting your input" is derived from open requests and replaces "is typing" for that agent (decision 7). Response/resolved/rejected events render no tile. The notification reads " asks: …".

Non-blocking

  1. Perf nit: useElicitationTrail rescans allRoomEvents(room) per card on every room event. It's fine at today's room sizes. If long rooms with many questions get sluggish, index the trail once per room snapshot, keyed by request_id.
  2. The awaiting indicator stays up for orphaned requests, both after a daemon restart and if resolved never lands. That's expected under the plan's out-of-scope note. The follow-on journal cycle clears it by publishing interrupted.

Merge after zooid-ai/zooid#101.

@zooidbot

Copy link
Copy Markdown
Collaborator

UX Tester results for this PR (two rounds, from Coding's report to Architect). All 13 checks passed and nothing failed. Screenshots are in /Users/ori/Code/z-worktrees/ux-tester/shots/.

Story Theme Result Shot
QuestionCardView/SingleQuestion (+ Space/focus on a radio) light ✅ ZOD078-timeline-questioncardview--single-question.png, ZOD078-single-space-focus.png
QuestionCardView/MultipleQuestions dark ✅ ZOD078-multiple-dark.png
QuestionCardView/ServerErrors light ✅ ZOD078-server-errors.png
QuestionCardView/Sending light ✅ ZOD078-sending.png
QuestionCardView/AwaitingConfirmation dark ✅ ZOD078-awaiting-dark.png
QuestionCardView/Answered light ✅ ZOD078-answered.png
QuestionCardView/NoPermission light ✅ ZOD078-no-permission.png
TypingIndicator/AwaitingAndTyping light ✅ ZOD078-awaiting-typing.png
ThreadViewQuestion/OpenQuestion dark ✅ ZOD078-thread-open-dark.png
QuestionCardView/TypedFields light ✅ clients-46-typed-fields-light.png
QuestionCardView/Stale light ✅ clients-46-stale-light.png
QuestionCardView/SendError light ✅ clients-46-send-error-light.png
QuestionCardView/Unsupported light ✅ clients-46-unsupported-light.png

The gaps are listed under Not verified in the PR description.

@orivibes
orivibes merged commit a252e7c into main Sep 30, 2026
1 check passed
@zooidbot
zooidbot deleted the feat/zod078-elicitation branch October 1, 2026 06:09
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.

2 participants