Skip to content

HeaderE231のレイアウト調整 - #5767

Merged
TinyKitten merged 1 commit into
devfrom
feature/e231-header-layouts-fix
Apr 5, 2026
Merged

TinyKitten merged 1 commit into
devfrom
feature/e231-header-layouts-fix

Conversation

@TinyKitten

@TinyKitten TinyKitten commented Apr 5, 2026 •

Copy link
Copy Markdown
Member

概要

変更の種類

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

変更内容

テスト

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

関連Issue

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

Summary by CodeRabbit

  • UI改善
    • ヘッダーレイアウトの調整と駅名ラベルの複数行表示に対応しました
    • 言語別の列車種別名表示とフォントサイズの最適化を実施しました

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

coderabbitai Bot commented Apr 5, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

ウォークスルー

HeaderE231とTrainTypeBoxE231の2つのコンポーネントにおいて、レイアウトサイズング、テキスト表示ロジック、言語対応を改善。HeaderE231ではレイアウト定数化と言語別ラベルテキストの実装を追加。TrainTypeBoxE231では条件付き短縮形式化と多言語対応を強化し、フォントサイジングロジックを調整。

変更内容

コホート / ファイル(s) 概要
ヘッダーレイアウト改善
src/components/HeaderE231.tsx
レイアウトサイズング定数の導入(BOUND_AREA_HEIGHT、BOTTOM_HEIGHT、DIVIDER_HEIGHT、ROOT_HEIGHT)。バウンドテキスト領域を垂直マージンから固定高さ + 中央揃えに変更。バウンドステーション名を複数行対応・フォント自動調整に対応。時刻ラベルを言語対応化。
駅名ボックス表示最適化
src/components/TrainTypeBoxE231.tsx
formatCjkにforceShortパラメータを追加し、短縮ロジックを改善。日本語名の長さに基づくjaAbbreviatedフラグを導入。言語別フォーマット(ZH/KO)に短縮ロジックを適用。英語テキスト派生ロジックを最適化。フォントサイズ選択条件を反転し、デフォルト英語オーバーライド時のフォントサイズを24から21に調整。

推定レビュー工数

🎯 3 (中程度) | ⏱️ ~20分

🎯 4 (複雑) | ⏱️ ~50分

詩

🐰✨ レイアウトは整い、テキストは輝く
言語ごとに姿を変える駅名たち
定数で秩序、ロジックで優雅
画面に映る改善の物語
うさぎも応援、コードよ躍れ!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning PR説明は提供されたテンプレート構造を保持しているが、「変更内容」セクションが完全に空白であり、テストチェックリストも未完了のままである。 「変更内容」セクションに具体的な変更の詳細を記述し、テストチェックリスト(lint、test、typecheck)の実施状況を記入してください。
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed PRタイトルは「HeaderE231のレイアウト調整」で、raw_summaryに示されているHeaderE231.tsxへの変更内容と一致しており、主要な変更を正確に反映している。
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-header-layouts-fix

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

@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: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/components/HeaderE231.tsx`:
- Around line 190-201: The clockLabelText useMemo switch is missing a 'KANA'
branch so KANA mode falls back to the kanji default; add an explicit case 'KANA'
in the switch (inside the useMemo where clockLabelText is defined and dependent
on headerLangState) that returns the kana string you want (e.g., 'げんざいじこく'),
leaving other cases and the dependency array unchanged so KANA displays the
correct kana label.

In `@src/components/TrainTypeBoxE231.tsx`:
- Around line 123-125: In TrainTypeBoxE231, when forceShort is true the code
returns null if kind is missing or map[kind] is undefined, causing the whole
component to disappear; change the fallback so that when shortName is falsy you
return the original name instead of null (i.e., update the branch that defines
shortName and its return to use shortName ?? name), so the component renders the
full label if no shortened mapping exists.
🪄 Autofix (Beta)

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: 3f318b95-83c3-407c-84e0-f9cc193e82aa

📥 Commits

Reviewing files that changed from the base of the PR and between 78050b8 and 79e0cf4.

📒 Files selected for processing (2)
  • src/components/HeaderE231.tsx
  • src/components/TrainTypeBoxE231.tsx

Comment thread src/components/HeaderE231.tsx Resolved
Comment thread src/components/TrainTypeBoxE231.tsx Resolved
@TinyKitten
TinyKitten merged commit 651f9d4 into dev Apr 5, 2026
6 checks passed
@TinyKitten
TinyKitten deleted the feature/e231-header-layouts-fix branch April 5, 2026 00:31
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