Skip to content

judge-dashboard: persistent admin delete via Vercel Blob#31

Merged
thibaut-bp merged 1 commit into
mainfrom
feat/judge-dashboard-persistent-admin-delete
Jun 17, 2026
Merged

judge-dashboard: persistent admin delete via Vercel Blob#31
thibaut-bp merged 1 commit into
mainfrom
feat/judge-dashboard-persistent-admin-delete

Conversation

@thibaut-bp

Copy link
Copy Markdown
Contributor

What

Admin deletes on preset tiles now propagate to every judge.

  • /api/preset-overrides — GET returns the hidden tile list (public), POST adds/removes a tile id (admin password required).
  • Dashboard fetches the manifest at boot, filters preset runs[] through it, and routes admin deletes through the endpoint.

Env vars

  • BLOB_READ_WRITE_TOKEN (auto-set by the linked public Blob store)
  • ADMIN_PASSWORDS = Runflow.io/team

Behaviour

  • Admin opens a preset, clicks × on a bad tile → password prompt → POST hides the tile → it's gone for everyone on next page load.
  • Live (non-preset) batches still drop locally; they're already per-session.
  • Endpoint is offline-tolerant; the dashboard falls back to no overrides on fetch failure.

Test plan

  • As a judge: fresh load → 18 chanel tiles render.
  • As admin: hide chanel/h1c1/1:1 → page reloads → 17 tiles.
  • In a different browser, load as judge → 17 tiles (manifest propagated).
  • As admin without a stored IS_ADMIN (wrong password) → × button hidden, can't hide.

Admin deletes used to live in localStorage so a deletion never propagated
past the admin's browser. This wires deletes through a Vercel Blob–backed
JSON manifest so every judge sees the curated set on next load.

- New /api/preset-overrides:
  - GET → returns { hidden: ["preset-chanel-0", ...] } (public read).
  - POST → admin-only. Bearer header must match an ADMIN_PASSWORDS entry.
    Adds / removes a tile id from the manifest and writes back via
    @vercel/blob. Pinned pathname so the JSON sits at one stable URL.
- Dashboard fetches the manifest at boot, stores it in HIDDEN_TILES, and
  filters preset runs[] through it in applyPreset. Endpoint is offline-
  tolerant — no overrides on fetch failure.
- deleteResult is async now: for preset tiles it prompts for the admin
  password, POSTs to the override endpoint, refreshes HIDDEN_TILES, and
  only then removes the tile locally. Live (non-preset) batches still
  drop locally — they're already per-session.

Env vars (set on templates project, Production + Development):
- BLOB_READ_WRITE_TOKEN (auto-set by the linked public blob store)
- ADMIN_PASSWORDS = Runflow.io/team
@thibaut-bp thibaut-bp merged commit d2837e6 into main Jun 17, 2026
1 of 3 checks passed
@vercel

vercel Bot commented Jun 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
runflow-templates Building Building Preview, Comment Jun 17, 2026 10:27pm
templates Building Building Preview, Comment Jun 17, 2026 10:27pm

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant