Chats: a shared highlight colour per chat, pushed live with star and rename

chat_color {session_id, color|null} stores a palette name (red, orange,
amber, green, teal, blue, purple, pink) on the operator-session row; rows
and replies carry it as color. Colour, star and rename changes are pushed
to every other connection as chat_session_changed.
This commit is contained in:
2026-11-03 10:53:38 +00:00
parent 072688476c
commit a4c191a416
13 changed files with 399 additions and 41 deletions
+6 -2
View File
@@ -127,6 +127,7 @@ type operatorRegistry interface {
CloseOperatorSession(ctx context.Context, sessionID string) error
ReopenOperatorSession(ctx context.Context, sessionID string) error
SetOperatorSessionStar(ctx context.Context, sessionID string, starred bool) error
SetOperatorSessionColor(ctx context.Context, sessionID, color string) error
SetOperatorSessionTitle(ctx context.Context, sessionID, title string) error
SetOperatorSessionBackend(ctx context.Context, sessionID, backend string) error
}
@@ -201,10 +202,13 @@ func handleChat(ctx context.Context, request protocol.Message, broker chatBroker
handleChatReopen(ctx, request, registry, write)
return true
case protocol.ChatStar:
handleChatStar(ctx, request, registry, write)
handleChatStar(ctx, request, registry, hub.changes(), clientID, write)
return true
case protocol.ChatColor:
handleChatColor(ctx, request, registry, hub.changes(), clientID, write)
return true
case protocol.ChatRename:
handleChatRename(ctx, request, registry, write)
handleChatRename(ctx, request, registry, hub.changes(), clientID, write)
return true
case protocol.ChatBackends:
handleChatBackends(request, broker, write)