Skip to content

NumberingIconSquareのTLC黒枠表示を修正 - #5636

Merged
TinyKitten merged 3 commits into
devfrom
fix/tlc-numbering-icon-clipping
Mar 22, 2026
Merged

TinyKitten merged 3 commits into
devfrom
fix/tlc-numbering-icon-clipping

Conversation

@TinyKitten

@TinyKitten TinyKitten commented Mar 22, 2026 •

Copy link
Copy Markdown
Member

Summary

  • NumberingIconSquareのThree Letter Code(TLC)の黒い枠が途中で切れて表示されるバグを修正
  • LineBoardJO・PadArchでthreeLetterCodeが未適用だった問題を修正
  • CommonCardでTLC付きアイコンが小さすぎる問題を修正

変更内容

  • NumberingIconSquare.tsx: transform: scale(0.7) によるレイアウト/ビジュアル不一致を解消。TLCサイズをコンテキスト別に直接ピクセル値で定義(SMALL: TLC省略、LARGE/MEDIUM: コンパクトTLC、デフォルト: 0.7xサイズ)
  • LineBoardJRKyushu.tsx: numberingIconContainer のサイズをTLCコンテンツに対応するよう拡大
  • CommonCard.tsx: TLC付きアイコンに scale: 0.5 を適用しないよう変更
  • TransferLineMark.tsx: containerに overflow: 'visible' を追加
  • LineBoardJO.tsx: NumberingIconに threeLetterCode propを追加
  • PadArch.tsx: NumberingIconに threeLetterCode propを追加

Test plan

  • LineBoardJRKyushuでTLC付き駅(新橋SMB、浜松町HMC、品川SGW等)の黒枠が正しく表示されること
  • CommonCardの行先選択ダイアログでTLC付きアイコンが適切なサイズで表示されること
  • PadArch(山手線iPad)でTLC付き駅の黒枠が横に伸びないこと
  • LineBoardJOでTLC付き駅が正しく表示されること
  • TLCなし駅のアイコン表示に影響がないこと
  • ヘッダー部分のTLCアイコン表示に影響がないこと

🤖 Generated with Claude Code

Summary by CodeRabbit

リリースノート

  • スタイル改善
    • 駅番号アイコンのサイズ・配置を大幅に調整し、表示位置と余白を最適化しました。
    • 一部マーカーとコンテナでオーバーフローを可視にして、はみ出す要素の表示を改善しました。
    • 構成により三文字コード(TLC)専用の小型/広域表示を導入し、見栄えを向上しました。

@github-actions github-actions Bot added the react label Mar 22, 2026
@coderabbitai

coderabbitai Bot commented Mar 22, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 84b4fd12-64c8-4317-84d7-865a9b08c90d

📥 Commits

Reviewing files that changed from the base of the PR and between fccfd0b and 336f20b.

📒 Files selected for processing (1)
  • src/components/CommonCard.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/components/CommonCard.tsx

📝 Walkthrough

Walkthrough

CommonCard・TransferLineMarkで子要素のオーバーフロー表示を許可し、NumberingIcon系に三文字コード(TLC)表示パスとスケーリング調整を導入。複数箇所でthreeLetterCodeプロップの受け渡しとアイコンサイズ/配置を変更。

Changes

Cohort / File(s) Summary
threeLetterCode を渡す更新
src/components/LineBoardJO.tsx, src/components/PadArch.tsx
駅情報から threeLetterCode を NumberingIcon に渡すように変更(prop追加)。
オーバーフロー表示許可
src/components/CommonCard.tsx, src/components/TransferLineMark.tsx
コンテナの overflow: 'visible' を追加して子要素のはみ出し描画を許可。
Numbering アイコンコンテナ調整
src/components/LineBoardJRKyushu.tsx
numberingIconContainer のサイズと位置を変更(タブレット/非タブレットで異なる)し、overflow: 'visible' を追加。
NumberingIconSquare による TLC 表示導入
src/components/NumberingIconSquare.tsx, src/components/CommonCard.tsx
TLC 固有スケール定数(TLC_SCALE)と compact レンダリングパスを追加。LARGE/MEIDUM サイズで専用レンダリング、SMALL は既存 SMALL パスを維持。Common への threeLetterCode 供給を削除(内部で直接レンダリング)。

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

🐰 三文字で跳ねるよ、TLC、
アイコン広がり、外へと出る。
サイズ変えて、位置を寄せ、
駅は見やすくピョンと出る。
うさぎの祝福、どうぞご利用! 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed プルリクエストのタイトルは「NumberingIconSquareのTLC黒枠表示を修正」であり、PR目的で説明されている主要な変更内容(NumberingIconSquareのTLC黒枠表示バグ修正)と完全に一致しており、簡潔かつ具体的である。
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 fix/tlc-numbering-icon-clipping

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

@TinyKitten TinyKitten self-assigned this Mar 22, 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/CommonCard.tsx (1)

367-371: ネストした三項演算子の可読性について

ロジック自体は正しく動作しますが、ネストした三項演算子は可読性が低下する可能性があります。将来のメンテナンス性向上のため、useMemo でスタイルを事前計算することを検討してください。

♻️ リファクタリング案
+ const markTransformStyle = useMemo(() => {
+   if (!(!mark.signPath || targetStationNumber)) {
+     return null;
+   }
+   if (targetStationThreeLetterCode) {
+     return null;
+   }
+   return { transform: [{ scale: 0.5 }] };
+ }, [mark?.signPath, targetStationNumber, targetStationThreeLetterCode]);

  <View
    style={[
      styles.mark,
-     !mark.signPath || targetStationNumber
-       ? targetStationThreeLetterCode
-         ? null
-         : { transform: [{ scale: 0.5 }] }
-       : null,
+     markTransformStyle,
    ]}
  >
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/CommonCard.tsx` around lines 367 - 371, The nested ternary
that computes the style (using mark.signPath, targetStationNumber, and
targetStationThreeLetterCode) is hard to read; refactor by computing the style
in a useMemo inside the CommonCard component (or the component that contains
this JSX) and return either null, { transform: [{ scale: 0.5 }] } or undefined
based on clearer boolean checks (e.g., derive isSignMissing = !mark.signPath &&
!targetStationNumber and needsScale = !targetStationThreeLetterCode), then
replace the inline nested ternary with the memoized style variable; reference
the variables mark, targetStationNumber, targetStationThreeLetterCode and the
CommonCard component to locate and update the logic.
🤖 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/CommonCard.tsx`:
- Around line 367-371: The nested ternary that computes the style (using
mark.signPath, targetStationNumber, and targetStationThreeLetterCode) is hard to
read; refactor by computing the style in a useMemo inside the CommonCard
component (or the component that contains this JSX) and return either null, {
transform: [{ scale: 0.5 }] } or undefined based on clearer boolean checks
(e.g., derive isSignMissing = !mark.signPath && !targetStationNumber and
needsScale = !targetStationThreeLetterCode), then replace the inline nested
ternary with the memoized style variable; reference the variables mark,
targetStationNumber, targetStationThreeLetterCode and the CommonCard component
to locate and update the logic.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 88614caf-3edd-444d-82d5-a30fb88a8f4c

📥 Commits

Reviewing files that changed from the base of the PR and between 08ac391 and fccfd0b.

📒 Files selected for processing (6)
  • src/components/CommonCard.tsx
  • src/components/LineBoardJO.tsx
  • src/components/LineBoardJRKyushu.tsx
  • src/components/NumberingIconSquare.tsx
  • src/components/PadArch.tsx
  • src/components/TransferLineMark.tsx

@TinyKitten
TinyKitten merged commit 7e2758e into dev Mar 22, 2026
5 checks passed
@TinyKitten
TinyKitten deleted the fix/tlc-numbering-icon-clipping branch March 22, 2026 11:42
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