From cd77ec256ec2c1294ab6be6ccb4c70e1ecd05c77 Mon Sep 17 00:00:00 2001 From: freetlab Date: Wed, 29 Jul 2026 23:04:40 +0200 Subject: [PATCH] fix(escuchar): restore the prototype's 132px hero artwork Audit 1.3: the hero art shipped at 84 where the prototype draws 132 (t4 line 56), with a 24 corner radius rather than the shared radiusMd. Adds a dimension guard. Every existing test on this screen asserts behaviour only, which is why an artwork 36% too small went unnoticed. --- lib/pantallas/pantalla_inicio.dart | 7 ++-- test/pantallas/pantalla_inicio_test.dart | 42 ++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 2 deletions(-) diff --git a/lib/pantallas/pantalla_inicio.dart b/lib/pantallas/pantalla_inicio.dart index 679a315..2e490a1 100644 --- a/lib/pantallas/pantalla_inicio.dart +++ b/lib/pantallas/pantalla_inicio.dart @@ -307,12 +307,15 @@ class _ArteEscuchar extends StatelessWidget { final Emisora emisora; - static const _lado = 84.0; + /// Audit 1.3: the prototype's Escuchar hero art is 132 (t4 line 56), and + /// its corner radius is 24 rather than the shared `radiusMd`. + static const _lado = 132.0; + static const _radio = 24.0; @override Widget build(BuildContext context) { final theme = Theme.of(context); - final radius = BorderRadius.circular(context.pluriTokens.radiusMd); + final radius = BorderRadius.circular(_radio); return PluriGlassSurface( padding: EdgeInsets.zero, borderRadius: radius, diff --git a/test/pantallas/pantalla_inicio_test.dart b/test/pantallas/pantalla_inicio_test.dart index 2eb0558..3fa054f 100644 --- a/test/pantallas/pantalla_inicio_test.dart +++ b/test/pantallas/pantalla_inicio_test.dart @@ -122,6 +122,48 @@ void main() { reason: 'switches tabs — must NOT push a new route', ); }); + + testWidgets('visual fidelity (audit 1.3): the hero art is 132 square', ( + tester, + ) async { + // The redesign shipped this at 84 — the prototype draws 132 (t4 line + // 56). Nothing caught it because every existing test here asserts + // behaviour, never dimensions. This is the guard that would have. + _setLargeSurfaceSize(tester); + final favoritos = FakeServicioFavoritos(); + final estado = EstadoRadio( + audio: FakeServicioAudio(), + favoritos: favoritos, + radio: FakeServicioRadio(), + servicioEcualizador: FakeServicioEcualizador(), + servicioGrabacion: FakeServicioGrabacionRadio(), + resolverArchivoCustom: _archivoCustomVacio, + iniciarAutomaticamente: false, + ); + addTearDown(estado.dispose); + await tester.runAsync(estado.inicializar); + final sonando = emisoraDemo(uuid: 'f1', nombre: 'Favorita Uno'); + await favoritos.agregar(sonando); + await estado.cargarFavoritos(); + // The hero only renders when a station is active — `emisoraActual` is + // what gates it. Without this the assertion below passes vacuously. + await tester.runAsync(() => estado.reproducir(sonando)); + + await tester.pumpWidget( + _conProviders(estado, _testApp(const PantallaInicio())), + ); + await _pumpBounded(tester); + + final cuadrados = tester + .widgetList(find.byType(SizedBox)) + .where((s) => s.width == 132 && s.height == 132); + + expect( + cuadrados, + isNotEmpty, + reason: 'prototype t4 line 56 sizes the Escuchar hero artwork at 132', + ); + }); } /// Mirrors the app.dart wiring: EstadoRadio owns the domain notifiers and