Fase 2b closes the critical-path product differentiator. Two sessions on the
same list see each other's changes in real time, mutations survive network
drops and sync when reconnected, and a dedicated full-screen shopping view
optimises the in-store experience.
2b.1 Realtime
- `$lib/stores/realtimeSync.ts` wraps `postgres_changes` with an `applyItemEvent`
reducer (INSERT/UPDATE/DELETE → next items[]) and a `subscribeToList` helper
that awaits the SUBSCRIBED handshake before returning
- `/lists/[id]` subscribes in onMount, unsubscribes in onDestroy. Uses a
`pendingTempIds` set to deduplicate own-mutation echoes against optimistic
rows (matches by name+created_by+sort_order)
- Client-generated UUIDs for new inserts make the path idempotent: if the
server response is lost and we retry, the second POST hits PK-conflict
which the queue treats as success
- CHECKED section div now carries role="listitem" so Playwright locators
follow the item across sections
2b.2 Offline queue
- `$lib/sync/queue.ts` — SyncQueue class backed by IndexedDB (idb), FIFO flush,
MAX_ATTEMPTS=5 retry budget, PK-conflict-as-success short-circuit
- `$lib/sync/index.ts` — app-wide singleton, window.online listener flushes
automatically, hydrateSyncState() at page load restores pendingOpsCount
- `$lib/stores/syncStatus.ts` — derived store (offline | syncing | synced)
tracking navigator.onLine + queue depth
- SyncBanner component renders the offline/syncing indicator in the detail
and session views
- handleAdd enqueues on failure instead of reverting, so an offline mutation
keeps its optimistic row and syncs on reconnect
2b.3 Modo Compra
- `/lists/[id]/session/+page.svelte` — full-screen overlay (fixed inset-0
z-50) that covers the sidebar while keeping the normal auth routing.
56×56 toggles, flip animation shuffling items between TO BUY / CHECKED,
Finish Shopping confirmation modal → completeList → goto('/lists')
- Link from `/lists/[id]` header (data-testid=start-session) with the
new `list_start_session` message
Testing infra
- apps/web gets its own Vitest config (jsdom + fake-indexeddb/auto) and a
new `pnpm test:unit` script. `just test-all` now chains pgTAP → integration
→ unit → e2e so a single command is the gate.
- packages/test-utils/tests/sync-queue.test.ts (placeholder scaffold) removed —
replaced by `apps/web/src/lib/sync/queue.test.ts` co-located with the module
Totals: 103 tests green
16 pgTAP
59 Vitest integration (in packages/test-utils)
6 Vitest unit (in apps/web — the SyncQueue)
22 Playwright E2E (5 auth + 4 lists + 6 items + 2 realtime + 2 offline + 3 session)
2 skipped (realtime-presence — upstream bug, unchanged)
Documented in plan/fase-2b and CLAUDE.md.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
116 lines
4.7 KiB
JSON
116 lines
4.7 KiB
JSON
{
|
|
"$schema": "https://inlang.com/schema/inlang-message-format",
|
|
"nav_lists": "Listas",
|
|
"nav_tasks": "Tareas",
|
|
"nav_notes": "Notas",
|
|
"nav_search": "Buscar",
|
|
"nav_settings": "Ajustes",
|
|
"nav_collective": "Colectivo",
|
|
"app_name": "Colectivo",
|
|
"loading": "Cargando…",
|
|
"error_generic": "Algo salió mal. Por favor, inténtalo de nuevo.",
|
|
"login_title": "Accede a Colectivo",
|
|
"login_button": "Iniciar sesión",
|
|
"logout_button": "Cerrar sesión",
|
|
"auth_back_to_home": "Volver al inicio",
|
|
"onboarding_title": "Bienvenido a Colectivo",
|
|
"onboarding_subtitle": "Crea un nuevo colectivo o únete a uno existente.",
|
|
"onboarding_create_tab": "Crear",
|
|
"onboarding_join_tab": "Unirse",
|
|
"onboarding_create_collective": "Crear un colectivo",
|
|
"onboarding_join_collective": "Unirme con un enlace de invitación",
|
|
"onboarding_collective_name": "Nombre del colectivo",
|
|
"onboarding_collective_name_placeholder": "p. ej. Nuestro Hogar",
|
|
"onboarding_collective_emoji": "Icono",
|
|
"onboarding_invite_link_label": "Enlace de invitación",
|
|
"onboarding_invite_link_placeholder": "Pega aquí el enlace de invitación…",
|
|
"onboarding_create_btn": "Crear colectivo",
|
|
"onboarding_join_btn": "Unirse al colectivo",
|
|
"collective_name_label": "Nombre del colectivo",
|
|
"collective_name_placeholder": "p. ej. Nuestro Hogar",
|
|
"invitation_title": "Tienes una invitación",
|
|
"invitation_subtitle": "Te han invitado a unirte a un colectivo.",
|
|
"invitation_accept_btn": "Aceptar invitación",
|
|
"invitation_success": "¡Te has unido al colectivo!",
|
|
"invitation_invalid_link": "Ese no parece un enlace de invitación válido.",
|
|
"invitation_error_not_found": "Este enlace de invitación no es válido.",
|
|
"invitation_error_already_used": "Esta invitación ya ha sido utilizada.",
|
|
"invitation_error_expired": "Esta invitación ha caducado.",
|
|
"invitation_error_already_member": "Ya eres miembro de este colectivo.",
|
|
"invitation_error_unauthenticated": "Debes iniciar sesión para aceptar una invitación.",
|
|
"invitation_error_unknown": "Algo salió mal. Por favor, inténtalo de nuevo.",
|
|
"manage_title": "Gestionar colectivo",
|
|
"manage_members": "Miembros",
|
|
"manage_you": "tú",
|
|
"manage_remove": "Eliminar miembro",
|
|
"manage_invite_title": "Invitar a alguien",
|
|
"manage_invite_role": "Rol",
|
|
"manage_generate_link": "Generar enlace de invitación",
|
|
"manage_copy": "Copiar",
|
|
"manage_copied": "¡Copiado!",
|
|
"manage_link_expires": "El enlace caduca en 7 días.",
|
|
"role_admin": "Administrador",
|
|
"role_member": "Miembro",
|
|
"role_guest": "Invitado",
|
|
"settings_title": "Ajustes",
|
|
"settings_display_name": "Nombre visible",
|
|
"settings_saving": "Guardando…",
|
|
"settings_language": "Idioma",
|
|
"settings_avatar": "Avatar",
|
|
"settings_avatar_initials": "Iniciales",
|
|
"settings_avatar_emoji": "Emoji",
|
|
"settings_avatar_upload": "Foto",
|
|
"settings_avatar_upload_btn": "Subir foto…",
|
|
"settings_account": "Cuenta",
|
|
"settings_keycloak_link": "Cambiar correo o contraseña",
|
|
"settings_logout": "Cerrar sesión",
|
|
"settings_save": "Guardar cambios",
|
|
"settings_saved": "Cambios guardados",
|
|
"invite_member": "Invitar miembro",
|
|
"invite_email_label": "Correo electrónico",
|
|
"invite_send": "Enviar invitación",
|
|
"lists_title": "Listas de la compra",
|
|
"lists_new_list": "Crear",
|
|
"lists_no_lists": "Sin listas",
|
|
"lists_create_first": "Crea tu primera lista de la compra",
|
|
"lists_trash": "Papelera",
|
|
"list_status_active": "Lista activa",
|
|
"list_status_completed": "Completada",
|
|
"list_status_archived": "Archivada",
|
|
"list_name_placeholder": "p. ej. Compra semanal",
|
|
"list_items_empty": "Lista vacía",
|
|
"list_items_empty_hint": "Añade tu primer producto abajo",
|
|
"list_reset": "Reiniciar lista",
|
|
"list_archive": "Archivar",
|
|
"list_delete": "Mover a papelera",
|
|
"list_actions": "Acciones de lista",
|
|
"list_item_placeholder": "Añadir producto…",
|
|
"list_qty_label": "Cant.",
|
|
"list_unit_label": "Unidad",
|
|
"list_add_item": "Añadir producto…",
|
|
"list_to_buy": "Por comprar",
|
|
"list_checked": "Marcado",
|
|
"list_start_session": "Comprar",
|
|
"list_finish_shopping": "Terminar compra",
|
|
"list_finish_confirm": "¿Marcar esta lista como completada?",
|
|
"list_finish_confirm_yes": "Sí, terminar",
|
|
"list_finish_confirm_no": "Seguir comprando",
|
|
"tasks_title": "Tareas",
|
|
"notes_title": "Notas",
|
|
"search_title": "Buscar",
|
|
"search_placeholder": "Busca listas, tareas, notas…",
|
|
"trash_restore": "Restaurar",
|
|
"trash_delete_permanent": "Eliminar definitivamente",
|
|
"trash_empty": "La papelera está vacía",
|
|
"trash_expires_in": "Expira en {days} días",
|
|
"confirm_delete": "¿Eliminar?",
|
|
"cancel": "Cancelar",
|
|
"save": "Guardar",
|
|
"action_delete": "Eliminar",
|
|
"edit": "Editar",
|
|
"add": "Añadir",
|
|
"done": "Listo",
|
|
"sync_offline": "Sin conexión — los cambios se sincronizarán al reconectar",
|
|
"sync_syncing": "Sincronizando…"
|
|
}
|