ETA単位ラベルの見切れ修正と分/min.二択化、LineBoardJOのドット拡大・バー終端延長#6432
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
📝 WalkthroughWalkthroughETA単位の表示を英語判定に基づく二択へ変更し、JO路線ボードのドット、バー、終端要素のサイズ・位置計算を定数ベースに更新しています。 ChangesLineBoard表示調整
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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/LineBoard/shared/components/EstimatedMinutesUnitLabel.test.tsx`:
- Around line 55-57: Update the test case for renderWithState('CURRENT_ZH') to
explicitly pass the active languages ['JA', 'EN', 'ZH'], then keep the existing
'min.' assertion to directly verify the English fallback without relying on
default initialization.
In `@src/components/LineBoardJO.tsx`:
- Around line 310-317: Update LineBoardJO tests in LineBoardJO.test.tsx to cover
the JO layout changes for both tablet and smartphone configurations. Verify
unpassed-dot size and centered position, final bar extension, terminal arrow
position, and ETA unit-label placement, using the existing getBottom and
relevant rendering symbols without changing production behavior.
🪄 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: 8f9a74ad-5f80-4236-b83f-f897803a264c
📒 Files selected for processing (4)
src/components/LineBoard/shared/components/EstimatedMinutesUnitLabel.test.tsxsrc/components/LineBoard/shared/components/EstimatedMinutesUnitLabel.tsxsrc/components/LineBoard/shared/styles/commonStyles.tssrc/components/LineBoardJO.tsx
Fixes Applied SuccessfullyFixed 2 file(s) based on 2 CodeRabbit feedback item(s). Files modified:
Commit: The latest autofix changes are on the 補足: CodeRabbit はタブレット・スマホ両方のテストを提案していましたが、本リポジトリのコンポーネントテストは |
|
@coderabbitai 問題残ってますか? |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '=== Changed files and diff stat ==='
git diff --stat HEAD^ HEAD
git diff --name-only HEAD^ HEAD
echo '=== Outlines ==='
ast-grep outline src/components/LineBoardJO.tsx --items all
ast-grep outline src/components/LineBoard/shared/components/EstimatedMinutesUnitLabel.tsx --items all
ast-grep outline src/components/LineBoardJO.test.tsx --items all
ast-grep outline src/components/LineBoard/shared/components/EstimatedMinutesUnitLabel.test.tsx --items all
echo '=== Relevant implementation and tests ==='
for f in \
src/components/LineBoardJO.tsx \
src/components/LineBoardJO.test.tsx \
src/components/LineBoard/shared/components/EstimatedMinutesUnitLabel.tsx \
src/components/LineBoard/shared/components/EstimatedMinutesUnitLabel.test.tsx \
src/components/LineBoard/shared/styles/commonStyles.ts
do
echo "--- $f ---"
cat -n "$f"
done
echo '=== State-language definitions/usages ==='
rg -n -C 3 --glob '*.{ts,tsx}' \
'(isEnAtom|enabledLanguagesAtom|estimatedMinutesUnitAtom|headerStateAtom)' srcLength of output: 111971
このため、先の指摘は解消済みです。 ✏️ Learnings added
|
|
@coderabbitai approve |
✅ Action performedComments resolved and changes approved. |
概要
ETA残り分数の単位ラベルがテーマ・端末によって右側で見切れる問題(JOタブレットで「min.」が欠ける、都営スマホで「m.」になる)を修正し、単位表記をLineBoardの駅名言語に追従する「分/min.」の二択へ簡素化しました。あわせてLineBoardJOのドット拡大とバー終端の延長を行っています。
変更の種類
変更内容
EstimatedMinutesUnitLabelに最長表記「min.」が縁取り込みで収まる固有幅(タブレット56 / スマホ40)を明示。Yogaはwidth未指定の絶対配置子を親要素の幅を上限に測定するため、幅の狭いドットに載せたラベルが「m.」のように切り詰められていた(全テーマ共通の修正)単位表記を駅名表示と同じ言語切替(
isEnAtom)に追従する「分/min.」の二択へ簡素化。韓国語「분」と中国語の専用扱いを廃止し、LineBoardの言語が切り替わるのと同一タイミングで表記が切り替わるようにしたLineBoardJOの未通過駅ドットをバー高さ−8px(上下4pxインセット)の円へ拡大(タブレット32→56px、スマホは従来同等の32px)。中心位置は従来から変わらない
LineBoardJOのバー最終セグメントを右へ延長(タブレット+24px / スマホ+14px)し、終端矢印を画面右端寄りに移動
LineBoardJOの最終ドット右隣に単位ラベルを再配置(間隔: タブレット8px / スマホ0px)
LineBoardJOのレイアウト変更(ドットサイズ・縦位置、最終セグメント延長、終端矢印位置、単位ラベル配置)を検証するテストを追加し、ZHステートのテストで有効言語を明示(CodeRabbit指摘対応)
テスト
npm run lintが通ることnpm testが通ることnpm run typecheckが通ること関連Issue
スクリーンショット(任意)
Summary by CodeRabbit