Tighten chat chrome and composer
This commit is contained in:
1 parent
32d10933ef
commit
6557756e7a
3 files changed
+32
-46
No files matched your search
@@ -5,6 +5,7 @@ import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.material3.CenterAlignedTopAppBar
|
||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||
import androidx.compose.material3.Button
|
||||
import androidx.compose.material3.NavigationBar
|
||||
import androidx.compose.material3.NavigationBarItem
|
||||
import androidx.compose.material3.Scaffold
|
||||
@@ -143,18 +144,21 @@ private fun OpenClawRoot(appState: OpenClawAppState) {
|
||||
is AppRoute.Chat -> {
|
||||
CenterAlignedTopAppBar(
|
||||
title = {
|
||||
Text(activeSession?.title ?: "会话")
|
||||
Text(
|
||||
text = activeSession?.title ?: "会话",
|
||||
style = androidx.compose.material3.MaterialTheme.typography.titleMedium,
|
||||
)
|
||||
},
|
||||
navigationIcon = {
|
||||
TextButton(onClick = appState::closeChat) {
|
||||
Button(onClick = appState::closeChat) {
|
||||
Text("返回")
|
||||
}
|
||||
},
|
||||
actions = {
|
||||
TextButton(onClick = { pickAttachment() }) {
|
||||
Button(onClick = { pickAttachment() }) {
|
||||
Text("附件")
|
||||
}
|
||||
TextButton(onClick = {
|
||||
Button(onClick = {
|
||||
activeSession?.id?.let { sessionId ->
|
||||
coroutineScope.launch {
|
||||
appState.clearSyncError()
|
||||
@@ -168,17 +172,7 @@ private fun OpenClawRoot(appState: OpenClawAppState) {
|
||||
)
|
||||
}
|
||||
|
||||
AppRoute.Sessions -> {
|
||||
CenterAlignedTopAppBar(title = { Text("会话") })
|
||||
}
|
||||
|
||||
AppRoute.Status -> {
|
||||
CenterAlignedTopAppBar(title = { Text("状态") })
|
||||
}
|
||||
|
||||
AppRoute.Settings -> {
|
||||
CenterAlignedTopAppBar(title = { Text("设置") })
|
||||
}
|
||||
else -> Unit
|
||||
}
|
||||
},
|
||||
bottomBar = {
|
||||
|
||||
+22
-31
@@ -144,42 +144,33 @@ fun ChatScreen(
|
||||
}
|
||||
|
||||
Card(modifier = Modifier.fillMaxWidth()) {
|
||||
Column(
|
||||
Row(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(12.dp),
|
||||
verticalArrangement = Arrangement.spacedBy(10.dp),
|
||||
.padding(horizontal = 10.dp, vertical = 10.dp),
|
||||
horizontalArrangement = Arrangement.spacedBy(10.dp),
|
||||
verticalAlignment = Alignment.Bottom,
|
||||
) {
|
||||
Text(
|
||||
if (isSending) "正在发送消息…" else "继续当前会话",
|
||||
style = MaterialTheme.typography.labelLarge,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
OutlinedTextField(
|
||||
value = input,
|
||||
onValueChange = { input = it },
|
||||
modifier = Modifier.weight(1f),
|
||||
label = { Text("输入消息") },
|
||||
placeholder = { Text("给 $sessionTitle 发一句话") },
|
||||
maxLines = 3,
|
||||
enabled = !isSending,
|
||||
)
|
||||
Row(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
horizontalArrangement = Arrangement.spacedBy(12.dp),
|
||||
verticalAlignment = Alignment.Bottom,
|
||||
Button(
|
||||
onClick = {
|
||||
if (input.isNotBlank() && !isSending) {
|
||||
onSend(input.trim())
|
||||
input = ""
|
||||
}
|
||||
},
|
||||
enabled = !isSending,
|
||||
) {
|
||||
OutlinedTextField(
|
||||
value = input,
|
||||
onValueChange = { input = it },
|
||||
modifier = Modifier.weight(1f),
|
||||
label = { Text("输入消息") },
|
||||
placeholder = { Text("给 $sessionTitle 发一句话") },
|
||||
maxLines = 4,
|
||||
enabled = !isSending,
|
||||
)
|
||||
Button(
|
||||
onClick = {
|
||||
if (input.isNotBlank() && !isSending) {
|
||||
onSend(input.trim())
|
||||
input = ""
|
||||
}
|
||||
},
|
||||
enabled = !isSending,
|
||||
) {
|
||||
if (isSending) CircularProgressIndicator() else Text("发送")
|
||||
}
|
||||
if (isSending) CircularProgressIndicator() else Text("发送")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user