chore(web): library-admin inline script moves to admin.ts; rendering guardrail

The library admin page carried an inline <script> block of global
functions (toggleLibraryPanel, openEditModal, openDeleteModal,
openFolderBrowser plus the delete-modal close listener). They move into
the admin Alpine component as typed methods; the page body gains
x-data="admin" and the call sites switch onclick= -> @click.
Behavior unchanged.

Guardrail: make lint-rendering (wired into make test) fails when a
web/src file builds more HTML template literals than its recorded
baseline (web/src/rendering-allowlist.txt, seeded at 18 sites across 9
files post-twin-deletion) or when a .templ file gains an inline script
block. theme_flash_guard.templ is the only sanctioned inline script;
web/src/reader is a sanctioned island.

theme.ts: Array.from(classList) — DOMTokenList spread needs
lib.dom.iterable, which the tsconfig does not include.
This commit is contained in:
John O'Keefe committed 2026-10-18 12:28:50 -04:00
1 parent f1844591b4
commit 506a04b55d
6 files changed
+164 -94

No files matched your search

+1 -1
View File
@@ -52,7 +52,7 @@ const TOKEN_STORAGE_KEY = "token";
// auth pages survive a theme change.
const applyTheme = (theme: string): void => {
const setThemeClass = (el: Element): void => {
[...el.classList].forEach((c) => {
Array.from(el.classList).forEach((c) => {
if (c.startsWith("theme-")) el.classList.remove(c);
});
el.classList.add(`theme-${theme}`);