Merge branch 'main' into floating-chats-global

# Conflicts:
#	app/lib/features/chat/workspace/chat_workspace.dart
This commit is contained in:
2026-11-10 15:27:12 +00:00
5 changed files with 173 additions and 60 deletions
@@ -462,39 +462,59 @@ class _ChatWorkspaceState extends State<ChatWorkspace>
required Set<String> edges,
Map<ChatPaneDirection, String>? moveTargets,
FocusNode? focusParent,
}) => KeyedSubtree(
key: _views.putIfAbsent(pane.id, () => GlobalKey(debugLabel: pane.id)),
child: FocusScope(
parentNode: focusParent,
node: _panes.putIfAbsent(
pane.id,
() => FocusScopeNode(debugLabel: pane.id),
),
onFocusChange: (focused) {
if (focused && !mobile) widget.controller.activate(pane.id);
},
child: Listener(
behavior: HitTestBehavior.translucent,
// A press in the peek scrolls or taps; the tap alone activates.
onPointerDown: peek ? null : (_) => widget.controller.activate(pane.id),
child: Semantics(
identifier: 'chat-pane-${pane.id}',
container: true,
sortKey: mobile ? const OrdinalSortKey(0) : null,
child: ChatWorkspacePaneScope(
topEdgeShared: edges.contains('top'),
bottomEdgeShared: edges.contains('bottom'),
leftEdgeShared: edges.contains('left'),
rightEdgeShared: edges.contains('right'),
movable: moveTargets != null,
moveTargets: moveTargets ?? const {},
child: Builder(
builder: (paneContext) =>
widget.paneBuilder(paneContext, pane, active),
}) {
var actionBarPointerDown = false;
bool preservesStageForActionBar() =>
_stage.stage != null && _stage.stage!.stageId != pane.id;
return KeyedSubtree(
key: _views.putIfAbsent(pane.id, () => GlobalKey(debugLabel: pane.id)),
child: FocusScope(
parentNode: focusParent,
node: _panes.putIfAbsent(
pane.id,
() => FocusScopeNode(debugLabel: pane.id),
),
onFocusChange: (focused) {
final inActionBar = ChatWorkspacePaneActionBar.contains(
primaryFocus?.context,
);
if (focused &&
!mobile &&
(!inActionBar || !preservesStageForActionBar())) {
widget.controller.activate(pane.id);
}
},
child: Listener(
behavior: HitTestBehavior.translucent,
// A press in the peek scrolls or taps; the tap alone activates.
onPointerDown: peek
? null
: (_) {
if (!actionBarPointerDown || !preservesStageForActionBar()) {
widget.controller.activate(pane.id);
}
},
child: Semantics(
identifier: 'chat-pane-${pane.id}',
container: true,
sortKey: mobile ? const OrdinalSortKey(0) : null,
child: ChatWorkspacePaneScope(
topEdgeShared: edges.contains('top'),
bottomEdgeShared: edges.contains('bottom'),
leftEdgeShared: edges.contains('left'),
rightEdgeShared: edges.contains('right'),
movable: moveTargets != null,
moveTargets: moveTargets ?? const {},
onActionBarPointerDown: () => actionBarPointerDown = true,
onActionBarPointerUp: () => actionBarPointerDown = false,
child: Builder(
builder: (paneContext) =>
widget.paneBuilder(paneContext, pane, active),
),
),
),
),
),
),
);
);
}
}