Skip to content

E231系テーマの列車種別表示を改善 - #5726

Merged
TinyKitten merged 1 commit into
devfrom
feature/e231-minor-fixes
Mar 30, 2026
Merged

TinyKitten merged 1 commit into
devfrom
feature/e231-minor-fixes

Conversation

@TinyKitten

@TinyKitten TinyKitten commented Mar 30, 2026 •

Copy link
Copy Markdown
Member

Summary

  • CJK表示時のletterSpacingを0に変更し、文字間の余計なスペースを除去
  • 英語表示時にskewXトランスフォームで斜体風表示を追加
  • 中央特快・青梅特快・通勤特快・通勤快速の英語種別表示を2段構成でマッピング
  • 快速のハードコードオレンジカラーを削除し、trainType.colorを使用するように変更
  • 列車種別テキストの縦中央揃えを実装(1段・2段表示の位置統一)
  • CJK文字の上部見切れを修正(lineHeight倍率調整・overflow: visible追加)
  • E231系テーマをTYPE_CHANGE_HIDE_THEMESに追加

Test plan

  • 各停・快速・特快・急行・特急の日本語表示を確認
  • 英語表示でExp./Rapid/中央特快/青梅特快/通勤特快/通勤快速の表示を確認
  • 簡体字・韓国語表示で文字の見切れがないことを確認
  • 1段表示と2段表示で縦位置が揃っていることを確認

🤖 Generated with Claude Code

Summary by CodeRabbit

リリースノート

  • New Features

    • E231列車タイプの英語表示に対応し、二段階の見出し・本文表示を実装しました。
  • Bug Fixes

    • E231列車タイプの色表示ロジックを改善しました。
  • Chores

    • テーマ設定にE231対応を追加しました。

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@github-actions github-actions Bot added the react label Mar 30, 2026
@coderabbitai

coderabbitai Bot commented Mar 30, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

歩き方

TrainTypeBoxE231コンポーネントで、色決定ロジックを簡略化し、英語特有のオーバーライドマッピングを追加。レンダリング処理をヘルパー関数に統一し、レイアウト・スタイリングを調整。テーマ定数にE231エントリを追加。

変更内容

コホート / ファイル 概要
TrainTypeBoxE231コンポーネント更新
src/components/TrainTypeBoxE231.tsx
getIsRapidの使用を削除し、色決定をtrainType?.colorに単純化。英語環境向けのオーバーライドマッピング(SHORT_NAME_EN)を追加し、条件マッチ時に2行表示に対応。renderStrokedText()ヘルパーとTypographyコンポーネントに統一し、ストローク・スキュー変換を適用。レイアウトに固定高さコンテナ、オーバーフロー設定、条件付きスペーシングを導入。
テーマ定数拡張
src/constants/theme.ts
TYPE_CHANGE_HIDE_THEMES配列にAPP_THEME.E231を追加。

推定コード審査工数

🎯 3 (Moderate) | ⏱️ ~20分

詩

🐰 新しい色のE231よ、
英語で優雅に二行となり、
ストロークが踊る、レイアウトが整う、
テーマの箱も仲間入りして、
デザインの列車は走る!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive PR説明は概要・テスト計画を含みますが、テンプレートの必須セクションが不完全です。 変更の種類、変更内容の詳細、実施したテストの詳細、関連Issueを記入してください。テンプレートに従って構造化してください。
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed PRタイトルは「E231系テーマの列車種別表示を改善」で、変更内容の主要な目的(E231系テーマの列車種別表示の改善)を明確に示しており、変更セットの主要な改善内容を正確に反映しています。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 feature/e231-minor-fixes

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

@TinyKitten TinyKitten self-assigned this Mar 30, 2026

@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.

🧹 Nitpick comments (1)
src/components/TrainTypeBoxE231.tsx (1)

269-323: renderStrokedTextヘルパー関数の実装を確認

ストローク効果と斜体風変形(英語のみ)を適用する共通ロジックが適切に抽出されています。Typographyコンポーネントへの移行も正しく行われています。

strokeOffsets配列がレンダーごとに再生成されますが、コンポーネント外への定数化を検討できます。

♻️ strokeOffsetsの定数化(オプション)
+const STROKE_OFFSETS = [
+  { width: 2, height: 0 },
+  { width: -2, height: 0 },
+  { width: 0, height: 2 },
+  { width: 0, height: -2 },
+  { width: 2, height: 2 },
+  { width: -2, height: -2 },
+  { width: 2, height: -2 },
+  { width: -2, height: 2 },
+];
+const STROKE_OFFSETS_TABLET = STROKE_OFFSETS.map(({ width, height }) => ({
+  width: width * 1.5,
+  height: height * 1.5,
+}));

 const TrainTypeBoxE231: React.FC<Props> = ({ trainType }: Props) => {
   // ...
-  const strokeWidth = isTablet ? 3 : 2;
-  const strokeOffsets = [
-    { width: strokeWidth, height: 0 },
-    // ...
-  ];
+  const strokeOffsets = isTablet ? STROKE_OFFSETS_TABLET : STROKE_OFFSETS;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/TrainTypeBoxE231.tsx` around lines 269 - 323,
renderStrokedText currently recreates strokeOffsets on every render which is
unnecessary; move the strokeOffsets array out of the component into a
module-level constant (e.g., const strokeOffsets = [...]) and reference that
constant inside renderStrokedText so the offsets are not reallocated each
render, keeping the same behavior but improving performance; ensure any
dependent values (like strokeColor) remain component-scoped and only the static
offset values are hoisted.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/components/TrainTypeBoxE231.tsx`:
- Around line 269-323: renderStrokedText currently recreates strokeOffsets on
every render which is unnecessary; move the strokeOffsets array out of the
component into a module-level constant (e.g., const strokeOffsets = [...]) and
reference that constant inside renderStrokedText so the offsets are not
reallocated each render, keeping the same behavior but improving performance;
ensure any dependent values (like strokeColor) remain component-scoped and only
the static offset values are hoisted.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6b64fb96-0896-4e1b-97cc-847cdd49a78c

📥 Commits

Reviewing files that changed from the base of the PR and between acc682e and 4b58e6e.

📒 Files selected for processing (2)
  • src/components/TrainTypeBoxE231.tsx
  • src/constants/theme.ts

@TinyKitten
TinyKitten merged commit 6793016 into dev Mar 30, 2026
6 checks passed
@TinyKitten
TinyKitten deleted the feature/e231-minor-fixes branch March 30, 2026 00:40
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