Skip to content

Commit ea90ea8

Browse files
committed
fix(webview): cover the schema-invalid change-card path and correct it/ko rollback statuses (CodeRabbit, B3b, #1375)
- ChangeCard spec: add a case with syntactically valid but schema-invalid JSON ({}) asserting the card renders nothing, so the changeCardSchema.safeParse rejection path is covered independently of the parse-failure path. - it chat.json: the in-progress/completed rollback statuses used cancellation wording (Annullamento.../Annullato/Passaggio annullato), which reads as the operation being cancelled; they now use restore wording (Ripristino in corso.../Ripristinato/Passaggio ripristinato), and rollbackFailed is aligned to the existing restoreFailed value (Ripristino non riuscito). - ko chat.json: the completed statuses were terse action names (되돌림 / 단계가 되돌려졌음); they now read as explicit completed statuses (되돌림 완료 / 단계 되돌림 완료).
1 parent a0693e9 commit ea90ea8

3 files changed

Lines changed: 17 additions & 6 deletions

File tree

‎webview-ui/src/components/chat/__tests__/ChangeCard.spec.tsx‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,17 @@ describe("ChangeCard", () => {
160160
expect(container.innerHTML).toBe("")
161161
})
162162

163+
it("renders nothing for a schema-invalid card payload", () => {
164+
// Syntactically valid JSON that fails changeCardSchema: the
165+
// safeParse rejection path (not only the parse-failure path) must
166+
// also yield an inert card row.
167+
const { container } = renderWithExtensionState(
168+
<ChangeCard message={{ type: "say", say: "change_card", ts: 1, text: "{}" } as ClineMessage} />,
169+
)
170+
171+
expect(container.innerHTML).toBe("")
172+
})
173+
163174
it("rolls back one file through the checkpointRollbackFile message and shows pending + success", async () => {
164175
renderWithExtensionState(<ChangeCard message={makeCardMessage()} />)
165176

‎webview-ui/src/i18n/locales/it/chat.json‎

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎webview-ui/src/i18n/locales/ko/chat.json‎

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)