feat(fase-12): nav gating + redirect guard + realtime publication

UI side:
  * DesktopSidebar / BottomTabBar filter their entries by $enabledSections,
    tag each entry with data-section, and BottomTabBar exposes a
    data-section-count attribute so the grid is observable from tests.
  * "lists" is force-shown unconditionally — the §12.3.4 always-one-
    landing rule covers the edge case where every layer says OFF.
  * (app)/+layout.svelte adds a $effect that, when the URL matches a
    disabled section (/tasks, /notes, /search), goto's /lists and shows
    a transient `section_disabled_for_collective` toast.
  * Root +layout.svelte exposes the supabase singleton on window.__sb
    in dev so the new Playwright spec can patch rows without a parallel
    client; dead-code-eliminated in production builds.

DB side:
  * Migration 023 grows by ALTER PUBLICATION supabase_realtime ADD TABLE
    public.users + public.collectives + REPLICA IDENTITY FULL on both.
    Without this membership the features.ts subscriptions get zero
    events and SV-02 (collective toggle → realtime → member's nav
    updates) silently fails. Caught while running the spec.
  * pgTAP 015 grows from 16 to 20 assertions to cover publication
    membership + REPLICA IDENTITY for both new realtime tables.

Paraglide messages: section_disabled_for_collective, the visibility
section titles + blurbs, section_label_* per SectionKey. Both en + es.

Playwright tests/e2e/section-visibility.test.ts (SV-01..SV-03):
  SV-01 user toggle → nav reflects → /tasks redirects to /lists
  SV-02 admin collective toggle → member sees it disappear in realtime
  SV-03 collective ON beats user OFF — per-collective resolution

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-18 04:10:19 +02:00
parent 59c425f6f6
commit 286f59225f
9 changed files with 369 additions and 15 deletions

View File

@@ -230,5 +230,15 @@
"settings_tags_section": "Etiquetas",
"settings_tags_empty": "Aún no hay etiquetas — créalas desde cualquier lista.",
"settings_tags_delete": "Eliminar",
"settings_tags_color": "Color"
"settings_tags_color": "Color",
"section_disabled_for_collective": "Esta sección está oculta para este colectivo.",
"settings_section_visibility_title": "Secciones visibles",
"settings_section_visibility_blurb": "Oculta las secciones de nivel superior que no usas. Tu admin también puede ocultarlas para todo el colectivo.",
"settings_section_visibility_overridden": "Oculta por el colectivo.",
"collective_section_visibility_title": "Secciones del colectivo",
"collective_section_visibility_blurb": "Oculta secciones para todos los miembros de este colectivo. Cada miembro también puede ocultarlas para sí.",
"section_label_lists": "Listas",
"section_label_tasks": "Tareas",
"section_label_notes": "Notas",
"section_label_search": "Buscar"
}