Dispose pane focus animation resources and record measured switching improvements

This commit is contained in:
2026-11-06 22:21:31 +00:00
parent 8473b24d1b
commit a4f6c5473c
2 changed files with 44 additions and 11 deletions
@@ -43,8 +43,8 @@ class ChatMobilePanes {
String? peekId;
}
/// Both mobile threads retain the same full content layout. Only the cheap
/// viewport clip and position change during a switch; transcript layout, scroll
/// Both mobile threads retain the same full content layout. Selection changes
/// positions once; only a tiny focus cue animates, so transcript layout, scroll
/// anchoring and backdrop painting do not repeat on every animation tick.
class ChatMobilePaneViewport extends StatefulWidget {
const ChatMobilePaneViewport({
@@ -72,15 +72,19 @@ class ChatMobilePaneViewport extends StatefulWidget {
class _ChatMobilePaneViewportState extends State<ChatMobilePaneViewport>
with SingleTickerProviderStateMixin {
late final AnimationController _reveal = AnimationController(
vsync: this,
duration: const Duration(milliseconds: 120),
value: 1,
);
late final Animation<double> _accent = CurvedAnimation(
parent: _reveal,
curve: Curves.easeOutCubic,
);
late final AnimationController _reveal;
late final CurvedAnimation _accent;
@override
void initState() {
super.initState();
_reveal = AnimationController(
vsync: this,
duration: const Duration(milliseconds: 120),
value: 1,
);
_accent = CurvedAnimation(parent: _reveal, curve: Curves.easeOutCubic);
}
@override
void didUpdateWidget(covariant ChatMobilePaneViewport oldWidget) {
super.didUpdateWidget(oldWidget);
@@ -93,6 +97,7 @@ class _ChatMobilePaneViewportState extends State<ChatMobilePaneViewport>
@override
void dispose() {
_accent.dispose();
_reveal.dispose();
super.dispose();
}