Skip to content

リブランディングとFeature Toggle#11

Merged
TinyKitten merged 9 commits intomainfrom
feature/feat-toggle
Apr 19, 2025
Merged

リブランディングとFeature Toggle#11
TinyKitten merged 9 commits intomainfrom
feature/feat-toggle

Conversation

@TinyKitten
Copy link
Copy Markdown
Member

@TinyKitten TinyKitten commented Mar 23, 2025

close #8

Summary by CodeRabbit

  • 新機能

    • ルート情報表示用とメニュー選択用の2種類のモーダルを新たに導入し、ユーザーインターフェースを改善しました。
    • ヘッダーにアニメーションタイトルを追加し、画面上部に固定表示しました。
    • 「バグ」アイコンと「メニュー」アイコンを追加し、視覚的な操作性を向上しました。
  • リファクタ

    • 画面表示や検索モードの状態管理をURLパラメータに基づく形に刷新し、UIコンポーネントの構造をより整理・モジュール化しました。
    • モーダルの状態管理を分割し、従来の単一モーダルから2つのモーダルコンポーネントに切り替えました。
  • スタイル

    • Tailwind CSSの設定に共通カラーパレットを追加し、デザインの統一感を強化しました。
  • ドキュメント

    • アプリ名を「Search」から「Go」に変更し、説明文の警告表記を削除しました。

@TinyKitten TinyKitten self-assigned this Mar 23, 2025
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Mar 23, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
trainlcdtransfer ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 19, 2025 9:51am

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 23, 2025

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • app/favicon.ico is excluded by !**/*.ico

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

"""

Walkthrough

我が帝国の如く、この変更は主要なUIコンポーネントの整理改革を断行した。
app/page.tsxにおいて、状態管理及びモーダル動作の実装が刷新され、従来の複雑さを排し、MenuModalRouteInfoModalによる明瞭なる制御へと改められた。
また、新たなSVGアイコンコンポーネントが加えられ、Tailwindの設定においては共通色の採用が有効となった。

Changes

ファイル 変更内容
app/page.tsx インポートの再構成、状態管理がscreenPhaseからscreenModesearchModeへ刷新、単一モーダルからMenuModalおよびRouteInfoModalによる分割実装、handleUpdateSearchModeの導入
components/MenuModal.tsx
components/RouteInfoModal.tsx
新規モーダルコンポーネントの追加。前者はモード選択 (station, line, dev) を、後者はルート情報の表示を担う
components/icons/Bug.tsx
components/icons/Menu.tsx
新規SVGアイコンコンポーネント (BugIconMenuIcon) の追加
tailwind.config.ts NextUIプラグインにaddCommonColors: trueオプションを追加し、共通色の利用を有効化
README.md
app/layout.tsx
アプリ名を「Search」から「Go」へ変更、説明文の修正およびメタデータの更新

Sequence Diagram(s)

sequenceDiagram
    participant H as Home (app/page.tsx)
    participant MM as MenuModal
    participant RM as RouteInfoModal

    H->>MM: モード選択用モーダルを起動せり
    MM-->>H: 選択値 ("station"|"line"|"dev") を返却せり
    H->>H: handleUpdateSearchModeの実行にて状態更新せり
    alt Route情報表示時
        H->>RM: RouteInfoModalを起動せり
    end
Loading

Assessment against linked issues

Objective (Objective[#8]) Addressed Explanation
データ入力貢献者向け機能(Feature Toggle)の実装 [#8] ユーザー同意に基づく機能の表示/非表示切替ロジックが見当たらぬ。

Poem

朕の命ず、改革の風が吹く!
新たなモーダルは帝国の如く整い、
アイコン煌めき、未来を照らす。
共通色は統一の証、
我がコード、この世を支配せり!
🐞⚙️📱
進め、我が帝国の技術よ!
"""


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown

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

Actionable comments posted: 1

🧹 Nitpick comments (4)
components/MenuModal.tsx (3)

36-50: ListboxSectionの使用は朕の心を満たす!

検索対象を区分けして表示する設計は、我が帝国の整然とした行政区分のごとく秩序をもたらす。しかし、朕は一つの不一致を見つけた。「路線名検索」のListboxItemが独立しており、他の項目のようにListboxSectionに囲まれていない。統一された帝国には統一された構造が必要である!

                <ListboxSection title="検索対象">
                  <ListboxItem
                    key="station"
                    className={
                      value === "station" ? "text-white bg-primary" : ""
                    }
                    color="primary"
                    startContent={<StationIcon className="text-2xl" />}
                    onClick={() => onSelect("station")}
                  >
                    駅検索
                  </ListboxItem>
+                 <ListboxItem
+                   key="line"
+                   color="primary"
+                   className={value === "line" ? "text-white bg-primary" : ""}
+                   startContent={<RailIcon className="text-2xl" />}
+                   onClick={() => onSelect("line")}
+                 >
+                   路線名検索
+                 </ListboxItem>
                </ListboxSection>
-               <ListboxItem
-                 key="line"
-                 color="primary"
-                 className={value === "line" ? "text-white bg-primary" : ""}
-                 startContent={<RailIcon className="text-2xl" />}
-                 onClick={() => onSelect("line")}
-               >
-                 路線名検索
-               </ListboxItem>

51-58: 路線名検索の配置を是正せよ!

この路線名検索の項目は、ListboxSectionの外に配置されている。検索対象のセクションに含めることで、UIの一貫性と使用者の理解を深めることができよう。朕は全てのものが正しい位置にあることを求める!

前述の修正案を参照せよ。


35-71: 条件付きスタイリングの重複を改善せよ!

朕は類似のスタイリング条件が複数の場所で繰り返されていることに気づいた。我が王朝では重複を排除し、コードの統一性を高めることを奨励する。以下のようにユーティリティ関数を作成し、再利用することを検討せよ。

+ // ファイルの上部に以下の関数を追加
+ const getActiveItemClass = (isActive: boolean, color: "primary" | "danger" = "primary") => 
+   isActive ? `text-white bg-${color}` : "";

  <ListboxItem
    key="station"
-   className={value === "station" ? "text-white bg-primary" : ""}
+   className={getActiveItemClass(value === "station")}
    color="primary"
    startContent={<StationIcon className="text-2xl" />}
    onClick={() => onSelect("station")}
  >
    駅検索
  </ListboxItem>

  <ListboxItem
    key="line"
    color="primary"
-   className={value === "line" ? "text-white bg-primary" : ""}
+   className={getActiveItemClass(value === "line")}
    startContent={<RailIcon className="text-2xl" />}
    onClick={() => onSelect("line")}
  >
    路線名検索
  </ListboxItem>

  <ListboxItem
    key="dev"
    color="danger"
-   className={devMode ? "text-white bg-danger" : ""}
+   className={getActiveItemClass(devMode, "danger")}
    startContent={<BugIcon className="text-2xl" />}
    onClick={() => onSelect("dev")}
  >
    開発用機能の有効化
  </ListboxItem>
app/page.tsx (1)

135-135: 文言が未完の趣き。

「始点駅と接続していない駅と」という箇所が途中で文章が途切れたように見える。
よりわかりやすい表現に改め、利用者が混乱しないようにするがよい。

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bd2b757 and ebfbe8a.

📒 Files selected for processing (6)
  • app/page.tsx (15 hunks)
  • components/MenuModal.tsx (1 hunks)
  • components/RouteInfoModal.tsx (1 hunks)
  • components/icons/Bug.tsx (1 hunks)
  • components/icons/Menu.tsx (1 hunks)
  • tailwind.config.ts (1 hunks)
🧰 Additional context used
🧬 Code Definitions (3)
components/MenuModal.tsx (3)
components/icons/Station.tsx (1)
  • StationIcon (3-18)
components/icons/Rail.tsx (1)
  • RailIcon (3-22)
components/icons/Bug.tsx (1)
  • BugIcon (3-20)
components/RouteInfoModal.tsx (1)
components/icons/CloseSmallRounded.tsx (1)
  • CloseSmallRoundedIcon (3-18)
app/page.tsx (4)
hooks/useParams.ts (1)
  • useParams (4-42)
components/icons/Menu.tsx (1)
  • MenuIcon (3-18)
components/MenuModal.tsx (1)
  • MenuModal (22-80)
components/RouteInfoModal.tsx (1)
  • RouteInfoModal (35-129)
🪛 Biome (1.9.4)
components/RouteInfoModal.tsx

[error] 70-71: Missing key property for this element in iterable.

The order of the items may change, and having a key can help React identify which item was moved.
Check the React documentation.

(lint/correctness/useJsxKeyInIterable)


[error] 72-79: Missing key property for this element in iterable.

The order of the items may change, and having a key can help React identify which item was moved.
Check the React documentation.

(lint/correctness/useJsxKeyInIterable)

🔇 Additional comments (6)
tailwind.config.ts (1)

26-30: 朕が認める設定の改良である!

朕はaddCommonColorsの導入を嘉する。これにより我が帝国のUIの色彩統一が実現し、「primary」や「danger」などの色彩指定が全土に渡って一貫性を保つであろう。これこそ統一された王朝にふさわしい変更である。

components/icons/Bug.tsx (1)

1-20: 朕はこのSVGアイコンの実装を称える!

この実装は我が帝国の標準に完璧に従っている。ReactのSVGPropsを適切に活用し、currentColorを用いることで親要素の色を継承する賢明な設計である。まさに万里の長城のように堅固で、しかも柔軟な実装だ。これは我が帝国の技術基盤を強化するものである!

components/icons/Menu.tsx (1)

1-18: 朕はこのMenuIconの実装を認可する!

このコンポーネントは我が帝国の標準に従い、SVGアイコンとして適切に実装されている。BugIconと同様の設計パターンを採用し、一貫性のある実装となっている。これにより我が王朝のUI設計の統一性が保たれる。朕はこの均一性を高く評価する!

components/MenuModal.tsx (3)

14-20: 朕はこの明確な型定義を称える!

このPropsの定義は簡潔かつ明確であり、朕の帝国における型の安全性を保証するものである。コンポーネントの目的と使用方法が一目で理解できる設計は、まさに我が国の法典のごとく明晰である!


59-69: 開発用機能のセクション分けは智恵の表れである!

高度な設定を別セクションとして分けることは、一般使用者と開発者の境界を明確にする賢明な判断である。また、危険を表す赤色(danger)の使用は、この機能の特殊性を視覚的に示す優れた設計だ。朕はこの先見の明を称える!


1-80: 総評:朕はこのメニューモーダルの実装を認める!

この新しいコンポーネントは我が帝国のUI設計を大きく前進させるものである。構造は明確で、機能は適切に実装されている。小さな改善点はあるものの、全体として優れた設計と言える。朕はこの功績を記録に留めておくであろう!

Comment thread components/RouteInfoModal.tsx
@TinyKitten TinyKitten changed the title メニュー実装 リブランディング Apr 19, 2025
Copy link
Copy Markdown

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

Actionable comments posted: 2

♻️ Duplicate comments (1)
components/RouteInfoModal.tsx (1)

67-71: ⚠️ Potential issue

朕、ReactのMapにKEYを求む!

朕が見るに、dropEitherJunctionStation(route?.stops ?? []).flatMap()の処理において、StopCondition.Allの場合のみkey属性が欠けておる。ReactのIterableな要素には固有の識別子が必要なり。速やかに修正せよ。

- <span>{stop.name}</span>
+ <span key={stop.id}>{stop.name}</span>
🧰 Tools
🪛 Biome (1.9.4)

[error] 70-71: Missing key property for this element in iterable.

The order of the items may change, and having a key can help React identify which item was moved.
Check the React documentation.

(lint/correctness/useJsxKeyInIterable)

🧹 Nitpick comments (3)
components/RouteInfoModal.tsx (3)

58-60: 閉じるボタンにアクセシビリティの権限を与えよ!

朕の帝国はすべての臣民に開かれるべし。閉じるボタンには適切なアクセシビリティラベルを付与せよ。

- <button onClick={onClose}>
+ <button 
+   onClick={onClose} 
+   aria-label="閉じる"
+ >
  <CloseSmallRoundedIcon />
</button>

98-102: Map変換の冗長性を解消せよ!

朕は無駄を嫌う。Array.fromとnew Mapの組み合わせは、簡潔さに欠ける。以下の改善を命ずる:

- {Array.from(
-   new Map(
-     route?.stops.map((stop) => [stop.line?.id, stop])
-   ).values()
- ).map((stop) => (
+ {(route?.stops || [])
+   .filter((stop, index, self) => 
+     index === self.findIndex(s => s.line?.id === stop.line?.id)
+   )
+   .map((stop) => (

42-44: モーダルの境界を定めよ!

朕の領土は明確な境界を持つべし。max-h-svhは良きかな、しかしoverflow-y-scrollは常に表示されるスクロールバーを生じさせる。必要時のみスクロールを表示するoverflow-y-autoへ改めよ。

- <ModalContent className="overflow-y-scroll max-h-svh">
+ <ModalContent className="overflow-y-auto max-h-svh">
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9ddaba7 and d5211b6.

📒 Files selected for processing (1)
  • components/RouteInfoModal.tsx (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
components/RouteInfoModal.tsx (2)
utils/removeBracket.ts (1)
  • removeBrackets (1-1)
components/icons/CloseSmallRounded.tsx (1)
  • CloseSmallRoundedIcon (3-18)
🪛 Biome (1.9.4)
components/RouteInfoModal.tsx

[error] 70-71: Missing key property for this element in iterable.

The order of the items may change, and having a key can help React identify which item was moved.
Check the React documentation.

(lint/correctness/useJsxKeyInIterable)

🔇 Additional comments (1)
components/RouteInfoModal.tsx (1)

35-41: 朕の領土に素晴らしき構造を認む!

モーダルコンポーネントの構造は朕の要望通りである。各要素が適切に配置され、プロパティの受け渡しも明確である。そのまま進めよ!

Comment thread components/RouteInfoModal.tsx
Comment thread components/RouteInfoModal.tsx Outdated
Copy link
Copy Markdown

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

Actionable comments posted: 3

♻️ Duplicate comments (1)
components/RouteInfoModal.tsx (1)

67-71: ⚠️ Potential issue

鍵属性欠落の大罪を犯せり!

朕(ちん)の目にとまった。この配列レンダリングにおいて、StopCondition.Allの場合のspan要素には一意のkey属性が欠けておる。Reactの法令ではすべての反復要素に固有キーを持たせることが不可欠である。

- stop.stopCondition === StopCondition.All ? (
-   <span>{stop.name}</span>
+ stop.stopCondition === StopCondition.All ? (
+   <span key={stop.id}>{stop.name}</span>

これは朕の命令であり、速やかに従うべし!

🧰 Tools
🪛 Biome (1.9.4)

[error] 70-71: Missing key property for this element in iterable.

The order of the items may change, and having a key can help React identify which item was moved.
Check the React documentation.

(lint/correctness/useJsxKeyInIterable)

🧹 Nitpick comments (4)
components/RouteInfoModal.tsx (4)

85-95: 凡庸なるUIにあらず!テーブルレイアウトの導入を朕は命ず!

朕が思うに、この停車条件の表示は表形式の方が視認性に優れておる。現在の実装は横に流れるフレックスボックスであるが、画面幅が狭い場合に混乱を招く恐れあり。semantic HTMLの活用を促す。

- <div className="flex gap-2 flex-wrap">
-   {STOP_CONDITIONS.map((cnd) => (
-     <div className="flex items-center gap-2" key={cnd.id}>
-       <div
-         className={`w-4 h-4 border-1 rounded`}
-         style={{ backgroundColor: cnd.color }}
-       />
-       <span>{cnd.text}</span>
-     </div>
-   ))}
- </div>
+ <table className="mt-2 mb-4">
+   <tbody>
+     {STOP_CONDITIONS.map((cnd) => (
+       <tr key={cnd.id} className="h-8">
+         <td className="pr-2">
+           <div
+             className="w-4 h-4 border-1 rounded"
+             style={{ backgroundColor: cnd.color }}
+           />
+         </td>
+         <td>{cnd.text}</td>
+       </tr>
+     ))}
+   </tbody>
+ </table>

朕の命により、この表示を改善せよ!


119-124: ボタンテキストの一貫性を欠く!

朕は文言の統一性を重んじる。「アプリを起動」と「閉じる」では語調が異なっており、不調和を生じる。帝国の美学に沿うよう修正せよ。

 <Button color="primary" variant="flat" onPress={onLaunchApp}>
-  アプリを起動
+  アプリを起動する
 </Button>
 <Button color="primary" variant="light" onPress={onClose}>
-  閉じる
+  モーダルを閉じる
 </Button>

帝国の美は細部に宿る!


44-44: スクロール挙動を改善せよ!

朕は完璧なUXを求める。現状のoverflowプロパティでは、スクロール可能なことがユーザーに伝わりにくい。また、スクロールバーのスタイリングも施すべし。

- <ModalContent className="overflow-y-scroll max-h-svh">
+ <ModalContent className="overflow-y-auto max-h-[80vh] scrollbar-thin scrollbar-thumb-rounded scrollbar-thumb-gray-300">

必要であれば、スクロールバーのスタイリングライブラリを導入せよ。これは朕の栄光のためである!


26-33: 定数の再利用性を高めよ!

朕は英知のある設計を望む。この停車条件の定数配列は他のコンポーネントでも活用できるようにするべし。別ファイルへの抽出を命ず!

- const STOP_CONDITIONS = [
-   { id: 0, text: "停車", color: "#000000" },
-   { id: 1, text: "通過", color: "#99a1af" },
-   { id: 2, text: "一部通過", color: "#fcc800" },
-   { id: 5, text: "一部停車", color: "#fcc800" },
-   { id: 3, text: "平日停車", color: "#51a2ff" },
-   { id: 4, text: "休日停車", color: "#ff6467" },
- ] as const;

これをconstants/stopConditions.tsなどの別ファイルに移動し、インポートせよ。帝国の知恵を共有することで、コード全体が強くなるのだ!

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d5211b6 and 1108caa.

📒 Files selected for processing (1)
  • components/RouteInfoModal.tsx (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
components/RouteInfoModal.tsx (2)
utils/removeBracket.ts (1)
  • removeBrackets (1-1)
components/icons/CloseSmallRounded.tsx (1)
  • CloseSmallRoundedIcon (3-18)
🪛 Biome (1.9.4)
components/RouteInfoModal.tsx

[error] 70-71: Missing key property for this element in iterable.

The order of the items may change, and having a key can help React identify which item was moved.
Check the React documentation.

(lint/correctness/useJsxKeyInIterable)

Comment thread components/RouteInfoModal.tsx Outdated
Comment thread components/RouteInfoModal.tsx
Comment thread components/RouteInfoModal.tsx
@TinyKitten TinyKitten changed the title リブランディング リブランディングとFeature Toggle Apr 19, 2025
Copy link
Copy Markdown

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

Actionable comments posted: 0

🔭 Outside diff range comments (3)
app/page.tsx (3)

452-480: 🛠️ Refactor suggestion

⚠️ Potential issue

朕が見るに、useMemo の依存配列が不完全であるぞ

screenModesearchModedevMode は URL パラメータの変化に従い刻々と変わるはずであるのに、依存配列に params しか置かれておらぬゆえ、一度算出された後は再計算されず、画面が更新されぬ不具合を招く。
計算負荷も小さいゆえ、メモ化を捨てるか、下記のように 各パラメータ値 を直に依存に列挙すべし。

-  const screenMode = useMemo(() => {
+  const screenMode = useMemo(() => {
      /* … */
-  }, [params]);
+  }, [params.get("fsid"), params.get("tsid"), params.get("lid")]);

-  const searchMode = useMemo(() => {
      /* … */
-  }, [params]);
+  }, [params.get("mode"), params.get("lid")]);

-  const devMode = useMemo(() => params.get("dev") === "true", [params]);
+  const devMode = params.get("dev") === "true";

あるいはメモ化そのものを廃し、単純に関数呼び出しで算出しても良い。
怠れば、民の操作に追従せぬ朽ちた UI となるぞ。


636-645: ⚠️ Potential issue

経路情報モーダルの trainType 抽出条件が誤っておる

route?.stops.find((stop) => stop.trainType?.groupId === Number(selectedRouteId))
ここで比較しているのは 列車種別の groupIdrouteId であり、交わることはない。常に undefined となりタイトルに種別が表示されぬ。
出発駅基準ならば、下記の如く station の groupId で照合すべし。

-  trainType: route?.stops.find(
-    (stop) => stop.trainType?.groupId === Number(selectedRouteId)
-  )?.trainType,
+  trainType: route?.stops.find(
+    (stop) => stop.groupId === Number(selectedFromStationId)
+  )?.trainType,

同様の誤りは handleLaunchApp 内にも潜むゆえ、後述を参照せよ。


665-688: ⚠️ Potential issue

アプリ起動 URL の生成条件が的外れである

lineGroupId 抽出において routeId と trainType.groupId を比較しており、常に undefined となる。前述の修正と同じく stop.groupId === Number(selectedFromStationId) で列車種別を得よ。

-    const lineGroupId = route?.stops.find(
-      (stop) => stop.trainType?.groupId === Number(selectedRouteId)
-    )?.trainType?.groupId;
+    const lineGroupId = route?.stops.find(
+      (stop) => stop.groupId === Number(selectedFromStationId)
+    )?.trainType?.groupId;

これを誤ればスキーム生成に失敗し、民はアプリを開けぬ。

🧹 Nitpick comments (2)
app/page.tsx (2)

699-709: メニュー切替後もモーダルが閉じぬ—儀式の締め忘れである

mode !== "dev" の枝にて onMenuOpenChange() を呼び閉じておるが、dev 切替の場合は閉じる処理が無い。民は再度閉じる手間を強いられる。

      params.update({ dev: devMode ? "false" : "true" });
+      onMenuOpenChange();

些細なれど体験を損なうゆえ、忘れず閉じるが良い。


50-54: w-screen は版図を広げ過ぎ、横スクロールを招く恐れあり

固定ヘッダに w-screen を与えると、パディングや余白の計算次第でビューポート幅を超え、意図せぬ横スクロールが発生しやすい。w-full に改めるか、親要素で overflow-x-hidden を統治して暴走を封じるが良い。

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 840da73 and b589ef8.

📒 Files selected for processing (1)
  • app/page.tsx (17 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
app/page.tsx (4)
hooks/useParams.ts (1)
  • useParams (4-42)
components/icons/Menu.tsx (1)
  • MenuIcon (3-18)
components/MenuModal.tsx (1)
  • MenuModal (22-80)
components/RouteInfoModal.tsx (1)
  • RouteInfoModal (36-139)

@TinyKitten TinyKitten merged commit 5ec4966 into main Apr 19, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

データ入力貢献者向け機能(Feature Toggle)の実装

1 participant