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.
This commit is contained in:
@@ -56,6 +56,15 @@ mixin _ChatScreenWorkspace on State<ChatScreen> {
|
||||
|
||||
Set<String> _visibleWorkspaceSessions = const {};
|
||||
|
||||
/// Each pane's move targets as the workspace last laid them out. Read when
|
||||
/// the chat list's row menu opens; it needs no rebuild of its own.
|
||||
Map<String, Map<ChatPaneDirection, String>> _paneMoveTargets = const {};
|
||||
void _paneMoveTargetsChanged(
|
||||
Map<String, Map<ChatPaneDirection, String>> targets,
|
||||
) {
|
||||
_paneMoveTargets = targets;
|
||||
}
|
||||
|
||||
void _workspaceVisibilityChanged(Set<String> sessions) {
|
||||
if (!mounted || setEquals(_visibleWorkspaceSessions, sessions)) return;
|
||||
setState(() => _visibleWorkspaceSessions = Set.unmodifiable(sessions));
|
||||
@@ -318,6 +327,7 @@ mixin _ChatScreenWorkspace on State<ChatScreen> {
|
||||
chatColorShade(context, chatSessionColor(_rowFor(pane.sessionId))),
|
||||
controller: _workspace,
|
||||
onVisibleSessionIdsChanged: _workspaceVisibilityChanged,
|
||||
onMoveTargetsChanged: _paneMoveTargetsChanged,
|
||||
shortcutsEnabled: _workspaceVisible,
|
||||
singlePane: !showsListBesideDetail(context),
|
||||
mobilePeeks: true,
|
||||
|
||||
Reference in New Issue
Block a user