From 947851b4ff09c1a6886191f7774b0b09a9fdb1b2 Mon Sep 17 00:00:00 2001 From: lilleman Date: Mon, 15 Jun 2026 15:57:42 +0200 Subject: [PATCH] =?UTF-8?q?Replace=20placeholder=20index=20with=20the=20ap?= =?UTF-8?q?p-shell=20People=20dashboard=20(todo=20=C2=A71);=20wire=20parse?= =?UTF-8?q?ListQuery/paginate/composeNav=20+=20partials=20into=20a=20real?= =?UTF-8?q?=20zero-JS=20list=20page?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 3 +- src/app.test.ts | 15 ++- src/app.ts | 7 +- src/dashboard.test.ts | 73 ++++++++++++++ src/dashboard.ts | 205 ++++++++++++++++++++++++++++++++++++++ todo.md | 2 +- views/index.ejs | 43 ++++---- views/partials/header.ejs | 6 -- 8 files changed, 322 insertions(+), 32 deletions(-) create mode 100644 src/dashboard.test.ts create mode 100644 src/dashboard.ts delete mode 100644 views/partials/header.ejs diff --git a/README.md b/README.md index 813b789..8be0b8b 100644 --- a/README.md +++ b/README.md @@ -360,12 +360,13 @@ src/jwt.ts JWS signature verify via node:crypto, no jose; claims+JWKS src/cookie.ts Cookie parse + secure Set-Cookie build (session/CSRF cookies, §4) src/context.ts RequestContext handed to handlers + buildContext() src/config.ts Env loader — Ory endpoints, cookie/CSRF secrets, JWKS, port; validated at boot +src/dashboard.ts buildDashboardModel(): the home "/" People list view model (mock data, wires the §1 helpers) src/icons.ts Used-icon registry + sprite builder from lucide-static (regenerates partials/icons.ejs) src/list-query.ts parseListQuery(): read a list URL → { q, filters, sort, page, pageSize } src/nav.ts composeNav(): merge plugin nav fragments + central override, role-filter → nav-tree model src/paginate.ts paginate(total,page,pageSize): page model (counts, row window, ellipsis sequence) for pagination.ejs src/plugin.ts definePlugin() + the host's plugin discovery/router (planned) -views/ Core EJS templates (index, 403/404/500, partials/ incl. app shell, nav tree, filter bar, data table, pagination, form field, auth card, menu/popover, theme switch, icon sprite) +views/ Core EJS templates (index = the app-shell People dashboard, 403/404/500, partials/ incl. app shell, nav tree, filter bar, data table, pagination, form field, auth card, menu/popover, theme switch, icon sprite) public/ Static assets under /public/ (css/styles.css + auth.css, favicon, robots.txt) config/menu.ts Central menu override + branding (planned) plugins/ Drop-in plugin folders, auto-discovered (planned) diff --git a/src/app.test.ts b/src/app.test.ts index 5b5783f..dfc84b5 100644 --- a/src/app.test.ts +++ b/src/app.test.ts @@ -21,11 +21,22 @@ before(async () => { after(() => server.close()); -test("serves the home page as HTML", async () => { +test("serves the home page: the app-shell People dashboard, filterable via the URL", async () => { const res = await fetch(base + "/"); assert.equal(res.status, 200); assert.match(res.headers.get("content-type") ?? "", /text\/html/); - assert.match(await res.text(), /Plainpages/); + const html = await res.text(); + // Shell + building blocks composed around the mock data. + assert.match(html, /Plainpages/); // sidebar brand + assert.match(html, /