judge-dashboard: persistent admin delete via Vercel Blob#31
Merged
Conversation
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
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).Env vars
BLOB_READ_WRITE_TOKEN(auto-set by the linked public Blob store)ADMIN_PASSWORDS=Runflow.io/teamBehaviour
Test plan
IS_ADMIN(wrong password) → × button hidden, can't hide.