Skip to content

韓国語の列車種別名が空欄になる問題を修正 - #6534

Merged
TinyKitten merged 2 commits into
devfrom
fix/train-type-korean-font
Aug 5, 2026
Merged

TinyKitten merged 2 commits into
devfrom
fix/train-type-korean-font

Conversation

@TinyKitten

@TinyKitten TinyKitten commented Aug 5, 2026 •

Copy link
Copy Markdown
Member

概要

韓国語の列車種別名が空欄になる問題を修正します。

変更の種類

  • バグ修正
  • 新機能
  • リファクタリング
  • ドキュメント
  • CI/CD
  • その他

変更内容

  • 通常テーマで指定していたバンドル版 Roboto にハングルのグリフが含まれないことが原因でした。
  • ヘッダー言語が韓国語の場合はカスタムフォントを指定せず、OSのハングル対応システムフォントへフォールバックします。
  • フェード中の旧種別名には、旧言語と同じフォントファミリー・ウェイトを維持します。
  • KOからJAへの切替中と、フォント解決のLEDテーマ分岐を含む回帰テストを追加しました。
  • 影響範囲は TrainTypeBox の言語切替表示に限定されます。新旧テキストの表示設定を同じ更新単位で保持し、切替完了後に更新します。

テスト

  • npm run lint が通ること
  • npm test が通ること
  • npm run typecheck が通ること

実行したテスト:

  • npm test -- --runInBand src/components/TrainTypeBox.test.tsx(12件成功)
  • npm test -- --runInBand(202スイート、2176件成功)
  • npm run lint
  • npm run typecheck
  • git diff --check
  • Android実機 T12_ROW で TrainTypeBox に韓国語種別名「쾌속」が表示されることを確認

関連Issue

なし

スクリーンショット(任意)

Android実機 T12_ROW で韓国語種別名「쾌속」の表示を確認済みです。

Summary by CodeRabbit

  • 改善
    • 韓国語表示時にOSのフォールバックフォントを使用するようになり、文字がより自然に表示されます。
    • LEDテーマでも、韓国語の文字に適したフォント表示に対応しました。

@TinyKitten TinyKitten self-assigned this Aug 5, 2026
@github-actions github-actions Bot added the react label Aug 5, 2026
@coderabbitai

coderabbitai Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

TrainTypeBoxにテーマと言語状態に基づくフォント解決を追加しました。韓国語ではOSフォントへフォールバックし、韓国語以外では既存フォントを使用します。関連する表示処理とテストを更新しました。

Changes

列車種別フォントの言語対応

Layer / File(s) Summary
フォント解決と表示処理
src/components/TrainTypeBox.tsx
resolveTrainTypeFontFamilyを追加しました。韓国語ではundefinedを返し、それ以外ではテーマに応じたフォントを返します。表示処理のメモ化依存値とLEDテーマのウェイト条件も更新しました。
フォント解決のテスト
src/components/TrainTypeBox.test.tsx
韓国語でundefined、韓国語以外でFONTS.RobotoBoldを返す動作をテストします。

Estimated code review effort: 3 (Moderate) | ~20 minutes

Poem

うさぎがフォントをぴょんと選ぶ
韓国語ならOSへ跳ぶ
RobotoBoldは元気に待つ
テーマの灯りも正しく映る
テストの耳が動いたよ

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed 韓国語の列車種別名が空欄になる問題の修正を明確に示しており、変更内容と一致しています。
Description check ✅ Passed 必須セクションを含み、変更内容、テスト結果、影響範囲を具体的に記載しています。
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/train-type-korean-font

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/components/TrainTypeBox.test.tsx (1)

128-141: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

LEDテーマの回帰ケースを追加してください。

resolveTrainTypeFontFamily には KO 判定と APP_THEME.LED 判定があります。現在のテストは APP_THEME.TOKYO_METRO の2ケースだけです。そのため、LEDテーマの非韓国語フォントと、LEDテーマでの韓国語フォールバックを検証できません。

追加例
+  it('LEDテーマでは韓国語以外にドットフォントを使用する', () => {
+    expect(resolveTrainTypeFontFamily(APP_THEME.LED, 'JA')).toBe(
+      FONTS.JFDotJiskan24h
+    );
+  });
+
+  it('LEDテーマでも韓国語はOSフォントへフォールバックする', () => {
+    expect(resolveTrainTypeFontFamily(APP_THEME.LED, 'KO')).toBeUndefined();
+  });

As per coding guidelines: 挙動を変更した場合は、同じ変更セットで関連するテストを更新または追加します。

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/TrainTypeBox.test.tsx` around lines 128 - 141,
resolveTrainTypeFontFamily のテストに APP_THEME.LED
の回帰ケースを追加し、韓国語ではハングル対応OSフォントへのフォールバック、韓国語以外ではLEDテーマ固有のフォントが返ることを検証してください。既存のTOKYO_METROテストは維持してください。

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/components/TrainTypeBox.tsx`:
- Around line 204-206: Update TrainTypeBox’s animated text state so
prevTrainTypeName retains the previous headerLangState, font family, and font
weight from the same update cycle. Apply those retained styles to the lower
RNAnimated.Text instead of the current animatedTextBaseStyle, while preserving
current styling for newly displayed text. Add a regression test covering KO
switching to JA, EN, or ZH during the fade transition.

---

Nitpick comments:
In `@src/components/TrainTypeBox.test.tsx`:
- Around line 128-141: resolveTrainTypeFontFamily のテストに APP_THEME.LED
の回帰ケースを追加し、韓国語ではハングル対応OSフォントへのフォールバック、韓国語以外ではLEDテーマ固有のフォントが返ることを検証してください。既存のTOKYO_METROテストは維持してください。
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5f288fd9-593d-4bff-9a93-85b6c5423425

📥 Commits

Reviewing files that changed from the base of the PR and between e784ab1 and 6075aeb.

📒 Files selected for processing (2)
  • src/components/TrainTypeBox.test.tsx
  • src/components/TrainTypeBox.tsx

Comment thread src/components/TrainTypeBox.tsx Resolved
@TinyKitten
TinyKitten merged commit 25e059e into dev Aug 5, 2026
5 checks passed
@TinyKitten
TinyKitten deleted the fix/train-type-korean-font branch August 5, 2026 02:40
@TinyKitten TinyKitten mentioned this pull request Aug 5, 2026
6 of 9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant