Skip to content

小田急テーマの停車中バー灰色表示とヘッダーデザインを改善#5741

Merged
TinyKitten merged 4 commits intodevfrom
feature/improve-odakyu-theme
Apr 2, 2026
Merged

小田急テーマの停車中バー灰色表示とヘッダーデザインを改善#5741
TinyKitten merged 4 commits intodevfrom
feature/improve-odakyu-theme

Conversation

@TinyKitten
Copy link
Copy Markdown
Member

@TinyKitten TinyKitten commented Apr 2, 2026

Summary

  • 停車中(arrived)に LineBoardEast のバーがchevron位置まで灰色になるように修正
  • isSplitAtCurrentStationcurrentStationIndex !== 0 条件を削除し、最初の駅(index 0)でもバー分割が有効に
  • index 0 では Math.abs(barLeft) + dotCenterOffset でドット中心までの距離を灰色幅として使用
  • カラーバー幅を barWidth - splitWidth にして、分割後の残り領域を正しくカバー

Test plan

  • 小田急テーマで最初の駅に停車中、chevron位置まで灰色バーが表示されることを確認
  • 中間駅に停車中のバー分割表示が崩れていないことを確認
  • タブレット・スマホ両方で表示を確認

🤖 Generated with Claude Code

Summary by CodeRabbit

リリースノート

  • 改善
    • ヘッダーのグラデーション配色を新しい4色パレットと位置調整で更新しました。
    • タブレット環境向けに区切り線の高さを最適化し表示を改善しました。
    • 駅分割表示で先頭駅も分割対象に対応し、分割時のバー幅・位置計算を端末に応じて調整しました。
    • 駅番号アイコンにグレースケール表示オプションを追加し、表示色の選択を一元化しました。

@github-actions github-actions Bot added the react label Apr 2, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 2, 2026

📝 Walkthrough

Walkthrough

HeaderOdakyuでタブレット判定に基づくdivider高さとグラデーション定義を更新。LineBoardEastはindex===0での分割を許可し、splitWidthをindexとisTabletで動的計算。NumberingIcon系にshouldGrayscaleプロップを追加/伝播して描画色を切替可能に。

Changes

Cohort / File(s) Summary
ヘッダーのスタイル調整
src/components/HeaderOdakyu.tsx
isTabletを導入してdivider.heightをタブレットで8、それ以外で6に。5色だったgradientColorsを4色に変更し、gradientLocations配列を追加してグラデーション停止位置を明示。
路線表示の分割ロジック改修
src/components/LineBoardEast.tsx
currentStationIndex !== 0のガードを削除しindex 0でも分割を許可。splitWidthindex === 0isTabletに基づき算出し、bar-main-halfおよびbar-colorleft/width計算を更新。NumberingIconViewshouldGrayscaleを渡す呼び出しを追加。
ナンバリングアイコン:プロップ伝播
src/components/NumberingIcon.tsx
shouldGrayscaleを受け取り、NumberingIconOdakyu呼び出しにshouldGrayscale={shouldGrayscale ?? false}として伝播。既存のグレースケール挙動は維持。
ナンバリングアイコン(小変更)
src/components/NumberingIconOdakyu.tsx
shouldGrayscale?: booleanをPropsに追加。GRAYSCALE_COLOR導入と色選択をborderColor/textColorに集中させ、描画でその色を使用するよう整理。

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 ぴょんと見て変わる色と幅
タブレットでは高く、先頭でも割れる
こまやかに伝わる灰色のそっとした声
小さな桁で描き直し、景色が跳ねる
にんじんをかじって、また一歩待ってる

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning PR説明は概要と変更内容を記載していますが、リポジトリの説明テンプレートで必須の「変更の種類」と「テスト」セクションが実装されていません。 テンプレートの「変更の種類」セクションで該当するチェックボックスを選択し、「テスト」セクションで実施したテスト項目をチェックしてください。
✅ Passed checks (2 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed 小田急テーマのバー灰色表示と番号アイコン灰色表示、ヘッダーグラデーション改善に関する主要な変更を的確に要約しており、変更内容と一致している。

✏️ 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/improve-odakyu-theme

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

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/components/HeaderOdakyu.tsx (1)

1-5: ⚠️ Potential issue | 🟡 Minor

インポートの順序を修正してください。

Biome CI がインポートの順序が正しくないことを報告しています。biome check --apply を実行してインポートを整理してください。

🔧 修正案
 import React from 'react';
+import isTablet from '~/utils/isTablet';
 import type { CommonHeaderProps } from './Header.types';
 import type { HeaderEastThemeConfig } from './HeaderEast';
 import { HeaderEast, tokyoMetroConfig } from './HeaderEast';
-import isTablet from '~/utils/isTablet';
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/HeaderOdakyu.tsx` around lines 1 - 5, Imports in
HeaderOdakyu.tsx are out of order; run the formatter to fix them: execute `biome
check --apply` to automatically reorder imports, or manually reorder so grouped
imports are: external packages (React), type-only imports (CommonHeaderProps,
HeaderEastThemeConfig), component exports (HeaderEast, tokyoMetroConfig) and
local utilities (isTablet) — referencing the symbols React, CommonHeaderProps,
HeaderEastThemeConfig, HeaderEast, tokyoMetroConfig, and isTablet to locate and
verify the changes.
🧹 Nitpick comments (1)
src/components/LineBoardEast.tsx (1)

235-254: dotCenterOffsetsplitWidth の計算が重複しています。

Lines 236-238 と Lines 250-252 で同じ計算が2回行われています。関数スコープ内で一度だけ計算し、再利用することを推奨します。

♻️ 重複を解消する修正案
  if (splitHere) {
    // index 0ではバー左端からドット中心までの距離を灰色幅に使う
    const dotCenterOffset = isTablet ? 24 : 16;
    const splitWidth =
      index === 0 ? Math.abs(barLeft) + dotCenterOffset : barWidth / 2.5;
    gradients.push(
      createBarGradient(
        'bar-main-half',
        getMainBarColors(line),
        barLeft,
        splitWidth
      )
    );
-  }
-
-  if (secondaryVisible) {
-    const dotCenterOffset = isTablet ? 24 : 16;
-    const splitWidth =
-      index === 0 ? Math.abs(barLeft) + dotCenterOffset : barWidth / 2.5;
-    const left = splitHere ? barLeft + splitWidth : barLeft;
-    const width = splitHere ? barWidth - splitWidth : barWidth;
+    if (secondaryVisible) {
+      gradients.push(
+        createBarGradient(
+          'bar-color',
+          getLineBarColors(line, lineColors, index),
+          barLeft + splitWidth,
+          barWidth - splitWidth
+        )
+      );
+    }
+  } else if (secondaryVisible) {
    gradients.push(
      createBarGradient(
        'bar-color',
        getLineBarColors(line, lineColors, index),
-        left,
-        width
+        barLeft,
+        barWidth
      )
    );
  }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/LineBoardEast.tsx` around lines 235 - 254, dotCenterOffset and
splitWidth are computed twice; compute them once in the enclosing function scope
and reuse for both primary and secondary bar logic: move the dotCenterOffset
(using isTablet) and splitWidth (using index, barLeft, barWidth) declarations
out of the first gradient/secondaryVisible blocks so both the createBarGradient
call and the secondaryVisible branch use the same variables; ensure splitHere
and left/width calculations remain based on that single splitWidth and remove
the duplicated declarations inside the secondaryVisible block.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@src/components/HeaderOdakyu.tsx`:
- Around line 1-5: Imports in HeaderOdakyu.tsx are out of order; run the
formatter to fix them: execute `biome check --apply` to automatically reorder
imports, or manually reorder so grouped imports are: external packages (React),
type-only imports (CommonHeaderProps, HeaderEastThemeConfig), component exports
(HeaderEast, tokyoMetroConfig) and local utilities (isTablet) — referencing the
symbols React, CommonHeaderProps, HeaderEastThemeConfig, HeaderEast,
tokyoMetroConfig, and isTablet to locate and verify the changes.

---

Nitpick comments:
In `@src/components/LineBoardEast.tsx`:
- Around line 235-254: dotCenterOffset and splitWidth are computed twice;
compute them once in the enclosing function scope and reuse for both primary and
secondary bar logic: move the dotCenterOffset (using isTablet) and splitWidth
(using index, barLeft, barWidth) declarations out of the first
gradient/secondaryVisible blocks so both the createBarGradient call and the
secondaryVisible branch use the same variables; ensure splitHere and left/width
calculations remain based on that single splitWidth and remove the duplicated
declarations inside the secondaryVisible block.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 563d2de2-3577-43c6-913e-04230246ae74

📥 Commits

Reviewing files that changed from the base of the PR and between 17540a7 and baf1d75.

📒 Files selected for processing (2)
  • src/components/HeaderOdakyu.tsx
  • src/components/LineBoardEast.tsx

@TinyKitten TinyKitten self-assigned this Apr 2, 2026
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

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/NumberingIcon.tsx (1)

321-331: NumberingIcon ラッパーのアーキテクチャに関する補足

現在の設計では、ほとんどのアイコンは lineColor prop を使用し、ラッパーが opacity: 0.25 を適用してグレースケールを実現しています。一方、NumberingIconOdakyu は内部で色を管理しているため、lineColor="#000" の上書きは効果がありません。

shouldGrayscaleNumberingIconOdakyu に渡されるようになった今、Odakyu アイコンに対してはラッパーの処理をスキップする選択肢も検討できます:

♻️ オプション: Odakyu アイコンの二重効果を回避する場合
 const NumberingIcon = (props: Props) => {
   const { shouldGrayscale } = props;
+  // NumberingIconOdakyu handles grayscale internally
+  if (props.shape === MARK_SHAPE.ODAKYU || props.shape === MARK_SHAPE.HAKONE) {
+    return <NumberingIconOriginal {...props} />;
+  }
   if (!shouldGrayscale) {
     return <NumberingIconOriginal {...props} />;
   }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/NumberingIcon.tsx` around lines 321 - 331, The wrapper applies
a grayscale via styles.pass and overrides lineColor, but NumberingIconOdakyu
manages its own colors so lineColor="#000" is ineffective and the wrapper causes
a double visual effect; update NumberingIcon to detect when the underlying icon
is NumberingIconOdakyu (e.g., via a prop like props.variant/name/component
check) and when shouldGrayscale is true and the icon is Odakyu, skip the wrapper
and return NumberingIconOriginal {...props} (without passing lineColor and
without wrapping in styles.pass); otherwise keep the existing behavior of
returning the wrapped icon with lineColor="#000".
🤖 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/NumberingIcon.tsx`:
- Around line 321-331: The wrapper applies a grayscale via styles.pass and
overrides lineColor, but NumberingIconOdakyu manages its own colors so
lineColor="#000" is ineffective and the wrapper causes a double visual effect;
update NumberingIcon to detect when the underlying icon is NumberingIconOdakyu
(e.g., via a prop like props.variant/name/component check) and when
shouldGrayscale is true and the icon is Odakyu, skip the wrapper and return
NumberingIconOriginal {...props} (without passing lineColor and without wrapping
in styles.pass); otherwise keep the existing behavior of returning the wrapped
icon with lineColor="#000".

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 03ee25d9-8093-4db2-8600-f26d77f5a505

📥 Commits

Reviewing files that changed from the base of the PR and between d47f651 and 9d4dd55.

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

@TinyKitten TinyKitten changed the title 小田急テーマの停車中バー灰色表示を改善 小田急テーマの停車中バー灰色表示とヘッダーデザインを改善 Apr 2, 2026
@TinyKitten TinyKitten merged commit e5cf01a into dev Apr 2, 2026
6 checks passed
@TinyKitten TinyKitten deleted the feature/improve-odakyu-theme branch April 2, 2026 04:39
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