ZDDC/shared
ZDDC 4dfbc44d45 feat(elevation): on-page admin-mode toggle, ephemeral per-page
Admins opt into admin powers via an on-page switch instead of only
?admin=true. The toggle renders ONLY for users the server reports
can_elevate, reusing each tool's existing header placeholder (or
creating one) and floating it bottom-right via fixed positioning.

Admin mode is now EPHEMERAL — scoped to the page you armed it on:
  - the zddc-elevate cookie is session-scoped (drops the 30-min Max-Age)
  - pagehide clears it, so navigating away / closing drops admin

Because a reload would race the pagehide-clear, every arm/drop path
(toggle, ?admin= URL, banner "Drop admin") now applies IN PLACE and
emits a `zddc:elevationchange` event. browse listens for it and
re-fetches the listing (server-computed verbs) + re-renders the open
preview, so editor affordances reflect the new elevation without a
manual reload.

Validated end-to-end in a containerized Chromium (Playwright over CDP)
against a local zddc-server: the toggle renders for can_elevate, arming
sets the session cookie + armed chrome, "Drop admin" and navigate-away
both clear it, and ?admin=true still arms via the same funnel.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 15:29:19 -05:00
..
fonts feat(typography): bake IBM Plex Sans + Source Serif 4 into every tool 2026-05-10 20:09:59 -05:00
vendor feat(browse): SPA overhaul — context menu, YAML editor, icons, hovercard, deep links, autofilter 2026-05-14 12:12:42 -05:00
base.css feat(browse): SPA overhaul — context menu, YAML editor, icons, hovercard, deep links, autofilter 2026-05-14 12:12:42 -05:00
build-lib.sh feat(server): multi-template MD→HTML with .zddc.d/templates cascade 2026-06-04 14:18:40 -05:00
cap.js feat(form): pre-flight Submit gate + cap-toast on 403 2026-05-21 08:50:49 -05:00
context-menu.css feat(browse): SPA overhaul — context menu, YAML editor, icons, hovercard, deep links, autofilter 2026-05-14 12:12:42 -05:00
context-menu.js feat(browse): verb-aware gating on rename/delete + editor save 2026-05-21 08:45:11 -05:00
diff.js feat(browse): markdown version-history viewer with diff + restore 2026-05-28 12:49:00 -05:00
elevation.css feat(elevation): on-page admin-mode toggle, ephemeral per-page 2026-06-05 15:29:19 -05:00
elevation.js feat(elevation): on-page admin-mode toggle, ephemeral per-page 2026-06-05 15:29:19 -05:00
favicon.svg feat(tools,build): in-flight HTML-tool reworks and build-infra updates 2026-04-29 12:52:27 -05:00
fonts.css feat(typography): bake IBM Plex Sans + Source Serif 4 into every tool 2026-05-10 20:09:59 -05:00
hash.js Initial commit 2026-04-27 11:05:47 -05:00
help.js Initial commit 2026-04-27 11:05:47 -05:00
icons.js feat(browse): capability/role/tier-driven, context-correct menu system 2026-06-04 07:21:02 -05:00
logo.css feat(shared): clickable logo links every tool's header to project home 2026-05-10 07:34:28 -05:00
logo.js feat(shared): clickable logo links every tool's header to project home 2026-05-10 07:34:28 -05:00
preview-lib.js feat(browse): preview .docx/.xlsx + fix markdown-editor horizontal overflow 2026-06-03 08:55:14 -05:00
theme.js Initial commit 2026-04-27 11:05:47 -05:00
toast.css feat(shared): cap.js client helpers for permission gating 2026-05-21 08:42:05 -05:00
toast.js feat(shared): route window.alert() to non-blocking toast 2026-05-10 19:30:36 -05:00
zddc-filter-test.html Initial commit 2026-04-27 11:05:47 -05:00
zddc-filter.js Initial commit 2026-04-27 11:05:47 -05:00
zddc-source.js refactor: virtual file extensions for subtree zip + MD conversion 2026-05-14 12:23:37 -05:00
zddc-test.html feat(browse): markdown version-history viewer with diff + restore 2026-05-28 12:49:00 -05:00
zddc.js feat: reviewing/ lifecycle — Plan Review endpoint, virtual received window, browse context-menu workflows 2026-05-15 16:08:04 -05:00
zip-source.js feat(archive,browse): treat .zip transmittal folders as folders + shared zip adapter 2026-05-12 12:29:14 -05:00