Files
pipelines/app/lib/features/chat/ui/sessions/session_pane_menu.dart
T
alan 3ce7f7a5dd Expose pane actions in chat list menu
Share the open chat pane menu choices with session rows so list actions use the same handlers and target the selected chat. Add command routing, pane movement support, and focused coverage for wide and narrow layouts.
2026-11-12 01:17:46 +00:00

42 lines
1.2 KiB
Dart

import 'package:flutter/widgets.dart';
import '../../../../core/api_gateway.dart';
/// The pane More menu's choices that a chat row's menu also offers.
enum SessionPaneAction {
addPane,
openChats,
centerStage,
moveUp,
moveDown,
moveLeft,
moveRight,
closePane,
chatDetails,
files,
runCommand,
openTerminal,
dismissFinished,
}
/// One pane choice as the row's menu shows it: the pane's own label. A
/// disabled choice stays listed, as the pane lists it (a move with no pane
/// across that edge).
typedef SessionPaneChoice = ({
SessionPaneAction action,
String label,
bool enabled,
});
/// The open chat panes, as a chat row's menu reaches them. The offers are read
/// when the menu opens, so they follow the panes as they are then.
abstract interface class SessionPaneMenu {
/// The pane More menu's choices for [session] now, in the pane's order and
/// with its visibility (narrow layouts, one pane, no window or terminal).
List<SessionPaneChoice> choicesFor(BuildContext context, JsonMap session);
/// Runs [action] for [session], opening the chat first where the pane's
/// handler acts on an open chat.
void run(BuildContext context, JsonMap session, SessionPaneAction action);
}