Lay out chat content against the animated pane viewport
This commit is contained in:
@@ -51,50 +51,53 @@ class ChatMobilePaneViewport extends StatelessWidget {
|
|||||||
super.key,
|
super.key,
|
||||||
required this.peek,
|
required this.peek,
|
||||||
required this.child,
|
required this.child,
|
||||||
required this.height,
|
|
||||||
required this.onActivate,
|
required this.onActivate,
|
||||||
required this.label,
|
required this.label,
|
||||||
required this.paneId,
|
required this.paneId,
|
||||||
});
|
});
|
||||||
final bool peek;
|
final bool peek;
|
||||||
final double height;
|
|
||||||
final Widget child;
|
final Widget child;
|
||||||
final VoidCallback onActivate;
|
final VoidCallback onActivate;
|
||||||
final String label;
|
final String label;
|
||||||
final String paneId;
|
final String paneId;
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) => ClipRect(
|
Widget build(BuildContext context) => LayoutBuilder(
|
||||||
child: Stack(
|
builder: (context, constraints) {
|
||||||
fit: StackFit.expand,
|
final height = constraints.maxHeight;
|
||||||
children: [
|
return ClipRect(
|
||||||
OverflowBox(
|
child: Stack(
|
||||||
alignment: Alignment.topCenter,
|
fit: StackFit.expand,
|
||||||
minHeight: height,
|
children: [
|
||||||
maxHeight: peek ? math.max(height, 300) : height,
|
OverflowBox(
|
||||||
child: SizedBox(
|
alignment: Alignment.topCenter,
|
||||||
height: peek ? math.max(height, 300) : height,
|
minHeight: height,
|
||||||
child: ExcludeFocus(
|
maxHeight: peek ? math.max(height, 300) : height,
|
||||||
excluding: peek,
|
child: SizedBox(
|
||||||
child: ExcludeSemantics(
|
height: peek ? math.max(height, 300) : height,
|
||||||
excluding: peek,
|
child: ExcludeFocus(
|
||||||
child: IgnorePointer(ignoring: peek, child: child),
|
excluding: peek,
|
||||||
|
child: ExcludeSemantics(
|
||||||
|
excluding: peek,
|
||||||
|
child: IgnorePointer(ignoring: peek, child: child),
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
if (peek)
|
||||||
|
Semantics(
|
||||||
|
key: ValueKey('chat-peek-$paneId'),
|
||||||
|
identifier: 'chat-peek-$paneId',
|
||||||
|
container: true,
|
||||||
|
label: 'Expand $label',
|
||||||
|
button: true,
|
||||||
|
child: GestureDetector(
|
||||||
|
behavior: HitTestBehavior.opaque,
|
||||||
|
onTap: onActivate,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
if (peek)
|
);
|
||||||
Semantics(
|
},
|
||||||
key: ValueKey('chat-peek-$paneId'),
|
|
||||||
identifier: 'chat-peek-$paneId',
|
|
||||||
container: true,
|
|
||||||
label: 'Expand $label',
|
|
||||||
button: true,
|
|
||||||
child: GestureDetector(
|
|
||||||
behavior: HitTestBehavior.opaque,
|
|
||||||
onTap: onActivate,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -172,12 +172,6 @@ class _ChatWorkspaceState extends State<ChatWorkspace> {
|
|||||||
peek: mobile?.peekId == pane.id,
|
peek: mobile?.peekId == pane.id,
|
||||||
label: widget.paneTitle?.call(pane) ?? pane.sessionId,
|
label: widget.paneTitle?.call(pane) ?? pane.sessionId,
|
||||||
paneId: pane.id,
|
paneId: pane.id,
|
||||||
height:
|
|
||||||
(mobile?.rects[pane.id] ??
|
|
||||||
(collapsed
|
|
||||||
? Offset.zero & constraints.biggest
|
|
||||||
: geometry.panes[pane.id]!))
|
|
||||||
.height,
|
|
||||||
onActivate: () {
|
onActivate: () {
|
||||||
FocusManager.instance.primaryFocus?.unfocus();
|
FocusManager.instance.primaryFocus?.unfocus();
|
||||||
widget.controller.activate(pane.id);
|
widget.controller.activate(pane.id);
|
||||||
|
|||||||
@@ -11,3 +11,5 @@ A chat first opened on a phone stays in its native full-screen detail route whil
|
|||||||
Checks: bounded analysis clean;7 real-screen split tests passed, including first-phone-split draft/state identity, exactly one initial Back control, large text with300px keyboard inset and desktop/narrow restoration;23 workspace/controller/persistence tests passed, including intermediate animation geometry, reduced motion and three retained panes;10 list-shortcut tests passed. Tests use the memory watchdog.
|
Checks: bounded analysis clean;7 real-screen split tests passed, including first-phone-split draft/state identity, exactly one initial Back control, large text with300px keyboard inset and desktop/narrow restoration;23 workspace/controller/persistence tests passed, including intermediate animation geometry, reduced motion and three retained panes;10 list-shortcut tests passed. Tests use the memory watchdog.
|
||||||
|
|
||||||
Rendered browser evidence: `/private/tmp/mobile-panes-phone-final/` (Material/light560x1000, Add pane, draft retention, real peek taps, no native input focus after a peek switch, unfold880); `/private/tmp/mobile-panes-unfolded-final/` (Cupertino/dark880x1100 hidden sidebar, fold560x1000, switch). All8 final screenshots/contact sheet were inspected; reports have no errors. The phone film contact sheet and10 frame files show the actual220ms transition, including intermediate frames. Test browsers/servers exited. No physical Fold testing, backend change or deployment was performed in this lane.
|
Rendered browser evidence: `/private/tmp/mobile-panes-phone-final/` (Material/light560x1000, Add pane, draft retention, real peek taps, no native input focus after a peek switch, unfold880); `/private/tmp/mobile-panes-unfolded-final/` (Cupertino/dark880x1100 hidden sidebar, fold560x1000, switch). All8 final screenshots/contact sheet were inspected; reports have no errors. The phone film contact sheet and10 frame files show the actual220ms transition, including intermediate frames. Test browsers/servers exited. No physical Fold testing, backend change or deployment was performed in this lane.
|
||||||
|
|
||||||
|
Animation follow-up: each pane now lays out against its actual animated constraints, instead of its target rectangle, so shrinking panes do not leave a transient blank area. Regression assertions compare both thread content heights against intermediate animated viewport heights. Workspace23, direct mobile2 and real-screen7 tests pass; analysis is clean. Updated actual-browser film and screenshots: `/private/tmp/mobile-panes-phone-smooth/`,16frames plus the inspected contact sheet and representative145/245msframes. The native-input no-keyboard check passes again.
|
||||||
|
|||||||
@@ -92,6 +92,17 @@ void main() {
|
|||||||
final intermediate = tester.getSize(_rect(first)).height;
|
final intermediate = tester.getSize(_rect(first)).height;
|
||||||
expect(intermediate, greaterThan(oldHeight));
|
expect(intermediate, greaterThan(oldHeight));
|
||||||
expect(intermediate, lessThan((800 - 6) * .8));
|
expect(intermediate, lessThan((800 - 6) * .8));
|
||||||
|
// Content follows the animated viewport, rather than jumping to the
|
||||||
|
// target height and leaving a blank area during the transition.
|
||||||
|
expect(
|
||||||
|
tester.getSize(find.byKey(const ValueKey('a'))).height,
|
||||||
|
closeTo(intermediate, 1),
|
||||||
|
);
|
||||||
|
final shrinkingHeight = tester.getSize(_rect(second)).height;
|
||||||
|
expect(
|
||||||
|
tester.getSize(find.byKey(const ValueKey('b'))).height,
|
||||||
|
closeTo(shrinkingHeight < 300 ? 300 : shrinkingHeight, 1),
|
||||||
|
);
|
||||||
await tester.pumpAndSettle();
|
await tester.pumpAndSettle();
|
||||||
expect(controller.activePane?.sessionId, 'a');
|
expect(controller.activePane?.sessionId, 'a');
|
||||||
expect(tester.getSize(_rect(first)).height, closeTo((800 - 6) * .8, 1));
|
expect(tester.getSize(_rect(first)).height, closeTo((800 - 6) * .8, 1));
|
||||||
|
|||||||
Reference in New Issue
Block a user