Repository navigation
タッチ不可モードのトグルをチューニング画面から試験的機能画面へ移動 - #6623
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TFjGqz4LyMKeGL8pgCqVUm
Contributor
📝 WalkthroughWalkthroughExperimentalSettingsにUntouchable Modeのトグルと説明文を追加しました。状態をAtomと永続ストレージに保存します。保存に失敗した場合は状態を戻し、エラーダイアログを表示します。TuningSettingsの旧UIと翻訳キーを更新しました。 ChangesUntouchable Mode設定
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant ExperimentalSettings
participant Atom
participant Storage
participant ErrorDialog
ExperimentalSettings->>Atom: untouchableModeEnabledを更新
ExperimentalSettings->>Storage: UNTOUCHABLE_MODE_ENABLEDを保存
Storage-->>ExperimentalSettings: 保存結果
ExperimentalSettings->>Atom: 保存失敗時にロールバック
ExperimentalSettings->>ErrorDialog: 失敗ダイアログを表示
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Contributor
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/screens/ExperimentalSettings.test.tsx (1)
180-206: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winモックの復元を
afterEachに集約してください。
afterEachにjest.restoreAllMocks()を追加し、各テストのmockRestore()を削除してください。アサーション失敗時も、後続テストへモックの実装を残さないようにします。🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/screens/ExperimentalSettings.test.tsx` around lines 180 - 206, 集中的なモック復元のため、テストファイルのafterEachにjest.restoreAllMocks()を追加し、テスト内のsetSpy.mockRestore()やconsoleErrorSpy.mockRestore()など個別の復元処理を削除してください。特に「タッチ不可モードのストレージ保存に失敗した場合はatom状態をロールバックしエラーを通知する」テストを含め、アサーション失敗時も後続テストへモックが残らないようにします。Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/screens/ExperimentalSettings.test.tsx`:
- Around line 180-206:
集中的なモック復元のため、テストファイルのafterEachにjest.restoreAllMocks()を追加し、テスト内のsetSpy.mockRestore()やconsoleErrorSpy.mockRestore()など個別の復元処理を削除してください。特に「タッチ不可モードのストレージ保存に失敗した場合はatom状態をロールバックしエラーを通知する」テストを含め、アサーション失敗時も後続テストへモックが残らないようにします。
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 526a3e61-0079-4b15-946d-6237d530203b
📒 Files selected for processing (5)
assets/translations/en.jsonassets/translations/ja.jsonsrc/components/TuningSettings.tsxsrc/screens/ExperimentalSettings.test.tsxsrc/screens/ExperimentalSettings.tsx
💤 Files with no reviewable changes (1)
- src/components/TuningSettings.tsx
Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TFjGqz4LyMKeGL8pgCqVUm
4 of 9 tasks
4 of 9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
チューニング画面にあった「タッチ不可モードを有効化する」を「試験的機能」画面へ移動し、項目名を「タッチ不可モード」に変更しました。
変更の種類
変更内容
src/components/TuningSettings.tsx: 「タッチ不可モードを有効化する」のスイッチとtoggleUntouchableModeEnabledハンドラーを削除。src/screens/ExperimentalSettings.tsx: テレメトリの下に「タッチ不可モード」のToggleItemと説明文を追加。保存処理は同画面の既存トグルと同じパターン(STORAGE_KEYS.UNTOUCHABLE_MODE_ENABLEDへ保存し、失敗時は atom をロールバックしてエラーダイアログを表示)に揃えました。移動前のチューニング画面版には無かった保存失敗時のロールバックが加わっています。assets/translations/{ja,en}.json:enableUntouchableMode(「タッチ不可モードを有効化する」)をuntouchableModeTitle(「タッチ不可モード」/"Untouchable Mode")へリネーム。試験的機能画面の他項目に合わせてuntouchableModeDescriptionを追加。src/screens/ExperimentalSettings.test.tsx: タッチ不可モードの ON / OFF / 保存失敗時ロールバックの 3 ケースを追加。あわせて、CodeRabbit の指摘に従い各テストのmockRestore()をafterEachのjest.restoreAllMocks()へ集約し、アサーション失敗時にモックが後続テストへ漏れないようにしました。保存先(
tuningState.untouchableModeEnabledと MMKV キーUNTOUCHABLE_MODE_ENABLED)は変更していないため、既存ユーザーの設定値とPermitted.tsxの起動時ロード、Main.tsx/useWarningInfo.tsの参照はそのまま動作します。回帰リスクと対策
enableUntouchableModeの参照は残っていないことをrgで確認済みです。ExperimentalSettings.test.tsxの新規 3 ケースで ON / OFF / 保存失敗時の挙動を検証しています。テスト
ローカルで以下を実行し、いずれも成功しています(
npm testは 213 suites / 2240 tests すべてパス)。npm run lintが通ることnpm testが通ることnpm run typecheckが通ること関連Issue
スクリーンショット(任意)
Summary by CodeRabbit