11package cc.unitmesh.devins.ui.compose.agent.codereview
22
33import androidx.compose.foundation.layout.*
4- import androidx.compose.material.*
5- import androidx.compose.material.icons.Icons
6- import androidx.compose.material.icons.filled.ArrowBack
4+ import androidx.compose.material3.*
75import androidx.compose.runtime.*
86import androidx.compose.ui.Modifier
7+ import androidx.compose.ui.text.font.FontWeight
98import androidx.compose.ui.unit.dp
9+ import cc.unitmesh.devins.ui.compose.icons.AutoDevComposeIcons
10+ import cc.unitmesh.devins.ui.compose.theme.AutoDevColors
1011import cc.unitmesh.devins.workspace.Workspace
1112import cc.unitmesh.devins.workspace.WorkspaceManager
1213import cc.unitmesh.llm.KoogLLMService
1314
1415/* *
15- * Code Review Page - Entry point for the Side-by-Side code review UI
16+ * Code Review Page - Entry point for the Side-by-Side code review UI (redesigned)
1617 *
17- * This is a full-page view that replaces the chat interface when CODE_REVIEW agent is selected
18+ * This is a full-page view that replaces the chat interface when CODE_REVIEW agent is selected.
19+ * Features a three-column layout with commit history, diff viewer, and AI review panel.
1820 */
21+ @OptIn(ExperimentalMaterial3Api ::class )
1922@Composable
2023fun CodeReviewPage (
2124 llmService : KoogLLMService ? ,
@@ -48,7 +51,8 @@ fun CodeReviewPage(
4851 workspace = currentWorkspace
4952 )
5053 },
51- modifier = modifier
54+ modifier = modifier,
55+ containerColor = MaterialTheme .colorScheme.surface
5256 ) { paddingValues ->
5357 Box (
5458 modifier = Modifier
@@ -63,6 +67,7 @@ fun CodeReviewPage(
6367 }
6468}
6569
70+ @OptIn(ExperimentalMaterial3Api ::class )
6671@Composable
6772private fun CodeReviewTopBar (
6873 onBack : () -> Unit ,
@@ -72,28 +77,41 @@ private fun CodeReviewTopBar(
7277 TopAppBar (
7378 title = {
7479 Column {
75- Text (" Code Review" )
80+ Text (
81+ text = " Code Review" ,
82+ style = MaterialTheme .typography.titleLarge,
83+ fontWeight = FontWeight .Bold
84+ )
7685 workspace?.let {
7786 Text (
7887 text = it.name,
79- style = MaterialTheme .typography.caption ,
80- color = MaterialTheme .colors.onPrimary.copy(alpha = 0.7f )
88+ style = MaterialTheme .typography.bodySmall ,
89+ color = MaterialTheme .colorScheme.onSurfaceVariant
8190 )
8291 }
8392 }
8493 },
8594 navigationIcon = {
8695 IconButton (onClick = onBack) {
87- Icon (Icons .Default .ArrowBack , contentDescription = " Back" )
96+ Icon (
97+ imageVector = AutoDevComposeIcons .ArrowBack ,
98+ contentDescription = " Back" ,
99+ tint = MaterialTheme .colorScheme.onSurface
100+ )
88101 }
89102 },
90103 actions = {
91- TextButton (onClick = onRefresh) {
92- Text (" Refresh" , color = MaterialTheme .colors.onPrimary)
104+ IconButton (onClick = onRefresh) {
105+ Icon (
106+ imageVector = AutoDevComposeIcons .Refresh ,
107+ contentDescription = " Refresh" ,
108+ tint = MaterialTheme .colorScheme.onSurface
109+ )
93110 }
94111 },
95- backgroundColor = MaterialTheme .colors.primary,
96- contentColor = MaterialTheme .colors.onPrimary,
97- elevation = 4 .dp
112+ colors = TopAppBarDefaults .topAppBarColors(
113+ containerColor = MaterialTheme .colorScheme.surface,
114+ titleContentColor = MaterialTheme .colorScheme.onSurface
115+ )
98116 )
99117}
0 commit comments