Measure retained peek chrome without constraining its hidden contents

This commit is contained in:
2026-11-07 02:59:42 +00:00
parent 9a065c4963
commit 63bf5b8e75
2 changed files with 59 additions and 28 deletions
@@ -47,29 +47,38 @@ class ChatPaneBarReveal extends StatelessWidget {
final reveal = presentation.barReveal;
final peek = presentation.peek;
// One tree in both roles, so the bar's element outlives a switch.
return AnimatedBuilder(
animation: reveal,
child: IgnorePointer(
ignoring: peek,
child: SizeTransition(
alignment: Alignment.topCenter,
sizeFactor: reveal,
child: FadeTransition(
opacity: reveal,
child: SlideTransition(
position: Tween<Offset>(
begin: const Offset(0, -slide),
end: Offset.zero,
).animate(reveal),
// The bar's own picture holds while it slides; only its offset
// and alpha change per tick.
child: RepaintBoundary(child: bar),
// Overlay slots cap chrome at the pane height. A resting peek can be
// shorter than its retained composer (large text + keyboard). Give only
// chrome its natural height before SizeTransition consumes that height;
// the transcript itself always keeps the real pane constraints.
return Column(
mainAxisSize: MainAxisSize.min,
children: [
AnimatedBuilder(
animation: reveal,
child: IgnorePointer(
ignoring: peek,
child: SizeTransition(
alignment: Alignment.topCenter,
sizeFactor: reveal,
child: FadeTransition(
opacity: reveal,
child: SlideTransition(
position: Tween<Offset>(
begin: const Offset(0, -slide),
end: Offset.zero,
).animate(reveal),
// The bar's own picture holds while it slides; only its offset
// and alpha change per tick.
child: RepaintBoundary(child: bar),
),
),
),
),
builder: (context, child) =>
Offstage(offstage: peek && reveal.value <= 0, child: child),
),
),
builder: (context, child) =>
Offstage(offstage: peek && reveal.value <= 0, child: child),
],
);
}
}