4.0 KiB
Proposal: Android Auto Favorite Groups
Intent
The Android Auto browse tree exposes only 3 flat folders (Favoritos, Todas, Mis Emisoras), making stations hard to find while driving. The user asked for favorites grouped by category. This is NOT a new feature: favorite groups already exist end-to-end (GrupoFavoritos model, SQLite grupos_favoritos CRUD, Emisora.grupoFavoritosId, EstadoRadio.gruposFavoritos, and the phone UI _GrupoFavoritosPanel). The only gap is that this categorization was never pushed into the Auto-facing data source. Success = the same grouping the phone already shows becomes reachable in the car, driver-distraction-safe.
Scope
In Scope
- Extend
FuenteEmisorasAuto/actualizarSnapshot()with agruposparameter so favorite groups and their member stations reach the Auto data source. - Wire
EstadoRadioto pushgruposFavoritosinto_fuenteAutoon snapshot updates. - Extend
ConstructorArbolAutoto render favorite groups as sub-folders reachable from the existingFavoritosfolder, with a newgrupo:<id>media-id scheme. - Keep
TodasandMis Emisorasunchanged (conservative reorg). - Flag the empty-group and folder-count car-UX decisions for
sdd-designto resolve.
Out of Scope
- Automatic grouping by pais/idioma/codec (explore Approach 2).
- EQ-from-car (separate
android-auto-eq-presetschange — deliver AFTER this). - Any change to group CRUD, phone UI, or the SQLite schema.
- Android for Cars App Library / custom templates.
Capabilities
New Capabilities
- None.
Modified Capabilities
android-auto-media: browse tree gains favorite-group sub-folders underFavoritosand agrupo:<id>browsable media-id. NOTE: this spec is mid-archive by a concurrent process —sdd-specmust confirm its final location before writing the delta.
Approach
Follow explore Investigation 1, Approach 1 (data-model reuse, not new categorization). Add grupos() + a grupos snapshot field to the Auto data source, mirroring the existing favoritos/misEmisoras/todas seams. ConstructorArbolAuto.raiz() keeps 3 root folders; hijos(idFavoritos) returns group sub-folders; hijos(grupo:<id>) returns that group's stations (reusing the existing sort + 50-item cap). Playable leaves stay emisora:<uuid>. Direct mirror of pantalla_favoritos.dart parity.
Affected Areas
| Area | Impact | Description |
|---|---|---|
lib/servicios/navegacion_auto.dart |
Modified | FuenteEmisorasAuto interface + ConstructorArbolAuto tree/media-ids |
lib/estado/estado_radio.dart |
Modified | Push gruposFavoritos into Auto snapshot |
lib/modelos/grupo_favoritos.dart, lib/servicios/servicio_favoritos.dart |
Read-only reuse | Existing group data/CRUD |
Risks
| Risk | Likelihood | Mitigation |
|---|---|---|
Shared-file merge conflict with android-auto-eq-presets |
Med | Deliver this change FIRST, sequentially |
Path collision with mid-archive android-auto-media specs |
Med | Do not touch those paths; sdd-spec confirms spec location |
| Driver distraction from too many / empty group folders | Med | Defer empty-group + folder-count decision to sdd-design |
| Browse depth increases (root -> group -> stations) | Low | Keep root flat; only Favoritos gains one level |
Rollback Plan
Additive change. Revert the grupos parameter, the EstadoRadio snapshot wiring, and the ConstructorArbolAuto group-folder branch. The pre-existing 3-folder tree is restored; group data in SQLite and phone UI are untouched.
Dependencies
- None external. Depends only on already-shipped group data model (parent
android-auto-mediachange).
Success Criteria
actualizarSnapshot()accepts and stores favorite groups.- Auto browse tree shows one sub-folder per surfaced group under
Favoritos. - Selecting a group folder lists its member stations; selecting a station plays it.
TodasandMis Emisorasbehavior unchanged.- Empty-group and folder-count UX resolved as explicit design decisions.