Skip to content

fix(webview): correlate change-card rollback/restore failures, localized no-task errors, error-state a11y and locale fixes (B3b v2-16, epic #1375) - #61

Open
easonLiangWorldedtech wants to merge 1 commit into
feat/fws-v2-15-restore-latest-uifrom
feat/fws-v2-16-correlated-failures-a11y
Open

fix(webview): correlate change-card rollback/restore failures, localized no-task errors, error-state a11y and locale fixes (B3b v2-16, epic #1375)#61
easonLiangWorldedtech wants to merge 1 commit into
feat/fws-v2-15-restore-latest-uifrom
feat/fws-v2-16-correlated-failures-a11y

Conversation

@easonLiangWorldedtech

Copy link
Copy Markdown
Owner

What

B3b v2-16 (epic Zoo-Code-Org#1375): correlated failure posts, localized no-task errors, error-state a11y, and locale fixes for the change-card rollback/restore paths. Stacked on feat/fws-v2-15-restore-latest-ui (base 45f810db9). Ports the two upstream commits a0693e9e402a + ea90ea895acb (upstream PR Zoo-Code-Org#1412; its empty CI commits are skipped).

  • webviewMessageHandler.ts (+80/−39): the three change-card rollback/restore cases (file rollback, step rollback, file restore-latest) are wrapped in try/catch — a throw between the request and the result post (lazy import, journal read, git restore) now posts a correlated checkpointRollbackResult failure instead of leaving the requesting card pending forever.
  • webviewMessageHandler.rollback.spec.ts (+76/−3): i18n mock for the handler, correlated-failure tests for thrown rollbacks/restores, and the no-active-task failures now assert the localized copy.
  • 18 × src/i18n/locales/<loc>/common.json (+2 each): errors.message.no_active_task_to_roll_back / _restore — the no-active-task failures post localized copy instead of hardcoded English strings.
  • ChangeCard.tsx (+15/−2): the three error states (file rollback, file restore, step) are focusable status elements (role="status", tabIndex={0}, aria-label = the actual error), so the error detail is reachable by keyboard and screen-reader users, not only via the hover tooltip. The compact-row open-file control's aria-label/title now name the target file (t("chat:changeCard.openFile", { path }) — "Open file: ", matching CodeAccordion).
  • ChangeCard.spec.tsx (+83/−8): the upstream v2-16 spec changes (+43/−8 — a schema-invalid payload test (syntactically valid {} → inert card row, covering the safeParse rejection independently of the parse-failure path), a11y + path-label assertions, {{path}} interpolation in the t mock, and the no-files success test renamed to what it proves) + 1 new round-2 mutation test (+40, the aria-label fallback, see Stryker below).
  • 18 webview locales: openFile gains the {{path}} slot, plus locale fixes (es rollingBack, hi rollbackWarning/openFile, it rollback statuses → restore wording, ko completed statuses).

Base-parity decisions

  • webviewMessageHandler.ts, webviewMessageHandler.rollback.spec.ts, and the 18 src/i18n/locales/<loc>/common.json files: byte-identical to upstream v2-16 (the local pre-state was byte-identical to upstream v2-15).
  • ChangeCard.tsx = upstream v2-16 + 15 lines only: the 6 existing Stryker disable next-line directive lines + 9 justification comment lines (upstream carries 0 directives). No v2-16 hunk rewrites a directive line, so all 6 carry over unchanged.
  • ChangeCard.spec.tsx = upstream v2-16 spec + the local round-2 superset (StandardTooltip inline-content mock, within import, 2 content-matched tooltip tests, the mutation-coverage describe — 425/1 vs upstream). The v2-14 open-file title assertion is subsumed by upstream's new path-label aria-label/title assertions (single interpolated pair).
  • Webview locales: the openFile/fix lines ported; the What's New marketing text keeps the local (pre-upstream) copy per the v2-13 skip policy.
  • changeCardDetail stays optional in packages/types (v2-9 documented divergence; untouched here).

Stryker (local diff gate, base 45f810db9)

Run 1 (head 76643aec6) was red with 3 blocking mutants, all Survived StringLiteral in the new a11y aria-label fallbacks — the fallback text is only evaluated when the failure carries no error, and its value was asserted only via the tooltip content, never via the aria-label:

Mutant Cause Fix
ChangeCard.tsx:231 (StringLiteral, Survived) the file-rollback aria-label fallback t("chat:changeCard.rollbackFailed") was never asserted new round-2 test: a no-error file failure asserts aria-label = "Rollback failed"
ChangeCard.tsx:306 (StringLiteral, Survived) the restore aria-label fallback was asserted only via the tooltip content the existing round-2 restore-tooltip test now also asserts aria-label = "Restore failed"
ChangeCard.tsx:379 (StringLiteral, Survived) the step aria-label fallback — the same gap as :231 covered by the same new test (step-level failure without an error)

(The ?? LogicalOperator mutants on all three lines were already killed by the existing empty-string error: "" test; the 44 extension-lane handler mutants are killed by the upstream correlated-failure tests.)

Final gate (head 877cb093a): 80 changed-code lines (extension lane) → 44 valid mutants: 44 Killed, 0 Survived, 0 NoCoverage, 0 timeout, 0 Ignored. 15 changed-code lines (webview lane) → 10 valid mutants: 10 Killed, 0 Survived, 0 NoCoverage, 0 timeout, 0 Ignored. 0 blocking.

Gates

  • pnpm check-types 11/11
  • webviewMessageHandler.rollback.spec.ts vitest: 14/14 (11 at the base head + 3 new correlated-failure/no-task tests)
  • ChangeCard.spec.tsx vitest: 41/41 (39 at the base head + 1 upstream schema-invalid test + 1 new round-2 mutation test, 1 test rename)
  • eslint 0 (src + webview-ui, --max-warnings=0), suppression counts unchanged, prettier clean (webview files: CRLF→LF normalization only, content-identical), pre-commit turbo lint 11/11
  • node scripts/find-missing-translations.js — all green
  • diff budget: 40 files, +316/−78 (394 shortstat lines) < 400 soft cap → single PR, no split required

…zed no-task errors, error-state a11y and locale fixes (B3b v2-16, epic Zoo-Code-Org#1375)
@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown

Review status

Thanks for contributing. This comment tracks the review sequence and the next action.

Current step: Required CI passed. Waiting for automated review of the latest commit.

If automated review does not start, a maintainer must restart it.

Review-state labels are managed by this workflow; do not edit them manually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-coderabbit Waiting for CodeRabbit to approve the latest commit coderabbit-review-active Required CI passed; CodeRabbit review is active

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants