From 301174e750932713483c5f5e541a6a9a181cc401 Mon Sep 17 00:00:00 2001 From: librelad Date: Sat, 30 May 2026 01:04:59 +0100 Subject: [PATCH] docs: record implemented state of the feature-module architecture MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add an Implementation status section: kernel + manifest routing, all pages migrated to feature modules, folder auto-discovery via /api/features/list (supersedes the §3 shell-regen generator), DI seam, and the shared token layer are shipped + verified. God-file decomposition and the base.css/CSS split remain as the large internal refactors still to do. Co-Authored-By: Claude Opus 4.8 Signed-off-by: librelad --- docs/frontend-modularization.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/docs/frontend-modularization.md b/docs/frontend-modularization.md index 42c7a6e..c899597 100644 --- a/docs/frontend-modularization.md +++ b/docs/frontend-modularization.md @@ -1,6 +1,23 @@ # LibrePortal WebUI — Feature-Module Architecture (Design Doc) -**Status:** Proposed · **Audience:** implementing engineer · **Scope:** `containers/libreportal/frontend/` (no-build vanilla-JS SPA) +**Status:** Partially implemented (core architecture shipped 2026-05-29/30) · **Audience:** implementing engineer · **Scope:** `containers/libreportal/frontend/` (no-build vanilla-JS SPA) + +--- + +## 0. Implementation status (2026-05-30) + +**Shipped + verified live (via `lp-shot`):** +- **Kernel + manifest routing** — `kernel/feature-registry.js`, `kernel/lifecycle.js` (MountContext + AbortController/unsub teardown), `kernel/services.js` (DI container). `spa.js` routes from the manifest; legacy `handleX()` kept as fallbacks. +- **All pages are feature modules** — `features/{dashboard,apps,app-detail,admin,backup,tasks}/index.js` with `mount`/`unmount`; admin owns all `/admin/*` sub-routes. +- **Folder auto-discovery** — `GET /api/features/list` (`backend/routes/features.js`) scans `features//feature.json`, mirroring `/api/themes/list`. **This replaces the §3 shell-regen generator** — the Node backend reads its own bind-mounted `/app/frontend`, so the `runFileOp`/regen-staleness/source-array gotchas are moot. Drop a folder → page appears; delete it → gone. (`features/manifest.dev.json` is the static fallback.) +- **DI seam** — `ctx.services` (tasks/live/auth/data/notify/theme/modal/router) injected into every feature; cross-cutting refs in feature modules migrated onto it. +- **Shared token layer** — `shared/css/tokens.css` (`--font-mono`, hoisted `--page-*`). +- Three of the four central registries eliminated (spa.js route Map, index.html script list, manual manifest). Themes were already modular and are untouched. + +**Not yet done (large internal refactors; do NOT assume these are present):** +- **§7 god-file decomposition** (`apps-manager.js` 176KB, `tasks-manager.js` 109KB, `config-shared.js` 62KB, `backup-page.js` 129KB, `system-loader.js` 47KB). The ~80 raw `window.*` globals + the last two registries (system-loader component map, config-manager if-chain) live inside these and retire as part of this work. +- **§5 `base.css`/`shared-ui` extraction + per-feature CSS split.** Note: needs per-theme verification; the screenshot helper only easily renders the default theme. +- **§3.7 esbuild chunker** (was always optional/unproven). ---