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
Conversation
…zed no-task errors, error-state a11y and locale fixes (B3b v2-16, epic Zoo-Code-Org#1375)
Review statusThanks 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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(base45f810db9). Ports the two upstream commitsa0693e9e402a+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 correlatedcheckpointRollbackResultfailure 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.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'saria-label/titlenow 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 thesafeParserejection independently of the parse-failure path), a11y + path-label assertions,{{path}}interpolation in thetmock, 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).openFilegains the{{path}}slot, plus locale fixes (esrollingBack, hirollbackWarning/openFile, it rollback statuses → restore wording, ko completed statuses).Base-parity decisions
webviewMessageHandler.ts,webviewMessageHandler.rollback.spec.ts, and the 18src/i18n/locales/<loc>/common.jsonfiles: 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 existingStryker disable next-linedirective 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 (StandardTooltipinline-content mock,withinimport, 2 content-matched tooltip tests, the mutation-coverage describe — 425/1 vs upstream). The v2-14 open-filetitleassertion is subsumed by upstream's new path-labelaria-label/titleassertions (single interpolated pair).openFile/fix lines ported; the What's New marketing text keeps the local (pre-upstream) copy per the v2-13 skip policy.changeCardDetailstays optional inpackages/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 a11yaria-labelfallbacks — the fallback text is only evaluated when the failure carries no error, and its value was asserted only via the tooltip content, never via thearia-label:ChangeCard.tsx:231(StringLiteral, Survived)aria-labelfallbackt("chat:changeCard.rollbackFailed")was never assertedaria-label = "Rollback failed"ChangeCard.tsx:306(StringLiteral, Survived)aria-labelfallback was asserted only via the tooltip contentaria-label = "Restore failed"ChangeCard.tsx:379(StringLiteral, Survived)aria-labelfallback — the same gap as:231(The
??LogicalOperator mutants on all three lines were already killed by the existing empty-stringerror: ""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-types11/11webviewMessageHandler.rollback.spec.tsvitest: 14/14 (11 at the base head + 3 new correlated-failure/no-task tests)ChangeCard.spec.tsxvitest: 41/41 (39 at the base head + 1 upstream schema-invalid test + 1 new round-2 mutation test, 1 test rename)--max-warnings=0), suppression counts unchanged, prettier clean (webview files: CRLF→LF normalization only, content-identical), pre-committurbo lint11/11node scripts/find-missing-translations.js— all green