From 54fbcc1aed58f05493fb069e81856f51e3830ef9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20R=C3=A1=C5=BE?= Date: Wed, 18 Nov 2026 00:41:47 +0100 Subject: [PATCH] fix(ui): keep content out from under the translucent app bar Both screens put the body behind the app bar for the glass effect, but nothing compensated for its height, so the top of the content was painted under the bar. On Home that hid the folder chips and, with the list's own automatic MediaQuery padding on top, left a dead band above the first chat. In a chat the avatar header and the first day separator were cut by the bar when scrolled to the top. The chips and the conversation now start below the bar (status bar plus toolbar height); the list's automatic padding is off so the gap is not counted twice. Scrolling still passes content under the bar, which is what the glass is for. Measured on the running build: chips 112-160 (bar ends at 104) with the first chat row at 164, and the chat header avatar at 148-208 instead of under the bar. --- lib/pages/chat_page.dart | 8 ++++++++ lib/pages/home_page.dart | 13 +++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/lib/pages/chat_page.dart b/lib/pages/chat_page.dart index 94a300a..9d64851 100644 --- a/lib/pages/chat_page.dart +++ b/lib/pages/chat_page.dart @@ -1227,6 +1227,14 @@ class _ChatPageState extends State { parent: AlwaysScrollableScrollPhysics(), ), slivers: [ + // The body sits behind the translucent app bar, so the conversation + // has to start below it: without this the avatar header and the first + // day separator are painted under the bar. + SliverToBoxAdapter( + child: SizedBox( + height: MediaQuery.viewPaddingOf(context).top + kToolbarHeight, + ), + ), SliverToBoxAdapter( child: hasOlder ? const Padding( diff --git a/lib/pages/home_page.dart b/lib/pages/home_page.dart index c99393e..5951ed3 100644 --- a/lib/pages/home_page.dart +++ b/lib/pages/home_page.dart @@ -399,6 +399,9 @@ class _HomePageState extends State physics: const BouncingScrollPhysics( parent: AlwaysScrollableScrollPhysics(), ), + // The chips already clear the app bar; a scroll view's automatic + // MediaQuery padding would add a second gap above the first row. + padding: EdgeInsets.zero, itemCount: chats.length, itemBuilder: (context, index) { // Indexed access: `Map.entries.elementAt` is O(n) and made the list @@ -543,8 +546,14 @@ class _HomePageState extends State // Messages Column( children: [ - SizedBox(height: 10), - _filterChips(), + // The body sits behind the translucent app bar; the chips do not + // scroll, so they start below it. + Padding( + padding: EdgeInsets.only( + top: MediaQuery.viewPaddingOf(context).top + kToolbarHeight, + ), + child: _filterChips(), + ), // Messages and avatar list Expanded( child: _firstLoad