Skip to content

Commit 1121103

Browse files
committed
feat(codereview): add demo page and update icons #453
Introduce a demo page for code review and update icon usage in related components for improved UI consistency.
1 parent fc587da commit 1121103

File tree

4 files changed

+1151
-428
lines changed

4 files changed

+1151
-428
lines changed

mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/CodeReviewPage.kt

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
11
package cc.unitmesh.devins.ui.compose.agent.codereview
22

33
import 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.*
75
import androidx.compose.runtime.*
86
import androidx.compose.ui.Modifier
7+
import androidx.compose.ui.text.font.FontWeight
98
import androidx.compose.ui.unit.dp
9+
import cc.unitmesh.devins.ui.compose.icons.AutoDevComposeIcons
10+
import cc.unitmesh.devins.ui.compose.theme.AutoDevColors
1011
import cc.unitmesh.devins.workspace.Workspace
1112
import cc.unitmesh.devins.workspace.WorkspaceManager
1213
import 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
2023
fun 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
6772
private 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

Comments
 (0)