feat(webui): polish chat layout and titles

Align the WebUI sidebar and chat chrome with the updated design, and generate WebUI session titles asynchronously without blocking turns.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Xubin Ren
2026-05-06 22:20:35 +08:00
committed by Xubin Ren
co-authored by Cursor
parent d8fd4c80bf
commit 790a03ec28
33 changed files with 1270 additions and 312 deletions
+2
View File
@@ -42,6 +42,7 @@ export async function listSessions(
key: string;
created_at: string | null;
updated_at: string | null;
title?: string;
preview?: string;
};
const body = await request<{ sessions: Row[] }>(
@@ -53,6 +54,7 @@ export async function listSessions(
...splitKey(s.key),
createdAt: s.created_at,
updatedAt: s.updated_at,
title: s.title ?? "",
preview: s.preview ?? "",
}));
}
+2 -2
View File
@@ -185,8 +185,8 @@ export class NanobotClient {
this.knownChats.add(chatId);
const frame: Outbound =
media && media.length > 0
? { type: "message", chat_id: chatId, content, media }
: { type: "message", chat_id: chatId, content };
? { type: "message", chat_id: chatId, content, media, webui: true }
: { type: "message", chat_id: chatId, content, webui: true };
this.queueSend(frame);
}
+5
View File
@@ -56,6 +56,7 @@ export interface ChatSummary {
chatId: string;
createdAt: string | null;
updatedAt: string | null;
title?: string;
preview: string;
}
@@ -125,6 +126,7 @@ export type InboundEvent =
stream_id?: string;
}
| { event: "turn_end"; chat_id: string }
| { event: "session_updated"; chat_id: string }
| { event: "error"; chat_id?: string; detail?: string };
/** Base64-encoded image attached to an outbound ``message`` envelope.
@@ -148,4 +150,7 @@ export type Outbound =
chat_id: string;
content: string;
media?: OutboundMedia[];
/** Marks messages sent by the embedded WebUI, without changing the
* generic websocket protocol for other clients. */
webui?: true;
};