refactor: remove sidebar and associated screens#3
Conversation
Remove ModalNavigationDrawer-based sidebar and all associated features that were only accessible through it: GatewaySettings screen, SystemPrompt editor, and related domain models, repositories, and tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Simplify navigation to Terminal ↔ TerminalSession only. Remove drawer gesture and sidebar swipe from SwipeNavigationContainer. MainActivity now uses TerminalNavigationScreen as the root. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove onOpenGatewaySettings callback from AgentListScreen and SessionList. Clean up AppModule by removing SystemPromptRepository, GatewaySettingsScreenModel, and SystemPromptEditorScreenModel. Remove SystemPrompt-related tests from DtoSerializationTest. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
💤 Files with no reviewable changes (2)
✅ Files skipped from review due to trivial changes (1)
Walkthroughシステムプロンプト機能とサイドバーナビゲーションを完全に削除し、TerminalNavigationScreenベースの新しいナビゲーション構造に移行。MainActivity は初期スクリーンを SidebarScreen から TerminalNavigationScreen に変更。関連する UI コンポーネント、リポジトリ、テストも削除。 Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@frontend/shared/src/commonMain/kotlin/dev/plexus/shared/features/navigation/TerminalNavigationScreen.kt`:
- Around line 62-63: In TerminalNavigationScreen, don't assign activeView =
MainView.Terminal directly during composition when lastSessionId is empty;
instead move that side-effect into a LaunchedEffect keyed on lastSessionId so
the state update runs as an effect (e.g. LaunchedEffect(lastSessionId) { if
(lastSessionId.isEmpty()) activeView = MainView.Terminal }), ensuring activeView
remains a MutableState/remember-backed variable and removing the inline
assignment from the composable body.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 016b430e-91f4-4e95-85e7-2a1814abdc04
📒 Files selected for processing (30)
frontend/androidApp/src/main/kotlin/dev/plexus/app/MainActivity.ktfrontend/shared/src/commonMain/kotlin/dev/plexus/shared/core/data/repository/SystemPromptRepositoryImpl.ktfrontend/shared/src/commonMain/kotlin/dev/plexus/shared/core/domain/model/SystemPromptName.ktfrontend/shared/src/commonMain/kotlin/dev/plexus/shared/core/domain/model/SystemPromptResponse.ktfrontend/shared/src/commonMain/kotlin/dev/plexus/shared/core/domain/model/SystemPromptUpdateRequest.ktfrontend/shared/src/commonMain/kotlin/dev/plexus/shared/core/domain/repository/SystemPromptRepository.ktfrontend/shared/src/commonMain/kotlin/dev/plexus/shared/core/ui/components/SettingsTopBar.ktfrontend/shared/src/commonMain/kotlin/dev/plexus/shared/di/AppModule.ktfrontend/shared/src/commonMain/kotlin/dev/plexus/shared/features/navigation/MainNavigationHost.ktfrontend/shared/src/commonMain/kotlin/dev/plexus/shared/features/navigation/MainView.ktfrontend/shared/src/commonMain/kotlin/dev/plexus/shared/features/navigation/SwipeNavigationContainer.ktfrontend/shared/src/commonMain/kotlin/dev/plexus/shared/features/navigation/TerminalNavigationScreen.ktfrontend/shared/src/commonMain/kotlin/dev/plexus/shared/features/sidebar/SidebarFooter.ktfrontend/shared/src/commonMain/kotlin/dev/plexus/shared/features/sidebar/SidebarScreen.ktfrontend/shared/src/commonMain/kotlin/dev/plexus/shared/features/systemprompt/SystemPromptEditor.ktfrontend/shared/src/commonMain/kotlin/dev/plexus/shared/features/systemprompt/SystemPromptEditorEffect.ktfrontend/shared/src/commonMain/kotlin/dev/plexus/shared/features/systemprompt/SystemPromptEditorScreen.ktfrontend/shared/src/commonMain/kotlin/dev/plexus/shared/features/systemprompt/SystemPromptEditorScreenModel.ktfrontend/shared/src/commonMain/kotlin/dev/plexus/shared/features/systemprompt/SystemPromptEditorState.ktfrontend/shared/src/commonMain/kotlin/dev/plexus/shared/features/systemprompt/SystemPromptTabs.ktfrontend/shared/src/commonMain/kotlin/dev/plexus/shared/features/terminal/agentlist/AgentListScreen.ktfrontend/shared/src/commonMain/kotlin/dev/plexus/shared/features/terminal/agentlist/components/SessionList.ktfrontend/shared/src/commonMain/kotlin/dev/plexus/shared/features/terminal/settings/GatewaySettingsEffect.ktfrontend/shared/src/commonMain/kotlin/dev/plexus/shared/features/terminal/settings/GatewaySettingsScreen.ktfrontend/shared/src/commonMain/kotlin/dev/plexus/shared/features/terminal/settings/GatewaySettingsScreenModel.ktfrontend/shared/src/commonMain/kotlin/dev/plexus/shared/features/terminal/settings/GatewaySettingsState.ktfrontend/shared/src/commonTest/kotlin/dev/plexus/shared/core/domain/model/DtoSerializationTest.ktfrontend/shared/src/commonTest/kotlin/dev/plexus/shared/features/systemprompt/SystemPromptEditorStateTest.ktfrontend/shared/src/commonTest/kotlin/dev/plexus/shared/features/systemprompt/SystemPromptRepositoryImplTest.ktfrontend/shared/src/commonTest/kotlin/dev/plexus/shared/features/terminal/settings/GatewaySettingsStateTest.kt
💤 Files with no reviewable changes (27)
- frontend/shared/src/commonTest/kotlin/dev/plexus/shared/features/terminal/settings/GatewaySettingsStateTest.kt
- frontend/shared/src/commonMain/kotlin/dev/plexus/shared/features/terminal/settings/GatewaySettingsEffect.kt
- frontend/shared/src/commonMain/kotlin/dev/plexus/shared/core/domain/repository/SystemPromptRepository.kt
- frontend/shared/src/commonMain/kotlin/dev/plexus/shared/features/systemprompt/SystemPromptEditor.kt
- frontend/shared/src/commonMain/kotlin/dev/plexus/shared/features/terminal/agentlist/AgentListScreen.kt
- frontend/shared/src/commonMain/kotlin/dev/plexus/shared/features/terminal/agentlist/components/SessionList.kt
- frontend/shared/src/commonMain/kotlin/dev/plexus/shared/features/navigation/MainView.kt
- frontend/shared/src/commonMain/kotlin/dev/plexus/shared/core/domain/model/SystemPromptResponse.kt
- frontend/shared/src/commonTest/kotlin/dev/plexus/shared/core/domain/model/DtoSerializationTest.kt
- frontend/shared/src/commonMain/kotlin/dev/plexus/shared/features/systemprompt/SystemPromptEditorEffect.kt
- frontend/shared/src/commonMain/kotlin/dev/plexus/shared/core/ui/components/SettingsTopBar.kt
- frontend/shared/src/commonMain/kotlin/dev/plexus/shared/core/domain/model/SystemPromptUpdateRequest.kt
- frontend/shared/src/commonMain/kotlin/dev/plexus/shared/core/domain/model/SystemPromptName.kt
- frontend/shared/src/commonMain/kotlin/dev/plexus/shared/features/terminal/settings/GatewaySettingsState.kt
- frontend/shared/src/commonMain/kotlin/dev/plexus/shared/features/systemprompt/SystemPromptTabs.kt
- frontend/shared/src/commonTest/kotlin/dev/plexus/shared/features/systemprompt/SystemPromptEditorStateTest.kt
- frontend/shared/src/commonMain/kotlin/dev/plexus/shared/features/systemprompt/SystemPromptEditorState.kt
- frontend/shared/src/commonMain/kotlin/dev/plexus/shared/features/sidebar/SidebarFooter.kt
- frontend/shared/src/commonMain/kotlin/dev/plexus/shared/features/navigation/MainNavigationHost.kt
- frontend/shared/src/commonMain/kotlin/dev/plexus/shared/features/terminal/settings/GatewaySettingsScreenModel.kt
- frontend/shared/src/commonMain/kotlin/dev/plexus/shared/features/systemprompt/SystemPromptEditorScreen.kt
- frontend/shared/src/commonMain/kotlin/dev/plexus/shared/di/AppModule.kt
- frontend/shared/src/commonMain/kotlin/dev/plexus/shared/features/terminal/settings/GatewaySettingsScreen.kt
- frontend/shared/src/commonMain/kotlin/dev/plexus/shared/features/systemprompt/SystemPromptEditorScreenModel.kt
- frontend/shared/src/commonMain/kotlin/dev/plexus/shared/features/sidebar/SidebarScreen.kt
- frontend/shared/src/commonMain/kotlin/dev/plexus/shared/core/data/repository/SystemPromptRepositoryImpl.kt
- frontend/shared/src/commonTest/kotlin/dev/plexus/shared/features/systemprompt/SystemPromptRepositoryImplTest.kt
| activeView = MainView.Terminal | ||
| } |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify direct state mutations for activeView in this composable file.
# Expected: fallback branch should avoid direct assignment in composition after refactor.
rg -n -C3 'activeView\s*=\s*MainView\.Terminal' frontend/shared/src/commonMain/kotlin/dev/plexus/shared/features/navigation/TerminalNavigationScreen.ktRepository: endo-ava/plexus
Length of output: 1072
🏁 Script executed:
cat -n frontend/shared/src/commonMain/kotlin/dev/plexus/shared/features/navigation/TerminalNavigationScreen.ktRepository: endo-ava/plexus
Length of output: 2997
composition中のstate直接更新をLaunchedEffectに逃がそう
Line 62でlastSessionIdが空の場合に、composition中に直接activeViewを更新してる。composition phase中での副作用はComposeの安定性を損なうからね。LaunchedEffectで副作用として処理するのが正しいやり方。
💡 修正案
import androidx.compose.runtime.Composable
+import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.saveable.rememberSaveable
@@
} else {
- activeView = MainView.Terminal
+ LaunchedEffect(Unit) {
+ activeView = MainView.Terminal
+ }
}
}
}
}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In
`@frontend/shared/src/commonMain/kotlin/dev/plexus/shared/features/navigation/TerminalNavigationScreen.kt`
around lines 62 - 63, In TerminalNavigationScreen, don't assign activeView =
MainView.Terminal directly during composition when lastSessionId is empty;
instead move that side-effect into a LaunchedEffect keyed on lastSessionId so
the state update runs as an effect (e.g. LaunchedEffect(lastSessionId) { if
(lastSessionId.isEmpty()) activeView = MainView.Terminal }), ensuring activeView
remains a MutableState/remember-backed variable and removing the inline
assignment from the composable body.
Re-add GatewaySettings screen, ScreenModel, and settings button in SessionList header. Navigation now handles Terminal, GatewaySettings, and TerminalSession views without the sidebar. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
ModalNavigationDrawer-based sidebar and all features accessible through it (GatewaySettings screen, SystemPrompt editor, Terminal button)SidebarScreenwithTerminalNavigationScreenthat directly manages Terminal ↔ TerminalSession navigationChanges
e37759d61be8acMainViewenum, remove sidebar swipe, createTerminalNavigationScreenff3754eSessionList, clean upAppModuleDI, remove SystemPrompt testsTest plan
./gradlew :androidApp:assembleDebugpasses./gradlew :shared:testDebugUnitTestpasses🤖 Generated with Claude Code
Summary by CodeRabbit
削除された機能
改善