From 992e40835af1600a0961ec2454fb78ff43aec3c6 Mon Sep 17 00:00:00 2001 From: Martin Kagamino Lehoux Date: Mon, 7 Sep 2026 22:31:23 +0200 Subject: Add routine archives: archive date, searchable archived list, frozen page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Stamp archived_at on the archived snapshot; copy it on edit - loadArchived(projectId) + collapsible fuzzy-searched "Archivées" section on the project page - Archived routine pages open read-only with the health chart ending at the archive date; edit/complete actions reject archived routines --- src/routes/projects/[id]/+page.server.ts | 3 + src/routes/projects/[id]/+page.svelte | 118 +++++++++++++ .../routine/[routineId]/+page.server.ts | 21 ++- .../[projectId]/routine/[routineId]/+page.svelte | 186 ++++++++++++--------- 4 files changed, 246 insertions(+), 82 deletions(-) (limited to 'src/routes/projects') diff --git a/src/routes/projects/[id]/+page.server.ts b/src/routes/projects/[id]/+page.server.ts index e3c4edf..a23d834 100644 --- a/src/routes/projects/[id]/+page.server.ts +++ b/src/routes/projects/[id]/+page.server.ts @@ -6,6 +6,7 @@ import { archive, complete, loadProjectDashboard, + loadArchived, } from '$lib/server/services/routines'; import { numericId, parseFormString } from '$lib/server/services/validation'; import { parseIntervalToDays } from '$lib/shared/routine-metrics'; @@ -27,10 +28,12 @@ export const load: PageServerLoad = async ({ params }) => { throw error(404, 'Projet introuvable'); } const dashboard = await loadProjectDashboard(id, Date.now()); + const archived = await loadArchived(id); return { project: { id: project.id, name: project.name }, routines: dashboard.routines, healthScore: dashboard.healthScore, + archived, }; }; diff --git a/src/routes/projects/[id]/+page.svelte b/src/routes/projects/[id]/+page.svelte index c69d066..3d1aafe 100644 --- a/src/routes/projects/[id]/+page.svelte +++ b/src/routes/projects/[id]/+page.svelte @@ -1,5 +1,6 @@