Skip to content

fix(web-ui): translate the deck list load error and test Settings - #496

Merged
ShotaroKataoka merged 4 commits into
mainfrom
fix/webui-e-followups
Nov 3, 2026
Merged

ShotaroKataoka merged 4 commits into
mainfrom
fix/webui-e-followups

Conversation

@ShotaroKataoka

Copy link
Copy Markdown
Contributor

#493(refactor E)のレビューで残った低優先度の指摘 2 件(項目 3 と 5)への対応です。

変更

  • デッキ一覧の読み込み失敗バナーを翻訳(web-ui/src/hooks/useDeckList.ts)
    • 初回読み込みに失敗したとき、deckService が組み立てた英語のエラー本文(Failed to list decks: 500 など)や英語のフォールバックではなく、decksPage.errorLoadDecks を表示します。
      • en: Failed to load decks.
      • ja: デッキを読み込めませんでした
    • 元のエラーは console.error に残します(.kiro/steering/i18n.md に沿い、エラー本文自体は翻訳しません)。
    • hook は失敗フラグだけを state に持ち、返すときに翻訳します。読み込みの effect の依存に t を足していないので、言語を切り替えても一覧を取り直しません。戻り値の形(error: string | null)は変わりません。
  • Settings の単体テストを追加(web-ui/src/components/Settings.test.tsx、Local モード)
    • エージェント選択を保存すると、日本語の成功トーストが出ること
    • PUT が失敗すると選択が元に戻り、日本語のエラートーストが出ること
  • useDeckList.test.ts に、読み込み失敗時のバナー文言(en / ja)のテストを追加しました。

依存関係の変更はありません。

検証

  • i18n キーのパリティチェック(.kiro/steering/i18n.md): OK
  • cd web-ui && npx eslint src/ --quiet && npx tsc --noEmit && npm test && npm run build:cloud: すべて pass(71 ファイル / 617 テスト)
  • ビルドで書き換わった web-ui/next-env.d.ts は元に戻しています。

- useDeckList: the first-load failure banner shows the translated
  decksPage.errorLoadDecks instead of the raw deckService error (English);
  the raw error goes to console.error. Translated at render, so the load
  effect does not re-run on locale change.
- Add Settings.test.tsx (local): the agent-updated toast is translated (ja)
  and a failed PUT rolls the selection back with the translated error.

Follow-up to review items 3 and 5 of #493.

Verified: i18n key parity OK; eslint --quiet, tsc --noEmit pass;
npm test 71 files pass; npm run build:cloud pass.
@ShotaroKataoka ShotaroKataoka added the blog:skip ブログ対象外 label Nov 2, 2026
@ShotaroKataoka
ShotaroKataoka enabled auto-merge (squash) November 2, 2026 23:57
@ShotaroKataoka
ShotaroKataoka merged commit c1a7c49 into main Nov 3, 2026
18 checks passed
@ShotaroKataoka
ShotaroKataoka deleted the fix/webui-e-followups branch November 3, 2026 00:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blog:skip ブログ対象外

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant