Repository navigation
トグルボタン実装&オートモードで使用開始 - #4630
トグルボタン実装&オートモードで使用開始#4630
Conversation
|
Note
|
| コホート / ファイル | 変更の概要 |
|---|---|
新しいToggleButtonコンポーネント src/components/ToggleButton.tsx |
React Nativeコンポーネントとして新規追加。children、onToggle、outline、style、textStyle、state、onText/offTextプロップをサポート。テーマストアを利用したLEDおよびデフォルトテーマのスタイリング、条件付きアウトライン表示、状態インジケーター(ON/OFF表示ピル)を実装 |
SelectBoundSettingListModalの更新 src/components/SelectBoundSettingListModal.tsx |
ToggleButtonのインポート追加。オートモード状態表示用のButtonをToggleButtonに置き換え。onToggleとautoModeEnabledの連携、ラベル位置の変更 |
Sequence Diagram(s)
sequenceDiagram
participant User
participant ToggleButton
participant SelectBoundSettingListModal
participant Store
User->>ToggleButton: タップ
ToggleButton->>SelectBoundSettingListModal: onToggle実行
SelectBoundSettingListModal->>Store: toggleAutoModeEnabled呼び出し
Store->>Store: autoModeEnabled状態を反転
Store-->>SelectBoundSettingListModal: 更新通知
SelectBoundSettingListModal-->>ToggleButton: state(autoModeEnabled)を更新
ToggleButton-->>User: ON/OFFインジケーターを表示更新
Estimated code review effort
🎯 3 (Moderate) | ⏱️ ~20分
- ToggleButton.tsx: テーマベースのスタイリングロジックと条件付きレンダリング、複数のプロップ管理が含まれるため、スタイリングと状態管理の正確性確認が必要
- SelectBoundSettingListModal.tsx: 統合箇所がシンプルだが、ToggleButtonとの契約(onToggle、state、ラベルの配置)が正しく実装されているか確認が必要
- アウトラインモード、テーマ切り替え時のスタイリング動作の検証
Possibly related PRs
- 種別情報モーダルでオートモードオン・オフを設定できるようにした #4315: autoModeEnabled状態を切り替える同じUIコントロールの追加であり、navigationStateの同一スタイル更新に関連している
Poem
🐰 トグル、ぴょん!オン・オフ揺れて
テーマに染まる、色も言葉も
ボタンひとつで、気分くるり
ウサギも応援、素敵な切り替え ✨
Pre-merge checks and finishing touches
✅ Passed checks (5 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check | ✅ Passed | プルリクエストのタイトルはトグルボタンの実装とオートモードへの導入という変更の主要な内容を正確に要約しており、変更セット全体と関連している。 |
| Linked Issues check | ✅ Passed | プルリクエストは問題#4627で要求されたトグルボタンコンポーネントの実装と、オートモードボタンでの使用を完全に達成している。 |
| Out of Scope Changes check | ✅ Passed | すべての変更は問題#4627のスコープ内に収まっており、トグルボタンコンポーネントの実装とオートモード設定での使用に直接関連している。 |
| Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. |
✨ Finishing touches
- 📝 Generate docstrings
🧪 Generate unit tests (beta)
- Create PR with unit tests
- Post copyable unit tests in a comment
- Commit unit tests in branch
feature/toggle-button
Tip
📝 Customizable high-level summaries are now available in beta!
You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.
- Provide your own instructions using the
high_level_summary_instructionssetting. - Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
- Use
high_level_summary_in_walkthroughto move the summary from the description to the walkthrough section.
Example instruction:
"Divide the high-level summary into five sections:
- 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
- 📓 References — List relevant issues, discussions, documentation, or related PRs.
- 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
- 📊 Contributor Summary — Include a Markdown table showing contributions:
| Contributor | Lines Added | Lines Removed | Files Changed |- ✔️ Additional Notes — Add any extra reviewer context.
Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."
Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.
Comment @coderabbitai help to get the list of available commands and usage tips.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
src/components/ToggleButton.tsx (2)
17-26: コールバックの型をシンプルにしても良さそうです
onToggle内でGestureResponderEventを使っていないので、呼び出し側のシグネチャも合わせてonToggle: () => void;としてしまうと API が少し分かりやすくなると思います(SelectBoundSettingListModal側のtoggleAutoModeEnabledとも型が一致します)。
28-79: スタイルは概ね良好だが、縦方向の揃えを微調整しても良さそうですテキストと状態インジケータを横並びにしていて分かりやすいですが、
button/buttonLEDのどちらにもalignItems: 'center'を追加しておくと、内容物の縦位置が環境差なく中央に揃ってより安定した見た目になりそうです。
📜 Review details
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/components/SelectBoundSettingListModal.tsx(2 hunks)src/components/ToggleButton.tsx(1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: TinyKitten
Repo: TrainLCD/MobileApp PR: 4448
File: functions/src/funcs/tts.ts:214-232
Timestamp: 2025-08-11T20:23:23.071Z
Learning: PR #4448 in TrainLCD/MobileApp is specifically about AI feedback summarization and labeling functionality, not about TTS (Text-to-Speech) improvements. The TTS code changes appear to be part of a modularization refactoring but are not the focus of this PR.
Learnt from: TinyKitten
Repo: TrainLCD/MobileApp PR: 0
File: :0-0
Timestamp: 2025-08-11T21:13:39.083Z
Learning: TinyKitten prefers concise code reviews for the TrainLCD/MobileApp repository. Keep review comments brief and to the point.
📚 Learning: 2025-05-19T10:59:37.813Z
Learnt from: TinyKitten
Repo: TrainLCD/MobileApp PR: 4286
File: src/components/HeaderLED.tsx:5-10
Timestamp: 2025-05-19T10:59:37.813Z
Learning: The hooks useCurrentStation, useNextStation, useIsNextLastStop, and useNumbering are properly exported in src/hooks/index.ts, allowing them to be imported from '../hooks' in src/components/HeaderLED.tsx as implemented in PR #4286.
Applied to files:
src/components/SelectBoundSettingListModal.tsx
📚 Learning: 2025-06-12T16:04:51.473Z
Learnt from: TinyKitten
Repo: TrainLCD/MobileApp PR: 4329
File: functions/src/index.ts:286-0
Timestamp: 2025-06-12T16:04:51.473Z
Learning: autoModeLabel の仕様: autoModeEnabled が false の場合は、enableLegacyAutoMode の値にかかわらずラベルを付与しない。
Applied to files:
src/components/SelectBoundSettingListModal.tsx
🧬 Code graph analysis (2)
src/components/ToggleButton.tsx (3)
src/utils/rfValue.ts (1)
RFValue(3-18)src/hooks/index.ts (1)
useThemeStore(58-58)src/models/Theme.ts (1)
APP_THEME(1-12)
src/components/SelectBoundSettingListModal.tsx (1)
src/components/ToggleButton.tsx (1)
ToggleButton(81-131)
🔇 Additional comments (2)
src/components/SelectBoundSettingListModal.tsx (1)
15-15: Autoモードへの ToggleButton 組み込みは問題なさそうです
toggleAutoModeEnabled/autoModeEnabledの渡し方も素直で、既存の設定ボタン群とのスタイル一貫性も保てているので、この置き換えはそのままで良さそうです。Also applies to: 128-134
src/components/ToggleButton.tsx (1)
81-130: ToggleButton 全体の構造と挙動は要件を満たしていそうですテーマごとのスタイル切り替えと
outlineオプション、stateに応じた ON/OFF 表示のロジックはいずれもシンプルで読みやすく、オートモードのトグル用途として十分に機能しそうです。
トグルボタン実装&オートモードで使用開始 (#4630)
fixes #4627
Summary by CodeRabbit
リリースノート
✏️ Tip: You can customize this high-level summary in your review settings.