feat(web): completar Fase 1: pasar userId a TaskItem y renombrar toggle

Co-authored-by: aider (openrouter/openai/gpt-5) <aider@aider.chat>
webui
brobert 2 weeks ago
parent 5b55cdc06b
commit af159c8c8d

@ -1,5 +1,4 @@
<script lang="ts">
import Badge from "$lib/ui/atoms/Badge.svelte";
import {
compareYmd,
todayYmdUTC,
@ -268,7 +267,7 @@
>
{/if}
<button
class="icon-btn"
class="btn primary"
aria-label="Completar"
title="Completar"
on:click|preventDefault={doComplete}

@ -1,6 +1,7 @@
import type { PageServerLoad } from './$types';
export const load: PageServerLoad = async (event) => {
const userId = event.locals.userId ?? null;
const res = await event.fetch('/api/me/groups', { headers: { 'cache-control': 'no-store' } });
if (!res.ok) {
// El gate del layout debería impedir llegar aquí sin sesión; devolvemos vacío como salvaguarda.
@ -30,5 +31,5 @@ export const load: PageServerLoad = async (event) => {
}
}
return { groups, itemsByGroup, unassignedFirst };
return { groups, itemsByGroup, unassignedFirst, userId };
};

@ -16,7 +16,7 @@
assignees?: string[];
};
export let data: { groups: GroupItem[]; itemsByGroup: Record<string, Task[]>; unassignedFirst?: boolean };
export let data: { userId: string | null; groups: GroupItem[]; itemsByGroup: Record<string, Task[]>; unassignedFirst?: boolean };
const groups = data.groups || [];
const itemsByGroup = data.itemsByGroup || {};
@ -48,7 +48,7 @@
location.href = q ? `/app/groups?${q}` : `/app/groups`;
}}
/>
Unassigned first
Sin responsable primero
</label>
</div>
@ -70,7 +70,7 @@
due_date={t.due_date}
display_code={t.display_code}
assignees={t.assignees || []}
currentUserId={null}
currentUserId={data.userId}
groupName={g.name ?? g.id}
/>
{/each}

@ -50,7 +50,7 @@ Archivos que solicitaremos añadir al chat cuando toque editar
- Tests: tests/web/* y tests/unit/* (para cubrir uncomplete y cambios de gating).
- (Opcional) Migraciones: src/db/migrations/* si llegamos a necesitar created_by en gating de PATCH.
Fase 1 — UX base en páginas y TaskItem (sin backend nuevo)
Fase 1 — UX base en páginas y TaskItem (sin backend nuevo) — Estado: Completada
Objetivos
- /app: añadir sección “Sin responsable de mis grupos”, quitar búsqueda, añadir conmutador de orden (Fecha | Grupo).
- /app/groups: mostrar TODAS las tareas por grupo en secciones expandibles/colapsables; toggle “Unassigned first”.

Loading…
Cancel
Save