Skip to content

Comments

Add admin submission view and delete from rankings#194

Open
msaroufim wants to merge 2 commits intomainfrom
admin-delete-submission
Open

Add admin submission view and delete from rankings#194
msaroufim wants to merge 2 commits intomainfrom
admin-delete-submission

Conversation

@msaroufim
Copy link
Member

@msaroufim msaroufim commented Feb 18, 2026

Summary

  • Admins can click submission IDs in the rankings list to open a dialog showing the submitted code
  • Dialog includes a two-step delete confirmation (Delete → Confirm Delete)
  • Backend proxies delete to kernelbot's existing DELETE /admin/submissions/{id} endpoint using ADMIN_TOKEN (Bearer auth)
  • Leaderboard auto-refreshes after successful deletion

Changes

  • Backend (kernelboard/api/submission.py): New DELETE /api/submission/<id> with admin whitelist check + proxy to kernelbot
  • Backend (kernelboard/lib/env.py): Register ADMIN_TOKEN as optional env var
  • Frontend API (api.ts): New deleteSubmission() function
  • Frontend UI (RankingLists.tsx): Clickable submission ID → dialog with CodeBlock + delete flow
  • Parent wiring (Leaderboard.tsx): Passes onRefresh callback to re-fetch rankings after delete

No kernelbot changes needed

Kernelbot already has DELETE /admin/submissions/{id} with Bearer token auth. Kernelboard just needs the same ADMIN_TOKEN env var to call it.

Deployment

Set ADMIN_TOKEN env var on kernelboard (same value as kernelbot's ADMIN_TOKEN).

Test plan

  • As admin: click submission ID, verify code renders in dialog
  • Click Delete → verify confirmation step appears
  • Confirm delete → verify submission removed and rankings refresh
  • As non-admin: verify submission IDs are not clickable (not visible)
  • Verify non-admin API calls return 403

Wrap the description and benchmark shapes in a collapsed
<details>/<summary> so the leaderboard tabs are immediately
visible without scrolling.
@msaroufim msaroufim temporarily deployed to kernelboard-admin-delet-xuklmv February 18, 2026 16:37 Inactive
@msaroufim msaroufim force-pushed the admin-delete-submission branch from bbe9928 to bb458c4 Compare February 18, 2026 16:38
@msaroufim msaroufim temporarily deployed to kernelboard-admin-delet-xuklmv February 18, 2026 16:38 Inactive
Admins can click a submission ID in the rankings list to open a dialog
showing the submitted code, with a two-step delete confirmation. The
delete proxies through kernelbot's existing DELETE /admin/submissions/{id}
endpoint using the shared ADMIN_TOKEN (Bearer auth).
@msaroufim msaroufim force-pushed the admin-delete-submission branch from bb458c4 to f23a274 Compare February 18, 2026 18:16
@msaroufim msaroufim temporarily deployed to kernelboard-admin-delet-xuklmv February 18, 2026 18:16 Inactive
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