From 261b44522d4c9ebe7276d79918b517d51252ff73 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Mon, 11 May 2026 20:27:54 -0400 Subject: [PATCH] =?UTF-8?q?fix(flutter):=20bump=20album-grid=20cellH=20sla?= =?UTF-8?q?ck=20=E2=80=94=20silence=201px=20overflow=20warnings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Logs were spitting "RenderFlex overflowed by 1.00 pixels on the bottom" from album_card.dart whenever the library Albums tab or artist detail album grid rendered. Cell height was computed as cover + gap + title + artist + 4px slack, which assumes pixel-perfect 14sp/12sp line heights — Flutter's actual rendering with ascent/ descent + line-height multipliers wants one more pixel. Bump slack from 4 to 8 in both grids. AlbumCard layout unchanged; the warnings stop. Otherwise the log shape is healthy now: prefetcher fires once per library page emit (expected, one batch per pagination), cache misses fetch sequentially with clean drift-write → re-emit cycles, and album taps are single-round-trip cold-fetches followed by drift hits. No more cycles of duplicate fetches. --- flutter_client/lib/library/artist_detail_screen.dart | 7 ++++--- flutter_client/lib/library/library_screen.dart | 7 +++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/flutter_client/lib/library/artist_detail_screen.dart b/flutter_client/lib/library/artist_detail_screen.dart index 784776f1..3f624418 100644 --- a/flutter_client/lib/library/artist_detail_screen.dart +++ b/flutter_client/lib/library/artist_detail_screen.dart @@ -141,10 +141,11 @@ class ArtistDetailScreen extends ConsumerWidget { (constraints.maxWidth - sidePad * 2 - gap * (cols - 1)) / cols; // Card content: cover (cellW - 16) + 8 + title (≤2 lines - // ≈ 36) + small fudge. Artist line is suppressed in this + // ≈ 36) + slack. Artist line is suppressed in this // grid (showArtist: false) since the page header already - // names the artist. - final cellH = (cellW - 16) + 8 + 36 + 4; + // names the artist. Slack is generous on purpose — line- + // height variations would otherwise overflow by 1px. + final cellH = (cellW - 16) + 8 + 36 + 8; return GridView.builder( shrinkWrap: true, physics: const NeverScrollableScrollPhysics(), diff --git a/flutter_client/lib/library/library_screen.dart b/flutter_client/lib/library/library_screen.dart index 80b4a762..b3e85380 100644 --- a/flutter_client/lib/library/library_screen.dart +++ b/flutter_client/lib/library/library_screen.dart @@ -288,8 +288,11 @@ class _AlbumsTab extends ConsumerWidget { gap * (cols - 1)) / cols; // cover (cellW - 16) + gap (8) + 2-line title (~36) - // + artist line (~16) + small fudge. - final cellH = (cellW - 16) + 8 + 36 + 16 + 4; + // + artist line (~16) + slack. Slack is generous on + // purpose — line-height + font scaling variations + // would otherwise overflow the cell by a pixel + // (logged as a noisy RenderFlex warning). + final cellH = (cellW - 16) + 8 + 36 + 16 + 8; return NotificationListener( onNotification: (n) { if (n.metrics.pixels >=