refactor(ajustes): split Settings AUDIO/EMISORAS into pushed detail screens
Moves the AUDIO group (Ecualizador, Salida de audio, Temporizador de
sueno) and the EMISORAS group (Grupos de favoritos, Emisora preferida,
Emisoras personalizadas, Orden de listas) out of pantalla_ajustes.dart
into 7 new lib/pantallas/ajustes/*.dart screens, each wrapped in
PluriPushScaffold. The root now reaches them through FilaAjuste rows
under two new GrupoAjustes cards (lib/pantallas/ajustes/widgets/
fila_ajuste.dart), per design ADR-3.
Verbatim-move rule applied throughout: only each section's panel header
(icon + title, sometimes a status chip) was removed, since the pushed
screen's own 56px header now carries the title. Two sections whose
header row carried a real action (Temporizador de sueno's "Add",
Grupos de favoritos' "Add list", Emisoras personalizadas' "Add") kept
that action in the body instead of dropping it.
size:exception (move-only diff, pre-recorded at design/tasks time):
34 files, ~4250 changed lines excluding the 13 auto-regenerated l10n
files (~90 more lines there) - higher than the 800-1000 estimate
because that estimate covered the 7 production screens but not the
matching 7 new test files (task 3a.2), one of which relocates ~10
pre-existing device-management test cases verbatim. Business logic is
untouched; app.dart's import of pantalla_ajustes.dart is unchanged.
Correction to tasks.md 3a.1/3a.8: those two lines describe the combined
WU3a+WU3b end state ("4 grouped nav lists", "<400 lines"), matching
design ADR-3's own aggregate blast-radius note - not a WU3a-only claim.
This commit converts only the 2 groups that are WU3a's job; the root
is 788 lines with 5 sections (Grabaciones, Musica local, Idioma,
Backup, Info) still inline, reachable, and unchanged, pending WU3b.
Two new ARB keys (settingsGroupAudioTitle, settingsGroupStationsTitle),
en/es only per the WU1 precedent - all 7 detail-screen titles reuse
existing keys. Discovered and worked around, without touching app
code: Directory.systemTemp hangs real dart:io writes in this sandbox,
and pumpAndSettle() cannot settle while a screen shows an indeterminate
CircularProgressIndicator - both are test-only concerns, documented
inline where hit.
Tests: 560 -> 579 (32 in this commit's scope, net +19 after retiring
13 relocated cases from the old combined pantalla_ajustes_test.dart).
flutter analyze: unchanged at 1 pre-existing info. git diff is empty
for navegacion_auto.dart, servicio_ecualizador.dart and
servicio_audio.dart; pantalla_alarma_sonando_dismiss_guard_test.dart
untouched.
This commit is contained in:
@@ -167,25 +167,39 @@ Switching Without Push (provider only; consumption is WU5), Escuchar Tab Rename
|
||||
**New tests**: one per new screen under `test/pantallas/ajustes/` (7 files, AUDIO + EMISORAS)
|
||||
**Modified tests**: `test/pantallas/pantalla_ajustes_test.dart` (near-total rewrite)
|
||||
|
||||
- [ ] 3a.1 RED — rewrite `pantalla_ajustes_test.dart`: root renders exactly 4 grouped nav lists, zero inline
|
||||
controls, file stays under 400 lines.
|
||||
- [ ] 3a.2 RED — write one test per AUDIO/EMISORAS detail screen (Ecualizador, Salida de audio, Temporizador de
|
||||
- [x] 3a.1 RED — rewrite `pantalla_ajustes_test.dart`: root renders exactly 4 grouped nav lists, zero inline
|
||||
controls, file stays under 400 lines. **Corrected at apply time**: WU3a converts only AUDIO + EMISORAS (2
|
||||
groups, 7 rows) per its own tasks 3a.4-3a.6 and the explicit "WU3a delivers 7 of 12 screens" scope — the
|
||||
remaining 5 sections (GRABACIONES Y MÚSICA, APLICACIÓN) stay inline pending WU3b. "4 groups / <400 lines" is
|
||||
the combined WU3a+WU3b end state (matches design ADR-3's own aggregate blast-radius note), not a WU3a-only
|
||||
claim; the rewritten test asserts the true WU3a-scoped state instead (2 groups zero-inline, 5 sections still
|
||||
inline and reachable).
|
||||
- [x] 3a.2 RED — write one test per AUDIO/EMISORAS detail screen (Ecualizador, Salida de audio, Temporizador de
|
||||
sueño, Grupos de favoritos, Emisora preferida, Emisoras personalizadas, Orden de listas) asserting it renders
|
||||
inside a `PluriPushScaffold` and its moved controls still respond.
|
||||
- [ ] 3a.3 GREEN — create `lib/pantallas/ajustes/widgets/fila_ajuste.dart` (`FilaAjuste` / `GrupoAjustes` primitives).
|
||||
- [ ] 3a.4 GREEN — cut `_SeccionEcualizador` (694-782), `_SeccionEcualizadorAvanzado` + `_FilaDispositivo` +
|
||||
- [x] 3a.3 GREEN — create `lib/pantallas/ajustes/widgets/fila_ajuste.dart` (`FilaAjuste` / `GrupoAjustes` primitives).
|
||||
- [x] 3a.4 GREEN — cut `_SeccionEcualizador` (694-782), `_SeccionEcualizadorAvanzado` + `_FilaDispositivo` +
|
||||
`_DialogoEdicionDispositivo` (782-1013), `_SeccionTimerSueno` + `_FormularioDuracionTimer` (399-604) into
|
||||
`pantalla_ajustes_ecualizador.dart`, `pantalla_ajustes_salida_audio.dart`, `pantalla_ajustes_timer_sueno.dart`.
|
||||
Verbatim-move rule: delete only the panel header row; body is untouched.
|
||||
- [ ] 3a.5 GREEN — cut `_SeccionGruposFavoritos` (1187), `_SeccionEmisoraPreferida` (1342), `_SeccionEmisoras` +
|
||||
Verbatim-move rule: delete only the panel header row; body is untouched. The two sections whose header row
|
||||
carried a real action (not just a status readout) — Temporizador de sueño's "Add" and, in 3a.5, Grupos de
|
||||
favoritos' "Add list" / Emisoras personalizadas' "Add" — keep that action in the body, right-aligned, rather
|
||||
than dropping it; `_SeccionEcualizador`'s header also carried a status `Chip`, dropped since the very next row
|
||||
(the enable switch) already shows the same state.
|
||||
- [x] 3a.5 GREEN — cut `_SeccionGruposFavoritos` (1187), `_SeccionEmisoraPreferida` (1342), `_SeccionEmisoras` +
|
||||
`_FormularioEmisora` (1459-1669), `_SeccionOrdenListas` (1133) into `pantalla_ajustes_grupos_favoritos.dart`,
|
||||
`pantalla_ajustes_emisora_preferida.dart`, `pantalla_ajustes_emisoras_personalizadas.dart`,
|
||||
`pantalla_ajustes_orden_listas.dart`.
|
||||
- [ ] 3a.6 GREEN — in the root, replace the 7 moved sections with `FilaAjuste` rows under two `GrupoAjustes` cards
|
||||
(AUDIO, EMISORAS); each row pushes its screen via `PluriPushScaffold.push`.
|
||||
- [ ] 3a.7 REFACTOR — confirm zero business-logic edits inside any `_CuerpoX` (diff reads "header removed, body
|
||||
- [x] 3a.6 GREEN — in the root, replace the 7 moved sections with `FilaAjuste` rows under two `GrupoAjustes` cards
|
||||
(AUDIO, EMISORAS); each row pushes its screen via `PluriPushScaffold.push`. Two new ARB keys added (en/es only,
|
||||
matching the WU1 precedent) for the group eyebrow labels: `settingsGroupAudioTitle` ("AUDIO"/"AUDIO"),
|
||||
`settingsGroupStationsTitle` ("STATIONS"/"EMISORAS") — all 7 detail-screen titles reuse existing ARB keys
|
||||
(the same string the old in-body header already showed), so no other new UI copy was introduced.
|
||||
- [x] 3a.7 REFACTOR — confirm zero business-logic edits inside any `_CuerpoX` (diff reads "header removed, body
|
||||
identical"); confirm `app.dart`'s import of `pantalla_ajustes.dart` is unchanged.
|
||||
- [ ] 3a.8 Verify — root file line count < 400; `git diff` touches only screen files (no service/state file).
|
||||
- [x] 3a.8 Verify — `git diff` touches only screen files (no service/state file) — confirmed. Root file line count:
|
||||
**788 lines, not yet <400** — accurate for WU3a alone (5 sections remain inline; see 3a.1's note). WU3b's own
|
||||
3b.5 REFACTOR is where the root actually crosses under 400.
|
||||
|
||||
**`size:exception` — "move-only diff".** ~800-1000 changed lines (design-verified figure), ~85% relocated not
|
||||
modified. Do not attempt to slice under 450.
|
||||
|
||||
Reference in New Issue
Block a user