test(cmux-next): add Agent Question Card gallery coverage

Closed
TE
24d ago
+184-1

What changed

Agent Question Card now has a first-class gallery entry instead of an allowlist exception. It uses the shared CmuxAgentQuestion JSON fixtures and covers pending, multi-select previews, four-question tabs, Other typing, submit, Skip, Escape handoff, remote answers, and cancellation.

The gallery wrapper records submitted, skipped, and composer-ready outcomes so the interactive plays are observable. The entry also sets a 350 ms settle budget for the keyboard and pointer paths.

Why

Question cards block an agent pane until a person responds. Their focus, roving selection, previews, tabs, and dismissal behavior need the same repeatable visual and interaction review as the composer and overlays.

Validation

  • webviews/node_modules/.bin/tsc --noEmit -p webviews/tsconfig.json
  • bun test webviews/test/gallery-coverage.test.ts (6 passed; 55 entries, 533 variants)
  • oxfmt --check webviews/src/agent-session/acpmux/question/QuestionCard.gallery.tsx webviews/test/gallery-coverage.allowlist.json
  • bun webviews/scripts/gallery/manifest.ts --entries agent-pane.question-card (9 cases)
  • bun run gallery:build
  • git diff --check

The browser matrix remains a hosted/Freestyle check; no native app build was run on the MacBook Air.

Changelog

Added: Agent Question Card gallery coverage for focus, selection, previews, dismissal, and remote answer states.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Summary by cubic

Adds first-class gallery coverage for the Agent Question Card, replacing the allowlist exception that previously exempted it from coverage checks. The entry uses the shared CmuxAgentQuestion fixtures to review focus, roving selection, previews, tabs, and dismissal alongside the composer and overlays.

  • Covers pending, multi-select previews, four-question tabs, Other typing, submit, Skip, Escape handoff, remote answers, and cancellation.
  • The wrapper records submitted, skipped, and composer-ready outcomes for observable plays and sets a 350 ms settle budget with a small layout-shift allowance when switching prompts.

[!NOTE]
Low Risk
Test/gallery-only changes; no production QuestionCard behavior or shipped UI paths are modified.

Overview
Agent Question Card now has a first-class webviews gallery entry (agent-pane.question-card) instead of a coverage allowlist exemption.

The new gallery file wraps QuestionCard with observable data-question-reply / data-question-escaped hooks, loads shared CmuxAgentQuestion JSON fixtures, and defines nine variants with optional play scripts (keyboard preview, multi-submit, tab switch, Other typing, Escape-to-composer, Skip) plus performance checks (350 ms settle, layout-shift cap). gallery-coverage.allowlist.json drops QuestionCard.tsx#QuestionCard because covers now satisfies the coverage test.

Reviewed by Cursor Bugbot for commit 2598c7615c4ddb9b4f1312020b7b9b6ffa433d66. Bugbot is set up for automated code reviews on this repo. Configure here.