Skip to content

refactor: remove sidebar and associated screens#3

Merged
endo-ly merged 4 commits into
mainfrom
refactor/remove-sidebar
Mar 29, 2026
Merged

refactor: remove sidebar and associated screens#3
endo-ly merged 4 commits into
mainfrom
refactor/remove-sidebar

Conversation

@endo-ly
Copy link
Copy Markdown
Owner

@endo-ly endo-ly commented Mar 29, 2026

Summary

  • Remove ModalNavigationDrawer-based sidebar and all features accessible through it (GatewaySettings screen, SystemPrompt editor, Terminal button)
  • Replace SidebarScreen with TerminalNavigationScreen that directly manages Terminal ↔ TerminalSession navigation
  • Clean up related domain models, repositories, DI registrations, and tests

Changes

Commit Description
e37759d Delete 21 files: sidebar, settings, systemprompt, domain models, tests
61be8ac Simplify navigation layer: shrink MainView enum, remove sidebar swipe, create TerminalNavigationScreen
ff3754e Remove settings button from SessionList, clean up AppModule DI, remove SystemPrompt tests

Test plan

  • ./gradlew :androidApp:assembleDebug passes
  • ./gradlew :shared:testDebugUnitTest passes

🤖 Generated with Claude Code

Summary by CodeRabbit

  • 削除された機能

    • システムプロンプト編集機能とその関連コンポーネントを削除しました
    • サイドバーナビゲーション機能を削除しました
  • 改善

    • アプリケーションのナビゲーション構造を簡素化し、ターミナル機能を中心とした操作フローに整理しました
    • スワイプジェスチャーナビゲーション処理を最適化しました

endo-ly and others added 3 commits March 29, 2026 11:57
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>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 29, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 40db481a-6e44-49cd-a1ff-8b333b807fe2

📥 Commits

Reviewing files that changed from the base of the PR and between ff3754e and 5f45e4c.

📒 Files selected for processing (3)
  • frontend/shared/src/commonMain/kotlin/dev/plexus/shared/di/AppModule.kt
  • frontend/shared/src/commonMain/kotlin/dev/plexus/shared/features/navigation/MainView.kt
  • frontend/shared/src/commonMain/kotlin/dev/plexus/shared/features/navigation/TerminalNavigationScreen.kt
💤 Files with no reviewable changes (2)
  • frontend/shared/src/commonMain/kotlin/dev/plexus/shared/features/navigation/MainView.kt
  • frontend/shared/src/commonMain/kotlin/dev/plexus/shared/di/AppModule.kt
✅ Files skipped from review due to trivial changes (1)
  • frontend/shared/src/commonMain/kotlin/dev/plexus/shared/features/navigation/TerminalNavigationScreen.kt

Walkthrough

システムプロンプト機能とサイドバーナビゲーションを完全に削除し、TerminalNavigationScreenベースの新しいナビゲーション構造に移行。MainActivity は初期スクリーンを SidebarScreen から TerminalNavigationScreen に変更。関連する UI コンポーネント、リポジトリ、テストも削除。

Changes

Cohort / File(s) Summary
Navigation Flow Restructuring
MainActivity.kt, TerminalNavigationScreen.kt, MainNavigationHost.kt, SwipeNavigationContainer.kt, MainView.kt
初期ナビゲーション構造を SidebarScreen から TerminalNavigationScreen に変更。MainView から SystemPrompt enum を削除、SwipeNavigationContainer から sidebar スワイプ処理を削除。新しい TerminalNavigationScreen は三つのビュー(Terminal、GatewaySettings、TerminalSession)をサポート。
System Prompt Domain Layer Removal
SystemPromptName.kt, SystemPromptResponse.kt, SystemPromptUpdateRequest.kt, SystemPromptRepository.kt
システムプロンプト関連のドメインモデルとリポジトリインターフェース全削除(4ファイル)。これらは編集・取得機能を支えていたが、完全に廃止。
System Prompt Repository Implementation Removal
SystemPromptRepositoryImpl.kt
キャッシュ戦略(メモリおよびディスクキャッシュ)を含むシステムプロンプトリポジトリの実装をすべて削除。
System Prompt Feature UI Removal
SidebarScreen.kt, SidebarFooter.kt, SystemPromptEditorScreen.kt, SystemPromptEditor.kt, SystemPromptTabs.kt, SystemPromptEditorEffect.kt, SystemPromptEditorState.kt, SystemPromptEditorScreenModel.kt
システムプロンプト編集機能の UI とビジネスロジック(ScreenModel、Effect、State)を完全削除。SidebarScreen 全体も削除。
Dependency Injection Updates
AppModule.kt
SystemPromptRepository と SystemPromptEditorScreenModel の Koin バインディングを削除。
Test Cleanup
DtoSerializationTest.kt, SystemPromptEditorStateTest.kt, SystemPromptRepositoryImplTest.kt
削除された機能に関連するテストを削除(全体で約500行)。

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Poem

🐰 サイドバーよ、さようなら
システムプロンプトも別れ
ターミナルが新しい王様だ
ナビゲーション、シンプルに生まれ変わった✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed タイトルは主な変更内容(サイドバーと関連スクリーンの削除)を明確に要約しており、changesetの主要な意図を正確に反映している。

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/remove-sidebar

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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

🤖 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

📥 Commits

Reviewing files that changed from the base of the PR and between 49634cc and ff3754e.

📒 Files selected for processing (30)
  • frontend/androidApp/src/main/kotlin/dev/plexus/app/MainActivity.kt
  • frontend/shared/src/commonMain/kotlin/dev/plexus/shared/core/data/repository/SystemPromptRepositoryImpl.kt
  • frontend/shared/src/commonMain/kotlin/dev/plexus/shared/core/domain/model/SystemPromptName.kt
  • frontend/shared/src/commonMain/kotlin/dev/plexus/shared/core/domain/model/SystemPromptResponse.kt
  • frontend/shared/src/commonMain/kotlin/dev/plexus/shared/core/domain/model/SystemPromptUpdateRequest.kt
  • frontend/shared/src/commonMain/kotlin/dev/plexus/shared/core/domain/repository/SystemPromptRepository.kt
  • frontend/shared/src/commonMain/kotlin/dev/plexus/shared/core/ui/components/SettingsTopBar.kt
  • frontend/shared/src/commonMain/kotlin/dev/plexus/shared/di/AppModule.kt
  • frontend/shared/src/commonMain/kotlin/dev/plexus/shared/features/navigation/MainNavigationHost.kt
  • frontend/shared/src/commonMain/kotlin/dev/plexus/shared/features/navigation/MainView.kt
  • frontend/shared/src/commonMain/kotlin/dev/plexus/shared/features/navigation/SwipeNavigationContainer.kt
  • frontend/shared/src/commonMain/kotlin/dev/plexus/shared/features/navigation/TerminalNavigationScreen.kt
  • frontend/shared/src/commonMain/kotlin/dev/plexus/shared/features/sidebar/SidebarFooter.kt
  • frontend/shared/src/commonMain/kotlin/dev/plexus/shared/features/sidebar/SidebarScreen.kt
  • frontend/shared/src/commonMain/kotlin/dev/plexus/shared/features/systemprompt/SystemPromptEditor.kt
  • frontend/shared/src/commonMain/kotlin/dev/plexus/shared/features/systemprompt/SystemPromptEditorEffect.kt
  • frontend/shared/src/commonMain/kotlin/dev/plexus/shared/features/systemprompt/SystemPromptEditorScreen.kt
  • frontend/shared/src/commonMain/kotlin/dev/plexus/shared/features/systemprompt/SystemPromptEditorScreenModel.kt
  • frontend/shared/src/commonMain/kotlin/dev/plexus/shared/features/systemprompt/SystemPromptEditorState.kt
  • frontend/shared/src/commonMain/kotlin/dev/plexus/shared/features/systemprompt/SystemPromptTabs.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/terminal/settings/GatewaySettingsEffect.kt
  • frontend/shared/src/commonMain/kotlin/dev/plexus/shared/features/terminal/settings/GatewaySettingsScreen.kt
  • frontend/shared/src/commonMain/kotlin/dev/plexus/shared/features/terminal/settings/GatewaySettingsScreenModel.kt
  • frontend/shared/src/commonMain/kotlin/dev/plexus/shared/features/terminal/settings/GatewaySettingsState.kt
  • frontend/shared/src/commonTest/kotlin/dev/plexus/shared/core/domain/model/DtoSerializationTest.kt
  • frontend/shared/src/commonTest/kotlin/dev/plexus/shared/features/systemprompt/SystemPromptEditorStateTest.kt
  • frontend/shared/src/commonTest/kotlin/dev/plexus/shared/features/systemprompt/SystemPromptRepositoryImplTest.kt
  • frontend/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

Comment on lines +62 to +63
activeView = MainView.Terminal
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 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.kt

Repository: endo-ava/plexus

Length of output: 1072


🏁 Script executed:

cat -n frontend/shared/src/commonMain/kotlin/dev/plexus/shared/features/navigation/TerminalNavigationScreen.kt

Repository: 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>
@endo-ly endo-ly added enhancement New feature or request frontend labels Mar 29, 2026
@endo-ly endo-ly merged commit 0f5580a into main Mar 29, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request frontend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant