Files
pipelines/app/lib/features/chat/stack/chat_stack_actions.dart
T
alan efaa0d9fca Chat stack: groups of open chats, synced with the open-chat set
A chat dropped onto the middle of another makes a named group (asked at
once, "Group N" by default); onto a group it joins, a group dropped onto
a chat takes it in, groups merge. The top level shows each group as a
small pile with its name and count; a tap opens it in place under a
header that leads back (also the scrim, Back and Escape). In a group,
dropping a chat on the header leaves the group; a group of one
dissolves. The close button ungroups a dropped group with Undo. Rename,
Ungroup, Close all (with Undo), Move to group and Remove from group are
in the group menu and as semantic actions.

Each open-chat entry carries its group name (protocol field "group",
omitted when ungrouped; older clients ignore it), stored and pushed by
the server like the order; names are trimmed, printable, at most 80
characters. Needs a server restart to keep groups.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 22:18:44 +00:00

29 lines
962 B
Dart

/// What the chat stack's groups ask of the workspace that hosts them; each
/// change syncs with the open-chat set.
class ChatStackGroupActions {
const ChatStackGroupActions({
required this.join,
required this.leave,
required this.rename,
required this.ungroup,
required this.closeAll,
});
/// Puts [sessionIds] in [group] (making it when new); the open chats then
/// take [order].
final void Function(List<String> sessionIds, String group, List<String> order)
join;
/// Takes [sessionIds] out of their group; the open chats take [order].
final void Function(List<String> sessionIds, List<String> order) leave;
/// Renames a group (a name in use merges the two).
final void Function(String from, String to) rename;
/// Dissolves a group, its chats staying open, with Undo.
final void Function(String group) ungroup;
/// Closes every chat in a group, with Undo.
final void Function(String group) closeAll;
}