Promote active mobile chats immediately and composite a short reveal
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import 'package:flutter/semantics.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
@@ -135,10 +136,6 @@ class _ChatWorkspaceState extends State<ChatWorkspace> {
|
||||
size: constraints.biggest,
|
||||
)
|
||||
: null;
|
||||
final duration =
|
||||
mobile != null && !MediaQuery.disableAnimationsOf(context)
|
||||
? const Duration(milliseconds: 220)
|
||||
: Duration.zero;
|
||||
final existing = panes.map((p) => p.id).toSet();
|
||||
for (final id
|
||||
in _panes.keys.where((id) => !existing.contains(id)).toList()) {
|
||||
@@ -150,9 +147,7 @@ class _ChatWorkspaceState extends State<ChatWorkspace> {
|
||||
clipBehavior: Clip.hardEdge,
|
||||
children: [
|
||||
for (final pane in panes)
|
||||
AnimatedPositioned.fromRect(
|
||||
duration: duration,
|
||||
curve: Curves.easeInOutCubic,
|
||||
Positioned.fromRect(
|
||||
key: ValueKey('chat-workspace-${pane.id}'),
|
||||
rect:
|
||||
mobile?.rects[pane.id] ??
|
||||
@@ -170,6 +165,11 @@ class _ChatWorkspaceState extends State<ChatWorkspace> {
|
||||
pane.id != widget.controller.activePaneId,
|
||||
child: ChatMobilePaneViewport(
|
||||
peek: mobile?.peekId == pane.id,
|
||||
active: pane.id == activeId,
|
||||
animate:
|
||||
mobile != null &&
|
||||
!MediaQuery.disableAnimationsOf(context),
|
||||
contentHeight: mobile?.contentHeight,
|
||||
label: widget.paneTitle?.call(pane) ?? pane.sessionId,
|
||||
paneId: pane.id,
|
||||
onActivate: () {
|
||||
@@ -193,6 +193,9 @@ class _ChatWorkspaceState extends State<ChatWorkspace> {
|
||||
child: Semantics(
|
||||
identifier: 'chat-pane-${pane.id}',
|
||||
container: true,
|
||||
sortKey: mobile == null
|
||||
? null
|
||||
: const OrdinalSortKey(0),
|
||||
child: widget.paneBuilder(
|
||||
context,
|
||||
pane,
|
||||
|
||||
Reference in New Issue
Block a user