From bdc040636a50ea34d6ba2af750d0c254623504ba Mon Sep 17 00:00:00 2001 From: agent Date: Tue, 27 Oct 2026 08:54:57 +0000 Subject: [PATCH 1/9] Admin: dashboard at / with income and hours; Site design 2x2 grid The dashboard shows income (paid orders, by the month they were paid), hours worked and still booked this month, the next 7 days' bookings and a 12-month table. Booked time is counted with overlaps merged, so a group session is one hour of work however many people booked it. Login and the sidebar title now land on the dashboard. Site design: four cards in a three-column grid left Style alone under Header. Two columns on xl (Header|Footer, Colors|Style) and all four side by side from 2xl. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01HA82gV9YDZk1XhjJ5LtyAt --- AGENTS.md | 5 +- app-admin/src/hooks.server.ts | 2 +- app-admin/src/lib/server/dashboard.ts | 130 +++++++++++++++++++++ app-admin/src/routes/+layout.svelte | 8 +- app-admin/src/routes/+page.server.ts | 7 ++ app-admin/src/routes/+page.svelte | 94 +++++++++++++++ app-admin/src/routes/globals/+page.svelte | 2 +- app-admin/src/routes/login/+page.server.ts | 56 ++++----- 8 files changed, 270 insertions(+), 34 deletions(-) create mode 100644 app-admin/src/lib/server/dashboard.ts create mode 100644 app-admin/src/routes/+page.server.ts create mode 100644 app-admin/src/routes/+page.svelte diff --git a/AGENTS.md b/AGENTS.md index 9b8dd04..1327b08 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -25,6 +25,7 @@ app-admin/ # SvelteKit admin app (serves admin.) │ │ └── server/ # Re-exports from $shared/server + admin helpers (actions.ts, pages.ts, slots.ts) │ ├── routes/ │ │ ├── +layout.svelte # Root layout (admin shell: grouped sidebar; bare on /login and /preview) +│ │ ├── +page.svelte # Dashboard (income, hours worked/booked, coming up); figures from $lib/server/dashboard.ts. Login lands here │ │ ├── login/ # Admin login │ │ ├── pages/ # Page CRUD + block editor │ │ ├── calendar/ # Event CRUD (menu label: Events) @@ -143,12 +144,12 @@ To add an email block type: add to `EmailBlockType` in `packages/shared/src/type ### Styling - **Public site**: Custom theme via `@theme` in `app.css` — colors: `warm`, `charcoal`, `sage`, `sage-dark`, `terracotta`. Fonts: `font-sans` (body), `font-serif` (headings), chosen in Site design → Style (default DM Sans / Playfair Display). - **Site design → Style** (`style` global: fonts, corners, text size, shadows, page width) becomes `--site-*` variables (`siteStyleVars` in `$shared/theme`) that the `@theme` tokens in both `app.css` files scale. So in public-site markup use the tokens — `rounded-xl`/`rounded-2xl`/`rounded-card`/`rounded-panel`, `shadow-sm`…`shadow-xl`, `max-w-3xl`/`6xl`/`7xl` — never `rounded-[2rem]` or an arbitrary `shadow-[…]`, which ignore the settings. Buttons, chips and icon buttons are `rounded-button` (a pill when Round, square when Sharp); only dots, avatars and badges stay `rounded-full`. - - Keep scrolling smooth: no `backdrop-blur` on public pages (it is redrawn on every scrolled frame; use a nearly solid background), and keep animations short. The `.reveal` / `.animate-fade-in` animations are switched off for people who ask for reduced motion and, by `scrollReveal.ts`, on devices that stutter (`plain-motion` on ``, rules in both `app.css` files). + - Keep scrolling smooth: no `backdrop-blur` on public pages (it is redrawn on every scrolled frame; use a nearly solid background), and keep animations short. The `.reveal` / `.animate-fade-in` animations are switched off for people who ask for reduced motion and, by `scrollReveal.ts`, on devices that stutter (`plain-motion` on ``, rules in both `app.css` files). - Fonts are bundled `@fontsource-variable/*` packages, imported in each app's `src/lib/fonts.ts` and listed in `SITE_FONTS`; a new one goes in all three places. - **Admin area**: DaisyUI **5** (no `form-control` / `label-text` / `*-bordered` — those are v4). Colours come from Site design via `$shared/theme`, rendered as a `