feat(alarma-sonando): restyle ringing screen, drop live countdown label
Replace the glass-card container with a full-bleed blurred-art background, giant heroTime display, 3 fixed snooze tiles (3/5/10 min, one highlighted), and a full-width stop pill. The status label now also renders a static "Subiendo volumen" line - no seconds counter - when the alarm has a configured fade-in, per resolution 4: the native-to-Flutter progress channel a live counter would need is deliberately absent from this architecture. The dismiss guard and force-stop retry banner are untouched: the banner is byte-identical to its pre-restyle form, only repositioned, and the guard test's own diff against main stays empty. size:exception: 530 changed lines (440+/90-) against the 200-300 forecast - lib/ alone is 302 lines, at the edge of the band; the two touched test files account for the rest. Not split further: this is one cohesive restyle to the single screen in this branch where an inconsistent intermediate state is least acceptable.
This commit is contained in:
@@ -11,6 +11,8 @@ import 'package:pluriwave/modelos/emisora.dart';
|
||||
import 'package:pluriwave/pantallas/pantalla_alarma_sonando.dart';
|
||||
import 'package:pluriwave/servicios/servicio_alarmas.dart';
|
||||
import 'package:pluriwave/servicios/servicio_audio.dart';
|
||||
import 'package:pluriwave/tema/pluriwave_theme.dart';
|
||||
import 'package:pluriwave/widgets/pluri_glass_surface.dart';
|
||||
import 'package:pluriwave/widgets/pluri_wave_scaffold.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
@@ -89,9 +91,7 @@ Future<void> _montarPantalla(
|
||||
navigator.push(
|
||||
MaterialPageRoute<void>(
|
||||
builder:
|
||||
(_) => PantallaAlarmaSonando(
|
||||
alarma: estadoAlarmas.alarmas.single,
|
||||
),
|
||||
(_) => PantallaAlarmaSonando(alarma: estadoAlarmas.alarmas.single),
|
||||
fullscreenDialog: true,
|
||||
),
|
||||
),
|
||||
@@ -143,4 +143,38 @@ void main() {
|
||||
expect(find.text(l10n.stopAlarmAction), findsOneWidget);
|
||||
},
|
||||
);
|
||||
|
||||
group('WU11 — restyle a pantalla completa', () {
|
||||
testWidgets(
|
||||
'el tiempo gigante usa PluriWaveTypography.heroTime envuelto en '
|
||||
'FittedBox(scaleDown)',
|
||||
(tester) async {
|
||||
await _montarPantalla(tester);
|
||||
|
||||
final heroFinder = find.byKey(const ValueKey('ringing-hero-time'));
|
||||
expect(heroFinder, findsOneWidget);
|
||||
final texto = tester.widget<Text>(heroFinder);
|
||||
final contexto = tester.element(heroFinder);
|
||||
expect(texto.style, contexto.pluriType.heroTime);
|
||||
expect(
|
||||
find.ancestor(of: heroFinder, matching: find.byType(FittedBox)),
|
||||
findsOneWidget,
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
testWidgets(
|
||||
'el fondo es arte difuminado a pantalla completa; el contenedor '
|
||||
'glass-card anterior desaparece',
|
||||
(tester) async {
|
||||
await _montarPantalla(tester);
|
||||
|
||||
expect(
|
||||
find.byKey(const ValueKey('ringing-background-art')),
|
||||
findsOneWidget,
|
||||
);
|
||||
expect(find.byType(PluriGlassSurface), findsNothing);
|
||||
},
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -107,8 +107,7 @@ Future<_Entorno> _montarPantalla(
|
||||
navigator.push(
|
||||
MaterialPageRoute<void>(
|
||||
builder:
|
||||
(_) =>
|
||||
PantallaAlarmaSonando(alarma: estadoAlarmas.alarmas.single),
|
||||
(_) => PantallaAlarmaSonando(alarma: estadoAlarmas.alarmas.single),
|
||||
fullscreenDialog: true,
|
||||
),
|
||||
),
|
||||
@@ -124,29 +123,153 @@ void main() {
|
||||
SharedPreferences.setMockInitialValues({});
|
||||
});
|
||||
|
||||
testWidgets(
|
||||
'muestra botones de posponer 3/5/10 mas el personalizado (S2-R1-A/C)',
|
||||
(tester) async {
|
||||
await _montarPantalla(tester, snoozeMinutos: 7);
|
||||
group('WU11 — 3 tiles de posponer fijos (3/5/10 min)', () {
|
||||
testWidgets(
|
||||
'siempre son exactamente 3 tiles fijos, incluso con un snoozeMinutos '
|
||||
'personalizado que no es 3/5/10 (S2-R1-A/C, restilizado)',
|
||||
(tester) async {
|
||||
// WU11 correction: the ringing screen's snooze row is no longer a
|
||||
// variable-length Wrap that grows for a custom value — the mockup's
|
||||
// "3 fixed tiles" replaces it. A custom snoozeMinutos (7 here, same
|
||||
// fixture as before WU11) still configures the ALARM's own default
|
||||
// elsewhere (the editor), but no longer grows a 4th tile on this
|
||||
// screen specifically.
|
||||
await _montarPantalla(tester, snoozeMinutos: 7);
|
||||
|
||||
expect(find.text(l10n.alarmSnoozeOptionLabel(3)), findsOneWidget);
|
||||
expect(find.text(l10n.alarmSnoozeOptionLabel(5)), findsOneWidget);
|
||||
expect(find.text(l10n.alarmSnoozeOptionLabel(7)), findsOneWidget);
|
||||
expect(find.text(l10n.alarmSnoozeOptionLabel(10)), findsOneWidget);
|
||||
expect(find.text(l10n.stopAlarmAction), findsOneWidget);
|
||||
},
|
||||
);
|
||||
expect(find.text(l10n.alarmSnoozeOptionLabel(3)), findsOneWidget);
|
||||
expect(find.text(l10n.alarmSnoozeOptionLabel(5)), findsOneWidget);
|
||||
expect(find.text(l10n.alarmSnoozeOptionLabel(10)), findsOneWidget);
|
||||
expect(find.text(l10n.alarmSnoozeOptionLabel(7)), findsNothing);
|
||||
expect(find.text(l10n.stopAlarmAction), findsOneWidget);
|
||||
},
|
||||
);
|
||||
|
||||
testWidgets(
|
||||
'no duplica el boton cuando snoozeMinutos coincide con una opcion fija',
|
||||
(tester) async {
|
||||
await _montarPantalla(tester, snoozeMinutos: 5);
|
||||
testWidgets(
|
||||
'sigue habiendo exactamente 3 tiles cuando snoozeMinutos coincide con '
|
||||
'una opcion fija',
|
||||
(tester) async {
|
||||
await _montarPantalla(tester, snoozeMinutos: 5);
|
||||
|
||||
expect(find.text(l10n.alarmSnoozeOptionLabel(3)), findsOneWidget);
|
||||
expect(find.text(l10n.alarmSnoozeOptionLabel(5)), findsOneWidget);
|
||||
expect(find.text(l10n.alarmSnoozeOptionLabel(10)), findsOneWidget);
|
||||
},
|
||||
);
|
||||
expect(find.text(l10n.alarmSnoozeOptionLabel(3)), findsOneWidget);
|
||||
expect(find.text(l10n.alarmSnoozeOptionLabel(5)), findsOneWidget);
|
||||
expect(find.text(l10n.alarmSnoozeOptionLabel(10)), findsOneWidget);
|
||||
},
|
||||
);
|
||||
|
||||
testWidgets(
|
||||
'el tile que coincide con snoozeMinutos es el destacado (FilledButton); '
|
||||
'los otros dos son OutlinedButton',
|
||||
(tester) async {
|
||||
await _montarPantalla(tester, snoozeMinutos: 5);
|
||||
|
||||
expect(
|
||||
find.ancestor(
|
||||
of: find.text(l10n.alarmSnoozeOptionLabel(5)),
|
||||
matching: find.byType(FilledButton),
|
||||
),
|
||||
findsOneWidget,
|
||||
);
|
||||
expect(
|
||||
find.ancestor(
|
||||
of: find.text(l10n.alarmSnoozeOptionLabel(3)),
|
||||
matching: find.byType(OutlinedButton),
|
||||
),
|
||||
findsOneWidget,
|
||||
);
|
||||
expect(
|
||||
find.ancestor(
|
||||
of: find.text(l10n.alarmSnoozeOptionLabel(10)),
|
||||
matching: find.byType(OutlinedButton),
|
||||
),
|
||||
findsOneWidget,
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
testWidgets(
|
||||
'design decision: cuando snoozeMinutos no es 3/5/10, el destacado '
|
||||
'por defecto es 10 (el valor "habitual" del mockup)',
|
||||
(tester) async {
|
||||
await _montarPantalla(tester, snoozeMinutos: 7);
|
||||
|
||||
expect(
|
||||
find.ancestor(
|
||||
of: find.text(l10n.alarmSnoozeOptionLabel(10)),
|
||||
matching: find.byType(FilledButton),
|
||||
),
|
||||
findsOneWidget,
|
||||
);
|
||||
expect(
|
||||
find.ancestor(
|
||||
of: find.text(l10n.alarmSnoozeOptionLabel(3)),
|
||||
matching: find.byType(OutlinedButton),
|
||||
),
|
||||
findsOneWidget,
|
||||
);
|
||||
expect(
|
||||
find.ancestor(
|
||||
of: find.text(l10n.alarmSnoozeOptionLabel(5)),
|
||||
matching: find.byType(OutlinedButton),
|
||||
),
|
||||
findsOneWidget,
|
||||
);
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
group('WU11 — pildora de Detener a todo lo ancho', () {
|
||||
testWidgets('el boton de Detener ocupa todo el ancho disponible', (
|
||||
tester,
|
||||
) async {
|
||||
await _montarPantalla(tester);
|
||||
|
||||
// The test viewport is 1440 logical px wide (physicalSize / ratio set
|
||||
// in `_montarPantalla`); a normal wrap-content button would be well
|
||||
// under 300px. This is a "clearly full-bleed, not auto-sized"
|
||||
// assertion rather than a pixel-perfect one — the exact horizontal
|
||||
// padding is a cosmetic layout detail, not a contract.
|
||||
final tamano = tester.getSize(
|
||||
find.byKey(const ValueKey('ringing-stop-button')),
|
||||
);
|
||||
expect(tamano.width, greaterThan(1000));
|
||||
});
|
||||
});
|
||||
|
||||
group('WU11 — estado estatico de subida de volumen (resolucion 4, sin '
|
||||
'contador en vivo)', () {
|
||||
testWidgets(
|
||||
'con fadeInSegundos > 0 muestra la etiqueta estatica, sin sufijo '
|
||||
'numerico',
|
||||
(tester) async {
|
||||
await _montarPantalla(tester, fadeInSegundos: 20);
|
||||
|
||||
final texto = tester.widget<Text>(
|
||||
find.descendant(
|
||||
of: find.byKey(const ValueKey('estado-subida-volumen')),
|
||||
matching: find.byType(Text),
|
||||
),
|
||||
);
|
||||
// Exact-equality (not `contains`) is what proves there is no
|
||||
// interpolated/changing suffix at all — `alarmVolumeRisingStatus`
|
||||
// carries no ARB placeholder, so this can never silently grow a
|
||||
// live counter later without a deliberate key change.
|
||||
expect(texto.data, l10n.alarmVolumeRisingStatus);
|
||||
},
|
||||
);
|
||||
|
||||
testWidgets(
|
||||
'con fadeInSegundos == 0 (por defecto) no muestra la etiqueta en '
|
||||
'absoluto',
|
||||
(tester) async {
|
||||
await _montarPantalla(tester);
|
||||
|
||||
expect(
|
||||
find.byKey(const ValueKey('estado-subida-volumen')),
|
||||
findsNothing,
|
||||
);
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
testWidgets(
|
||||
'posponer 5 min pospone la alarma y cierra la pantalla (S2-R1-B)',
|
||||
@@ -196,19 +319,18 @@ void main() {
|
||||
},
|
||||
);
|
||||
|
||||
testWidgets(
|
||||
'detener confirmado no muestra el banner de fallo (SS-3c)',
|
||||
(tester) async {
|
||||
final entorno = await _montarPantalla(tester);
|
||||
testWidgets('detener confirmado no muestra el banner de fallo (SS-3c)', (
|
||||
tester,
|
||||
) async {
|
||||
final entorno = await _montarPantalla(tester);
|
||||
|
||||
await tester.tap(find.text(l10n.stopAlarmAction));
|
||||
await tester.pumpAndSettle();
|
||||
await tester.tap(find.text(l10n.stopAlarmAction));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(find.byType(PantallaAlarmaSonando), findsNothing);
|
||||
expect(find.text(l10n.alarmStopFailedMessage), findsNothing);
|
||||
expect(entorno.android.detencionesActivas, isNotEmpty);
|
||||
},
|
||||
);
|
||||
expect(find.byType(PantallaAlarmaSonando), findsNothing);
|
||||
expect(find.text(l10n.alarmStopFailedMessage), findsNothing);
|
||||
expect(entorno.android.detencionesActivas, isNotEmpty);
|
||||
});
|
||||
|
||||
testWidgets(
|
||||
'forzar detencion: invocacion superpuesta es no-op y tras un fallo '
|
||||
|
||||
Reference in New Issue
Block a user