web: compose with Enter, share chat titles, reserve the star
Enter inserts a newline and Ctrl/Cmd+Enter sends; slash commands still run on Enter. Chat renames are stored in the server registry so every device sees the same title, with a one-time upload of old local titles. The star no longer covers the row status, and shell frames patch the background bar in place so the composer stays mounted while streaming.
This commit is contained in:
@@ -40,6 +40,9 @@ const (
|
||||
// only records the finished state, it never detaches a client.
|
||||
ChatClose = "chat_close"
|
||||
ChatReopen = "chat_reopen"
|
||||
// ChatRename records the operator's shared chat title on the server. Unlike
|
||||
// a local override, every browser and device then lists the same name.
|
||||
ChatRename = "chat_rename"
|
||||
// ChatStar records the operator's star on the server, so every browser and
|
||||
// device shows the same starred group. It takes a ChatQuery with SessionID
|
||||
// and Starred, and echoes the updated session like close/reopen.
|
||||
@@ -431,6 +434,13 @@ type ChatFormOption struct {
|
||||
Description string `json:"description,omitempty"`
|
||||
}
|
||||
|
||||
// ChatRenameRequest is the chat_rename body: the session id and the trimmed
|
||||
// shared title. An empty title is refused rather than clearing the name.
|
||||
type ChatRenameRequest struct {
|
||||
SessionID string `json:"session_id"`
|
||||
Title string `json:"title"`
|
||||
}
|
||||
|
||||
// ChatAnswerRequest is the chat_answer body: the form id and a field-keyed
|
||||
// answer object. It is deliberately separate from ChatQuery because its payload
|
||||
// is structured answers, not a session-scoped read.
|
||||
|
||||
@@ -186,6 +186,8 @@ type Message struct {
|
||||
// ChatAnswer is the chat_answer body; the form update arrives through the
|
||||
// normal chat_event stream.
|
||||
ChatAnswer *ChatAnswerRequest `json:"chat_answer,omitempty"`
|
||||
// ChatRename is the chat_rename body; the reply echoes the updated session.
|
||||
ChatRename *ChatRenameRequest `json:"chat_rename,omitempty"`
|
||||
// ChatSubscribe attaches this connection to one session's shared stream; the
|
||||
// body names the session like ChatQuery. A chat_prompt response sets
|
||||
// ChatQueued when the prompt had to wait for an in-flight turn and was
|
||||
|
||||
Reference in New Issue
Block a user