Skip to content

fix(chat): route conversation-file write-error fallbacks through i18n and close test gaps (#21084) - #21149

Closed
mrveiss wants to merge 4 commits into
mainfrom
issue-21084
Closed

mrveiss wants to merge 4 commits into
mainfrom
issue-21084

Conversation

@mrveiss

@mrveiss mrveiss commented Nov 8, 2026 •

Copy link
Copy Markdown
Owner

Thinking Path

Issue #21084 collects the review findings deferred from the quota-refusal translation work. The write-error fallbacks in the conversation-files composable were still English literals, and the refusal spec asserted too little. Reuse the existing upload key, add three English-only keys, and tighten the tests.

What Changed

  • useConversationFiles.ts: upload, create, save and copy failure texts (the success: false path and the catch fallback) come from i18n. Upload reuses chat.input.uploadError.unknown; new chat.conversationFiles.{createFailed,saveFailed,copyFailed} keys in en.json.
  • PhaseProgressionIndicator.unscored.test.ts: asserts the English incomplete status key exists and that a locale defining it renders it, not the formatStatus fallback.
  • useConversationFiles.createRefusal.spec.ts: save, copy and upload assert the full mocked translation result; uploadFiles asserts false on refusal; new non-refusal tests for copyFile and uploadFiles assert the server detail is kept; a table test asserts each translated fallback.

Verification

Scratch copy run: src/composables/__tests__ plus the PhaseProgressionIndicator unscored and locale-parity tests: 111 files, 1460 passed, 1 skipped. eslint clean on the changed composable and spec. Closes #21084 (all 5 items delivered). Refs #21061, #21013.

Model Used

Claude Sonnet 5.5

@mrveiss mrveiss added this to the M3 - Refined GUI complete milestone Nov 8, 2026
@mrveiss mrveiss added bug Something isn't working frontend phase:M3.9 Chat, Agents, Analytics and Settings screens labels Nov 8, 2026
@coderabbitai

coderabbitai Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Notice: 29 open PRs — past the runaway threshold (25)

This is not a request to defer this PR. There is no cap on open PRs (#19397) -- nothing blocks opening or pushing a PR.

This notice only means the count is high enough to be worth a glance for a runaway — something opening PRs in a loop, or a merge pipeline that has stalled so nothing is draining.

Currently open:

If the queue is draining normally, ignore this. Otherwise:

  1. Check whether CI is dispatching at all — see the ci-dispatch-watchdog status on these PRs
  2. Approved PRs land through the merge train the coordinator sequences (merge commits, never squash) -- check the open chore(merge-train) PR is moving, not each PR on its own
  3. Look for a loop opening near-identical PRs

Warn-only runaway detector — .github/workflows/pr-queue-gate.yml. It never blocks a merge.

@mrveiss

mrveiss commented Nov 8, 2026

Copy link
Copy Markdown
Owner Author

Code review (code-reviewer pass) follow-up at 912d66d

Verdict: no blocking findings. The code-reviewer subagent could not be launched from this session (no Agent tool), so this is a self-review of the origin/main...issue-21084 diff; a separate reviewer pass is still owed.

Finding Handling
describeFailure translates the fallback key eagerly even when a refusal or server message wins Left as is: negligible cost, keeps the function a single expression.
Every success-false and catch path for upload/create/save/copy now uses a key Verified by grep: no remaining English literals in these paths.
New keys are English only Intended per the locale policy; locale-parity test passes.
Test expectations match the mock's key order Checked against real output; a fallback test uses a response with no message so the server detail cannot win.

@mrveiss

mrveiss commented Nov 8, 2026

Copy link
Copy Markdown
Owner Author

Code review (code-reviewer pass) at 912d66d
Verdict: APPROVE (0 blocking)

# Severity File:line Issue Fix
1 info useConversationFiles.ts describeFailure Local t wrapper duplicates the arrow used in the refusal call previously inline; single definition now, fine. none
2 info en.json chat.conversationFiles English-only keys, per current i18n policy. chat.input.uploadError.unknown exists ("Upload failed") so the upload fallback text is unchanged. none
CodeRabbit threads: 0 total; nothing outstanding
AC coverage (Closes #21084, 5 items):
  • AC1 (i18n write-error fallbacks) ✓ useConversationFiles.ts upload (i18n.global.t('chat.input.uploadError.unknown') and describeFailure key), create/save/copy keys chat.conversationFiles.*; no English literal remains in those paths.
  • AC2 (incomplete key asserted) ✓ PhaseProgressionIndicator.unscored.test.ts statusKeys.incomplete toBe 'Incomplete', plus a locale 'yy' defining it renders 'translated incomplete'.
  • AC3 (full mocked translation result) ✓ createRefusal.spec.ts quotaText asserted with toBe for save, copy, upload.
  • AC4 (uploadFiles false on refusal) ✓ expect(await files.uploadFiles(...)).toBe(false).
  • AC5 (non-refusal copy/upload keep server detail) ✓ two new tests asserting 'boom'; plus an it.each table for the translated fallbacks.
    Main-merge commits: clean (two author commits, each single-parent, on current main)

@mrveiss

mrveiss commented Nov 8, 2026

Copy link
Copy Markdown
Owner Author

Code review (code-reviewer pass) follow-up at 912d66d

Verdict: APPROVE. All 5 items in #21084 are delivered; en.json parses and carries every key the code reads. Two LOW follow-ups, neither blocking.

Severity File:line Finding Fix
LOW useConversationFiles.ts ~L371/374 renameFile (a write path, sibling of the four fixed) still has hardcoded 'Rename failed'. Outside #21084's listed scope. Add chat.conversationFiles.renameFailed and route both lines through t / describeFailure in a follow-up.
LOW useConversationFiles.ts L142/165/170/226/254/277/285/345/362/381/393/408, L157/245/270/300/386 Remaining read/guard-path literals ('No session ID provided', 'Failed to load files', 'Missing parameters', ...) were not in #21084, so untouched. Track as a separate i18n sweep so the file ends with no UI literals.

Verified:

  • Follow-ups from merge train #21061 review: quota refusal translation (#21013) #21084 item 1: upload (2 sites), create (2), save (2), copy (2) fallbacks now use i18n keys. describeFailure takes a key and translates only the fallback, so extractApiErrorMessage still returns the server detail first.
  • Keys: chat.conversationFiles.{createFailed,saveFailed,copyFailed} added once, with no duplicate parent. chat.input.uploadError.unknown already exists ("Upload failed"), and the strings match the old literals.
  • Item 2: the test asserts workflow.phaseProgression.status.incomplete in en.json, then renders a yy locale defining only incomplete. That proves the key is read, not the formatStatus fallback.
  • Item 3: save, copy and upload now assert the full key|params string with toBe, replacing toContain.
  • Item 4: uploadFiles is asserted to return false on refusal.
  • Item 5: non-refusal tests for copyFile and uploadFiles assert 'boom' is kept. A parametrized it.each also covers the translated fallback for all four operations when the server sends no message, and asserts false. The mocked t echoes the key, so these are not vacuous.
  • Not run: I did not run the tests (read-only review).

@mrveiss

mrveiss commented Nov 8, 2026

Copy link
Copy Markdown
Owner Author

Landed via merge train #21184, merge commit 209d547 (frozen head 912d66d is an ancestor of it).

@mrveiss

mrveiss commented Nov 18, 2026

Copy link
Copy Markdown
Owner Author

Branch audit (zero-change deletion). This PR shows 0 changed files against main (head 140fca5e67): every change it carried is already in main. Closing and deleting the branch through this PR; it can be restored with the Restore branch button below.

@mrveiss mrveiss closed this Nov 18, 2026
@mrveiss
mrveiss deleted the issue-21084 branch November 18, 2026 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working frontend phase:M3.9 Chat, Agents, Analytics and Settings screens

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Follow-ups from merge train #21061 review: quota refusal translation (#21013)

1 participant