From 78058368cc989eb6eeff3d59344120ed9de3a337 Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 4 Nov 2026 18:45:55 +0800 Subject: [PATCH] Chat under a title: its top fade 24 deep, not 12 Co-Authored-By: BaoCode --- lib/chat/chat_history_view.dart | 2 +- test/sticky_message_test.dart | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/chat/chat_history_view.dart b/lib/chat/chat_history_view.dart index 8f36405f..25e20e45 100644 --- a/lib/chat/chat_history_view.dart +++ b/lib/chat/chat_history_view.dart @@ -1768,7 +1768,7 @@ class _ChatHistoryViewState extends State /// How deep the list's top fade is: less under a row, which keeps it /// apart from what is above already ([ChatHistoryView.underTitle]). - double get _topFade => widget.underTitle ? 12 : 32; + double get _topFade => widget.underTitle ? 24 : 32; /// Which copies are built is settled after layout, with the items where /// the scroll put them: a frame late, but ready before any scroll brings diff --git a/test/sticky_message_test.dart b/test/sticky_message_test.dart index f809c4f6..56951b71 100644 --- a/test/sticky_message_test.dart +++ b/test/sticky_message_test.dart @@ -210,7 +210,7 @@ void main() { final listMask = tester.widget( find.ancestor(of: listView, matching: find.byType(EdgeFadeMask)), ); - expect(listMask.topFadeLength, 12); + expect(listMask.topFadeLength, 24); double copyFade() => tester .widget( @@ -227,12 +227,12 @@ void main() { ) .topFadeAmount!(); - // Stuck once scrolled past 12 from the top; whole 12 on. - position.jumpTo(6); + // Stuck once scrolled past 12 from the top; whole 24 on. + position.jumpTo(12); await tester.pump(); await tester.pump(); expect(copyFade(), closeTo(0.5, 0.001)); - position.jumpTo(12); + position.jumpTo(24); await tester.pump(); await tester.pump(); expect(copyFade(), 0);