mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-19 11:28:38 +00:00
fix: show rich session names in chat UIs
This commit is contained in:
@@ -62,6 +62,7 @@
|
|||||||
- Gog calendar: format date ranges as RFC 3339 with timezone to satisfy Google Calendar API (thanks @jayhickey).
|
- Gog calendar: format date ranges as RFC 3339 with timezone to satisfy Google Calendar API (thanks @jayhickey).
|
||||||
- macOS onboarding: add scrollable page gutter for overflowing content (#105) — thanks @thewilloftheshadow.
|
- macOS onboarding: add scrollable page gutter for overflowing content (#105) — thanks @thewilloftheshadow.
|
||||||
- Chat UI: keep the chat scrolled to the latest message after switching sessions.
|
- Chat UI: keep the chat scrolled to the latest message after switching sessions.
|
||||||
|
- Chat UI: show rich session display names in Web Chat + SwiftUI + Android.
|
||||||
- Auto-reply: stream completed reply blocks as soon as they finish (configurable default + break); skip empty tool-only blocks unless verbose.
|
- Auto-reply: stream completed reply blocks as soon as they finish (configurable default + break); skip empty tool-only blocks unless verbose.
|
||||||
- Discord: avoid duplicate sends when block streaming is enabled (race with typing hook).
|
- Discord: avoid duplicate sends when block streaming is enabled (race with typing hook).
|
||||||
- Providers: make outbound text chunk limits configurable via `*.textChunkLimit` (defaults remain 4000/Discord 2000).
|
- Providers: make outbound text chunk limits configurable via `*.textChunkLimit` (defaults remain 4000/Discord 2000).
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ fun ChatComposer(
|
|||||||
)
|
)
|
||||||
|
|
||||||
Row(modifier = Modifier.fillMaxWidth(), verticalAlignment = Alignment.CenterVertically) {
|
Row(modifier = Modifier.fillMaxWidth(), verticalAlignment = Alignment.CenterVertically) {
|
||||||
ConnectionPill(sessionKey = sessionKey, healthOk = healthOk)
|
ConnectionPill(sessionLabel = currentSessionLabel, healthOk = healthOk)
|
||||||
Spacer(modifier = Modifier.weight(1f))
|
Spacer(modifier = Modifier.weight(1f))
|
||||||
|
|
||||||
if (pendingRunCount > 0) {
|
if (pendingRunCount > 0) {
|
||||||
@@ -186,7 +186,7 @@ fun ChatComposer(
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
private fun ConnectionPill(sessionKey: String, healthOk: Boolean) {
|
private fun ConnectionPill(sessionLabel: String, healthOk: Boolean) {
|
||||||
Surface(
|
Surface(
|
||||||
shape = RoundedCornerShape(999.dp),
|
shape = RoundedCornerShape(999.dp),
|
||||||
color = MaterialTheme.colorScheme.surfaceContainerHighest,
|
color = MaterialTheme.colorScheme.surfaceContainerHighest,
|
||||||
@@ -201,7 +201,7 @@ private fun ConnectionPill(sessionKey: String, healthOk: Boolean) {
|
|||||||
shape = androidx.compose.foundation.shape.CircleShape,
|
shape = androidx.compose.foundation.shape.CircleShape,
|
||||||
color = if (healthOk) Color(0xFF2ECC71) else Color(0xFFF39C12),
|
color = if (healthOk) Color(0xFF2ECC71) else Color(0xFFF39C12),
|
||||||
) {}
|
) {}
|
||||||
Text(sessionKey, style = MaterialTheme.typography.labelSmall)
|
Text(sessionLabel, style = MaterialTheme.typography.labelSmall)
|
||||||
Text(
|
Text(
|
||||||
if (healthOk) "Connected" else "Connecting…",
|
if (healthOk) "Connected" else "Connecting…",
|
||||||
style = MaterialTheme.typography.labelSmall,
|
style = MaterialTheme.typography.labelSmall,
|
||||||
|
|||||||
@@ -209,7 +209,7 @@ struct ClawdisChatComposer: View {
|
|||||||
Circle()
|
Circle()
|
||||||
.fill(self.viewModel.healthOK ? .green : .orange)
|
.fill(self.viewModel.healthOK ? .green : .orange)
|
||||||
.frame(width: 7, height: 7)
|
.frame(width: 7, height: 7)
|
||||||
Text(self.viewModel.sessionKey)
|
Text(self.activeSessionLabel)
|
||||||
.font(.caption2.weight(.semibold))
|
.font(.caption2.weight(.semibold))
|
||||||
Text(self.viewModel.healthOK ? "Connected" : "Connecting…")
|
Text(self.viewModel.healthOK ? "Connected" : "Connecting…")
|
||||||
.font(.caption2)
|
.font(.caption2)
|
||||||
@@ -221,6 +221,12 @@ struct ClawdisChatComposer: View {
|
|||||||
.clipShape(Capsule())
|
.clipShape(Capsule())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private var activeSessionLabel: String {
|
||||||
|
let match = self.viewModel.sessions.first { $0.key == self.viewModel.sessionKey }
|
||||||
|
let trimmed = match?.displayName?.trimmingCharacters(in: .whitespacesAndNewlines) ?? ""
|
||||||
|
return trimmed.isEmpty ? self.viewModel.sessionKey : trimmed
|
||||||
|
}
|
||||||
|
|
||||||
private var editorOverlay: some View {
|
private var editorOverlay: some View {
|
||||||
ZStack(alignment: .topLeading) {
|
ZStack(alignment: .topLeading) {
|
||||||
if self.viewModel.input.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty {
|
if self.viewModel.input.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty {
|
||||||
|
|||||||
@@ -43,7 +43,10 @@ export function renderChat(props: ChatProps) {
|
|||||||
props.onSessionKeyChange((e.target as HTMLSelectElement).value)}
|
props.onSessionKeyChange((e.target as HTMLSelectElement).value)}
|
||||||
>
|
>
|
||||||
${sessionOptions.map(
|
${sessionOptions.map(
|
||||||
(entry) => html`<option value=${entry.key}>${entry.key}</option>`,
|
(entry) =>
|
||||||
|
html`<option value=${entry.key}>
|
||||||
|
${entry.displayName ?? entry.key}
|
||||||
|
</option>`,
|
||||||
)}
|
)}
|
||||||
</select>
|
</select>
|
||||||
</label>
|
</label>
|
||||||
@@ -115,6 +118,7 @@ export function renderChat(props: ChatProps) {
|
|||||||
type SessionOption = {
|
type SessionOption = {
|
||||||
key: string;
|
key: string;
|
||||||
updatedAt?: number | null;
|
updatedAt?: number | null;
|
||||||
|
displayName?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
function resolveSessionOptions(
|
function resolveSessionOptions(
|
||||||
|
|||||||
Reference in New Issue
Block a user