feat(eq): restyle equalizer screen and add custom presets
Restyle the Ecualizador settings screen to the new visual language while keeping the equalizer at 5 bands (spike-resolved, Engram id 2498 - band count is device-reported via just_audio's AndroidEqualizer, not app-chosen; the approved mockup's 7 sliders would silently no-op on typical hardware). - Restyle EcualizadorWidget in place: strip its internal title + preset chip row (the pushed screen's header now carries the title), add a habilitado parameter that greys/disables every slider when EQ is off. Widen PresetsEcualizadorWidget additively (personalizados param) so custom presets can join the chip row without a second implementation. - Add servicio_presets_personalizados.dart (new file, own SharedPreferences key eq_custom_presets_v1) for custom EQ preset persistence - kept out of servicio_ecualizador.dart, which has an empty-git-diff success criterion for this change. preset_ecualizador.dart is unchanged: a custom preset is just a PresetEcualizador with a user-supplied name. - Extend EstadoEcualizador with presetsPersonalizados, guardarPresetPersonalizado (validates non-empty name), eliminarPresetPersonalizado. The load is a new explicit cargarPresetsPersonalizados(), deliberately NOT folded into cargarPersistido(): that method is exercised ~30 times by estado_ecualizador_test.dart (protected, must stay unmodified) via Fakes only, with no SharedPreferences awareness in that file. - Build out the Ecualizador screen body: base-vs-per-station explainer banner, a "Salida activa" row surfaced on the main screen (previously Advanced-only), an "Emisoras con ajuste propio" drill-down sourced from the existing presetsPorEmisora map, and a "Guardar como preset" action. New coverage lives in new files rather than touching the three protected EQ test files: ecualizador_widget_test.dart (component-level, did not exist before this commit), servicio_presets_personalizados_test.dart, and estado_ecualizador_presets_personalizados_test.dart. servicio_ecualizador.dart, servicio_audio.dart and the three protected EQ test files keep an empty git diff. Full suite: 713/713 green (2 skipped, unchanged), up from 682. size:exception - realized 1,954 changed lines (25 files, plus this docs update) against the 400-550 forecast: lib/ + ARB alone is ~650 lines, near the top of the forecast band by itself since this WU also had to build out a screen body WU3a only stubbed; the rest is 4 test files (675 lines) and 11 new ARB keys regenerating 13 lib/l10n/gen files (~546 lines) - the same pattern every prior work unit in this branch has hit. Not splittable: WU14 reuses this unit's editor component by exact runtime type and cannot begin until this lands as a whole.
This commit is contained in:
@@ -51,7 +51,7 @@
|
||||
| 9 | `feat(vacaciones): add vacation range manager screen` | 8 | 350-450 | Medium | Monitor |
|
||||
| 10 | `feat(alarmas): rewrite alarm editor with inline time widget` | 8 | 500-650 | High | **Yes — indivisible new widget**‡ |
|
||||
| 11 | `feat(alarma-sonando): restyle ringing screen, drop live countdown label` | 1 | 200-300 | Low (safety-critical review attention: High) | No |
|
||||
| 13 | `feat(eq): restyle equalizer screen and add custom presets` | 3a | 400-550 | Medium-High | Monitor |
|
||||
| 13 | `feat(eq): restyle equalizer screen and add custom presets` | 3a | ~~400-550~~ → **REALIZED: 1,871** (1,793+ / 78-, 25 files) | Medium-High | **Yes — retroactive, see WU13 section** |
|
||||
| 14 | `feat(reproductor): restructure full player with tool-tray and EQ sheet` | 13 | 450-600 | Medium-High | Monitor |
|
||||
| 15 | `feat(grabaciones): add recordings library screen` | 3b | ~~300-400~~ → **REALIZED: 1,767** (1,767+ / 0-, 22 files) | Medium | Monitor§ |
|
||||
| 15b | `fix(grabaciones): wire the recordings library into Settings navigation` | 15 | 60-100 | Low | No |
|
||||
@@ -735,32 +735,67 @@ Stations-With-Own-EQ Drill-Down, Base-vs-Per-Station Explainer Preserved, Active
|
||||
> **Hazard, restated: persistence for custom presets must NOT go in `servicio_ecualizador.dart`.** That file has an
|
||||
> empty-`git diff` success criterion.
|
||||
|
||||
- [ ] 13.1 RED — the Ecualizador screen renders exactly **5** vertical sliders (regression guard — reject any
|
||||
future 7-slider change on sight).
|
||||
- [ ] 13.2 RED — `servicio_presets_personalizados_test.dart`: save/list/delete round-trip for a named custom preset
|
||||
- [x] 13.1 RED — the Ecualizador screen renders exactly **5** vertical sliders (regression guard — reject any
|
||||
future 7-slider change on sight). **Corrected at apply time**: named test file `ecualizador_widget_test.dart`
|
||||
did not exist before this commit (`ecualizador_widget.dart` had zero coverage) — created new, plus the
|
||||
screen-level assertion in `pantalla_ajustes_ecualizador_test.dart` (the spec scenario's own GIVEN is "the
|
||||
Ecualizador settings screen").
|
||||
- [x] 13.2 RED — `servicio_presets_personalizados_test.dart`: save/list/delete round-trip for a named custom preset
|
||||
via its **own** SharedPreferences key `eq_custom_presets_v1`.
|
||||
- [ ] 13.3 RED — submitting an empty/whitespace-only preset name shows a validation message and persists nothing.
|
||||
- [ ] 13.4 RED — the "Emisoras con ajuste propio" drill-down lists exactly the stations present in
|
||||
- [x] 13.3 RED — submitting an empty/whitespace-only preset name shows a validation message and persists nothing.
|
||||
Covered at both the state layer (new `estado_ecualizador_presets_personalizados_test.dart` — see 13.7's note)
|
||||
and the UI layer (`pantalla_ajustes_ecualizador_test.dart`'s "Guardar como preset" dialog scenarios).
|
||||
- [x] 13.4 RED — the "Emisoras con ajuste propio" drill-down lists exactly the stations present in
|
||||
`presetsPorEmisora`.
|
||||
- [ ] 13.5 RED — the "Salida activa" row is visible on the main screen (not only Advanced) and updates on a
|
||||
- [x] 13.5 RED — the "Salida activa" row is visible on the main screen (not only Advanced) and updates on a
|
||||
simulated device change; the base-vs-per-station explainer banner is visible.
|
||||
- [ ] 13.6 GREEN — create `lib/servicios/servicio_presets_personalizados.dart` (**new file**, own SharedPreferences
|
||||
- [x] 13.6 GREEN — create `lib/servicios/servicio_presets_personalizados.dart` (**new file**, own SharedPreferences
|
||||
key). **Do NOT add any member to `servicio_ecualizador.dart`.** `lib/modelos/preset_ecualizador.dart` stays
|
||||
unchanged — a user preset is a `PresetEcualizador` with a user-supplied `nombre`; `toJson`/`desdeJson`
|
||||
already exist.
|
||||
- [ ] 13.7 GREEN — extend `EstadoEcualizador` with `presetsPersonalizados`, `guardarPresetPersonalizado(nombre)`,
|
||||
`eliminarPresetPersonalizado(nombre)`, reading/writing only through the new service.
|
||||
- [ ] 13.8 GREEN — restyle `lib/widgets/ecualizador_widget.dart` in place: strip the internal title + preset chip
|
||||
row (lines 59-77 — the pushed header now carries the title), restyle the 5 `Card`/`RotatedBox`/`Slider`
|
||||
tiles to the vertical-track look, add the `habilitado` parameter. Keep the `for (int i = 0; i < 5; i++)`
|
||||
- [x] 13.7 GREEN — extend `EstadoEcualizador` with `presetsPersonalizados`, `guardarPresetPersonalizado(nombre)`,
|
||||
`eliminarPresetPersonalizado(nombre)`, reading/writing only through the new service. **Correction found at
|
||||
apply time**: the new custom-preset LOAD (`cargarPresetsPersonalizados()`) is deliberately NOT folded into
|
||||
`cargarPersistido()` — that method is exercised ~30 times by `estado_ecualizador_test.dart` (one of the three
|
||||
protected EQ test files) via Fakes for `servicio`/`dispositivoAudio` ONLY, with zero SharedPreferences
|
||||
awareness anywhere in that file; adding a third always-real-by-default collaborator to it would have
|
||||
introduced real SharedPreferences I/O into every one of those cases. Called explicitly from the screen's
|
||||
`initState` instead (same pattern `refrescarDispositivoActual` already uses). New coverage lives in a NEW
|
||||
file, `test/estado/estado_ecualizador_presets_personalizados_test.dart` — NOT added to
|
||||
`estado_ecualizador_test.dart`, which stays unmodified.
|
||||
- [x] 13.8 GREEN — restyle `lib/widgets/ecualizador_widget.dart` in place: strip the internal title + preset chip
|
||||
row (re-verified at the CURRENT lines 59-77 of the pre-WU13 file, not trusted from the design doc's
|
||||
reference), restyle the 5 `Card`/`RotatedBox`/`Slider` tiles to the vertical-track look (token-driven accent
|
||||
colour, `AnimatedOpacity` grey-out), add the `habilitado` parameter (disables + greys every slider).
|
||||
`PresetsEcualizadorWidget` additively widened with an optional `personalizados` list (default empty) so
|
||||
custom presets can join the chip row without a second implementation. Kept the `for (int i = 0; i < 5; i++)`
|
||||
loop bound literally `5`.
|
||||
- [ ] 13.9 GREEN — build `lib/pantallas/ajustes/pantalla_ajustes_ecualizador.dart` wiring
|
||||
`EstadoEcualizador.presetPrincipal` / `cambiarPresetPrincipal`, surfacing "Salida activa" and the drill-down
|
||||
row.
|
||||
- [ ] 13.10 REFACTOR — reviewer check: confirm `git diff` is **empty** for `lib/servicios/servicio_ecualizador.dart`,
|
||||
- [x] 13.9 GREEN — build out `lib/pantallas/ajustes/pantalla_ajustes_ecualizador.dart` (the WU3a placeholder body)
|
||||
wiring `EstadoEcualizador.presetPrincipal` / `cambiarPresetPrincipal`, surfacing "Salida activa" (own private
|
||||
row, live via the existing device-change `notifyListeners()`) and the drill-down row (own private row +
|
||||
destination screen, station uuids resolved against `EstadoRadio.listaFavoritos` with a raw-uuid fallback for
|
||||
a non-favorite station). Added the base-vs-per-station explainer banner and the "Guardar como preset" action
|
||||
+ dialog (validates via `guardarPresetPersonalizado`, shows an inline `errorText` on empty/whitespace name).
|
||||
- [x] 13.10 REFACTOR — reviewer check: confirmed `git diff` is **empty** for `lib/servicios/servicio_ecualizador.dart`,
|
||||
`lib/modelos/preset_ecualizador.dart`, and the band-application block at
|
||||
`lib/servicios/servicio_audio.dart:749-762`.
|
||||
- [ ] 13.11 Verify — the three EQ test files pass **unmodified**; exactly 5 sliders render.
|
||||
`lib/servicios/servicio_audio.dart:749-762` (this WU never touches `servicio_audio.dart` at all).
|
||||
- [x] 13.11 Verify — the three EQ test files (`servicio_ecualizador_test.dart`, `estado_ecualizador_test.dart`,
|
||||
`servicio_audio_eq_reapply_test.dart`) pass **unmodified**; exactly 5 sliders render (component AND screen
|
||||
level). Full suite: 713/713 green (2 skipped, unchanged), up from 682. `flutter analyze`: 1 issue, identical
|
||||
to baseline. Literal-encoding scan: zero hits.
|
||||
|
||||
**`size:exception` recorded.** Realized: **1,871 changed lines** (1,793+/78-) across 25 files against the 400-550
|
||||
forecast — same "a strict-TDD commit carries its test files, and any ARB touch drags 13 generated files with it"
|
||||
pattern as every prior WU (Engram `reference/estimating-strict-tdd-diffs`, id 2514). Breakdown: `lib/` production
|
||||
code alone is 628 lines (`pantalla_ajustes_ecualizador.dart` +326, `ecualizador_widget.dart` restyle ~151,
|
||||
`estado_ecualizador.dart` +64, new `servicio_presets_personalizados.dart` +87) plus 22 ARB source lines — at the top
|
||||
edge of the forecast band by itself given this WU also had to build out a screen body WU3a only stubbed; the 4
|
||||
test files (2 new state/service-layer files plus the widget test and the extended screen test) add 675 lines, and
|
||||
11 new ARB keys drag in 546 more via the 13 regenerated `lib/l10n/gen/*.dart` files. Justification: the restyle,
|
||||
the new persistence service, the state-layer extension and the screen wiring (explainer/salida-activa/drill-down/
|
||||
save-flow) are one cohesive vertical slice — WU13 must land as a whole before WU14 can reuse its editor component
|
||||
by exact runtime type; splitting further would leave either an unstyled widget with no screen consumer or a screen
|
||||
half-wired to a service that doesn't exist yet.
|
||||
|
||||
## WU14 — Reproductor completo + per-station EQ sheet
|
||||
|
||||
|
||||
Reference in New Issue
Block a user