Skip to content

fix(web): localize artifact preview controls and errors - #546

Open
testikun wants to merge 1 commit into
openpi-dev:mainfrom
testikun:codex/issue-350-preview-i18n
Open

testikun wants to merge 1 commit into
openpi-dev:mainfrom
testikun:codex/issue-350-preview-i18n

Conversation

@testikun

Copy link
Copy Markdown
Contributor

Problem

Refs #350. In the Chinese Web workbench, the file-preview dialog still used English for its title, actions, read-only/version details, truncation notice, accessibility names, and artifact failures.

Value

The preview can be inspected and operated consistently in the active language without changing the file contents or the authority of the read-only artifact path.

Approach

  • Use the existing react-i18next catalogue for preview-only UI text and known ARTIFACT_* errors. Preserve unknown server diagnostics verbatim.
  • Keep the underlying error until render so a language change while the panel is open reprojects its text without repeating a request.
  • Assign typed artifact error codes to two local download failures. Do not change Host receipts, file bytes, refresh, or download semantics.
  • Retain the built Web asset. This is a partial feat(web): add persistent theme/language preferences and accessibility/mobile hardening #350 fix; theme, language persistence, and broader mobile/a11y work remain separate.

Validation

  • bun run check: passed (config/docs/discipline, Web build/typecheck, format, lint, TypeScript).
  • bun run test: Node 1658 passed, 1 platform skip; Vitest 221 passed.
  • Focused vitest run tests/web/evidence-view.spec.ts: 6/6 after removing an unnecessary test Provider wrapper (ablation).
  • Real Chrome playwright test --config tests/web/playwright.config.ts tests/web/artifact-evidence.e2e.ts: 1/1, zh-CN fixture, verified download, refresh, missing-file error, and axe checks. No model call.
  • Source identity: upstream main@f6b49ae59605b1276b8267f2886d22c03f01533c; isolated pi list showed the single OpenPI source at this worktree. No claim about an npm-installed runtime.

Before (Chinese page, English preview):

English preview on Chinese page

After (same fixture, Chinese preview):

Localized preview on Chinese page

Impact

  • User-visible: file-preview controls, status, and known artifact errors follow the current language; file contents remain unchanged.
  • Model-visible context/tools: none.
  • Runtime/lifecycle and persisted config/data: none.
  • Compatibility/risk: local download errors now carry typed WebApiError codes; unknown error messages continue to display their original diagnostics. Other Web surfaces and language preference ownership are unchanged.

@github-actions github-actions Bot added the area:github GitHub workflows, templates, ownership, or tests label Sep 17, 2026

@tt-a1i tt-a1i left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

审查提交:e556d5dff1aaf134c9d521b92c663e2d58129eab

本轮未发现新的阻断问题。以下结论仅覆盖所列验证范围,不是合并批准。

验证范围

Full source and tests diff reviewed. Artifact evidence-view component tests passed, including language switching with an open preview, structured errors, unchanged file content and stale-preview warnings.

限制与后续

Did not rerun real browser artifact E2E. Unknown API codes and generic Error messages retain server text as fallback; no change to access/download authority. Branch requires current-main integration.

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

Labels

area:github GitHub workflows, templates, ownership, or tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants