






















@@ -51,7 +51,7 @@ import androidx.compose.ui.text.style.TextOverflow
5151import androidx.compose.ui.unit.dp
52525353@Composable
54-internal fun V2CommandPalette(
54+internal fun CommandPalette(
5555viewModel: MainViewModel,
5656onDismiss: () -> Unit,
5757onOpenChat: () -> Unit,
@@ -70,11 +70,11 @@ internal fun V2CommandPalette(
7070val normalizedQuery = query.trim().lowercase()
7171val quickActions =
7272listOf(
73-V2CommandItem("Open Chat", "Start or continue a conversation", Icons.Outlined.ChatBubbleOutline, onOpenChat),
74-V2CommandItem("Start Voice", "Talk or dictate with OpenClaw", Icons.Outlined.MicNone, onOpenVoice),
75-V2CommandItem("Browse Sessions", "Find previous conversations", Icons.Outlined.AccessTime, onOpenSessions),
76-V2CommandItem("Providers & Models", providerCommandSubtitle(isConnected, providers, models), Icons.Outlined.Inventory2, onOpenProviders),
77-V2CommandItem("Settings", "Gateway, voice, notifications, privacy", Icons.Outlined.Settings, onOpenSettings),
73+CommandItem("Open Chat", "Start or continue a conversation", Icons.Outlined.ChatBubbleOutline, onOpenChat),
74+CommandItem("Start Voice", "Talk or dictate with OpenClaw", Icons.Outlined.MicNone, onOpenVoice),
75+CommandItem("Browse Sessions", "Find previous conversations", Icons.Outlined.AccessTime, onOpenSessions),
76+CommandItem("Providers & Models", providerCommandSubtitle(isConnected, providers, models), Icons.Outlined.Inventory2, onOpenProviders),
77+CommandItem("Settings", "Gateway, voice, notifications, privacy", Icons.Outlined.Settings, onOpenSettings),
7878 )
7979val actionRows = quickActions.filter { it.matches(normalizedQuery) }
8080val sessionRows =
@@ -93,9 +93,9 @@ internal fun V2CommandPalette(
9393 verticalAlignment = Alignment.CenterVertically,
9494 horizontalArrangement = Arrangement.spacedBy(9.dp),
9595 ) {
96-V2CommandIconButton(icon = Icons.AutoMirrored.Filled.ArrowBack, contentDescription = "Close search", onClick = onDismiss)
96+CommandIconButton(icon = Icons.AutoMirrored.Filled.ArrowBack, contentDescription = "Close search", onClick = onDismiss)
9797Text(text = "Search", style = ClawTheme.type.title, color = ClawTheme.colors.text, modifier = Modifier.weight(1f), textAlign = TextAlign.Center)
98-V2CommandAvatar(text = "OC")
98+CommandAvatar(text = "OC")
9999 }
100100 }
101101@@ -104,7 +104,7 @@ internal fun V2CommandPalette(
104104 }
105105106106 item {
107-V2CommandSectionLabel(title = "Quick actions")
107+CommandSectionLabel(title = "Quick actions")
108108 }
109109110110if (actionRows.isEmpty()) {
@@ -113,12 +113,12 @@ internal fun V2CommandPalette(
113113 }
114114 } else {
115115 item {
116-V2CommandActionList(rows = actionRows)
116+CommandActionList(rows = actionRows)
117117 }
118118 }
119119120120 item {
121-V2CommandSectionLabel(title = "Sessions")
121+CommandSectionLabel(title = "Sessions")
122122 }
123123124124if (sessionRows.isEmpty()) {
@@ -133,10 +133,10 @@ internal fun V2CommandPalette(
133133 }
134134 } else {
135135 item {
136-V2CommandSessionList(
136+CommandSessionList(
137137 rows =
138138 sessionRows.map { session ->
139-V2CommandSessionRow(
139+CommandSessionRow(
140140 key = session.key,
141141 title = commandSessionTitle(session.displayName),
142142 subtitle = if (pendingRunCount > 0) "Assistant working" else "OpenClaw session",
@@ -152,7 +152,7 @@ internal fun V2CommandPalette(
152152 }
153153}
154154155-private data class V2CommandItem(
155+private data class CommandItem(
156156val title: String,
157157val subtitle: String,
158158val icon: ImageVector,
@@ -161,24 +161,24 @@ private data class V2CommandItem(
161161fun matches(query: String): Boolean = query.isEmpty() || title.lowercase().contains(query) || subtitle.lowercase().contains(query)
162162}
163163164-private data class V2CommandSessionRow(
164+private data class CommandSessionRow(
165165val key: String,
166166val title: String,
167167val subtitle: String,
168168val metadata: String,
169169)
170170171171@Composable
172-private fun V2CommandActionList(rows: List<V2CommandItem>) {
172+private fun CommandActionList(rows: List<CommandItem>) {
173173ClawPanel(contentPadding = PaddingValues(horizontal = 8.dp, vertical = 0.dp)) {
174174ClawSeparatedColumn(items = rows) { row ->
175-V2CommandActionRow(row = row)
175+CommandActionRow(row = row)
176176 }
177177 }
178178}
179179180180@Composable
181-private fun V2CommandActionRow(row: V2CommandItem) {
181+private fun CommandActionRow(row: CommandItem) {
182182Surface(color = Color.Transparent, contentColor = ClawTheme.colors.text) {
183183Row(
184184 modifier =
@@ -207,20 +207,20 @@ private fun V2CommandActionRow(row: V2CommandItem) {
207207}
208208209209@Composable
210-private fun V2CommandSessionList(
211-rows: List<V2CommandSessionRow>,
210+private fun CommandSessionList(
211+rows: List<CommandSessionRow>,
212212onOpen: (String) -> Unit,
213213) {
214214ClawPanel(contentPadding = PaddingValues(horizontal = 8.dp, vertical = 0.dp)) {
215215ClawSeparatedColumn(items = rows) { row ->
216-V2CommandSessionListRow(row = row, onClick = { onOpen(row.key) })
216+CommandSessionListRow(row = row, onClick = { onOpen(row.key) })
217217 }
218218 }
219219}
220220221221@Composable
222-private fun V2CommandSessionListRow(
223-row: V2CommandSessionRow,
222+private fun CommandSessionListRow(
223+row: CommandSessionRow,
224224onClick: () -> Unit,
225225) {
226226Surface(color = ClawTheme.colors.canvas, contentColor = ClawTheme.colors.text) {
@@ -261,7 +261,7 @@ private fun V2CommandSessionListRow(
261261}
262262263263@Composable
264-private fun V2CommandIconButton(
264+private fun CommandIconButton(
265265icon: ImageVector,
266266contentDescription: String,
267267onClick: () -> Unit,
@@ -274,7 +274,7 @@ private fun V2CommandIconButton(
274274}
275275276276@Composable
277-private fun V2CommandAvatar(text: String) {
277+private fun CommandAvatar(text: String) {
278278Surface(
279279 modifier = Modifier.size(34.dp),
280280 shape = CircleShape,
@@ -289,7 +289,7 @@ private fun V2CommandAvatar(text: String) {
289289}
290290291291@Composable
292-private fun V2CommandSectionLabel(title: String) {
292+private fun CommandSectionLabel(title: String) {
293293Row(modifier = Modifier.fillMaxWidth()) {
294294Text(text = title.uppercase(), style = ClawTheme.type.caption, color = ClawTheme.colors.textMuted)
295295 }
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。