Skip to content

トグルボタン実装&オートモードで使用開始 - #4630

Merged
TinyKitten merged 1 commit into
devfrom
feature/toggle-button
Nov 21, 2025
Merged

TinyKitten merged 1 commit into
devfrom
feature/toggle-button

Conversation

@TinyKitten

@TinyKitten TinyKitten commented Nov 21, 2025 •

Copy link
Copy Markdown
Member

fixes #4627

Summary by CodeRabbit

リリースノート

  • 新機能
    • 新しいトグルボタンコンポーネントを追加しました。ON/OFFの状態表示と、テーマに応じたスタイルに対応しています。
    • オートモード設定がトグルボタンで操作できるようになり、ユーザーインターフェイスが改善されました。

✏️ Tip: You can customize this high-level summary in your review settings.

@TinyKitten TinyKitten self-assigned this Nov 21, 2025
@github-actions github-actions Bot added the react label Nov 21, 2025
@coderabbitai

coderabbitai Bot commented Nov 21, 2025 •

Copy link
Copy Markdown
Contributor

Note

.coderabbit.yml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

⚠️ Parsing warnings (1)
Validation error: Unrecognized key(s) in object: 'auto_review'
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • 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

Walkthrough

新しいToggleButtonコンポーネントを追加し、SelectBoundSettingListModalでオートモード状態の表示・切り替え用ボタンを従来のButtonからToggleButtonに置き換えました。ToggleButtonはテーマベースのスタイリングと状態表示機能を備えています。

Changes

コホート / ファイル 変更の概要
新しい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インジケーターを表示更新
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20分

  • ToggleButton.tsx: テーマベースのスタイリングロジックと条件付きレンダリング、複数のプロップ管理が含まれるため、スタイリングと状態管理の正確性確認が必要
  • SelectBoundSettingListModal.tsx: 統合箇所がシンプルだが、ToggleButtonとの契約(onToggle、state、ラベルの配置)が正しく実装されているか確認が必要
  • アウトラインモード、テーマ切り替え時のスタイリング動作の検証

Possibly related PRs

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_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ 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.

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between 7974fef and 2865fde.

📒 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 表示のロジックはいずれもシンプルで読みやすく、オートモードのトグル用途として十分に機能しそうです。

@TinyKitten
TinyKitten merged commit f18d232 into dev Nov 21, 2025
@TinyKitten
TinyKitten deleted the feature/toggle-button branch November 21, 2025 16:25
TinyKitten added a commit that referenced this pull request Nov 21, 2025
トグルボタン実装&オートモードで使用開始 (#4630)
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.

Toggleボタンの実装

1 participant