Skip to content

feat(judging): batch overview + decimal scores + delete submission#187

Merged
sacha-l merged 2 commits into
developfrom
feat/judging-batches-decimals-delete
Jun 17, 2026
Merged

feat(judging): batch overview + decimal scores + delete submission#187
sacha-l merged 2 commits into
developfrom
feat/judging-batches-decimals-delete

Conversation

@sacha-l

@sacha-l sacha-l commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

Bundles the judging-batch UX, decimal scores, and an admin delete. Built to not disrupt live judging — server changes are additive and the scoring write-path + ballot gate are untouched.

What's new

Batch overview (replaces the flat batch chips)

  • Expand any batch to preview its submissions (title + submitter) before claiming.
  • See who's working on each batch (claimedBy judges) + a · MINE marker.
  • Multi-select unclaimed batches → Claim selected (N); "Claim next 10" stays.
  • Per submission, shows which judges have saved a score (scoredBy), in the overview and on the scoring card.

Decimal scores (e.g. 4.3/5)

  • Migration widens the 3 score columns INTEGER → NUMERIC(3,1) — non-destructive, existing scores preserved (5 → 5.0), CHECK ranges still valid, and backward-compatible (old build keeps writing integers fine, so the migration can run first).
  • Validator accepts 1 decimal place (rounds to match storage); inputs use step="0.1".

Admin delete submission (for test entries)

  • DELETE /:slug/submissions/:submissionId (requireProgramAdmin, IDOR-guarded, scores cascade) + a trash button (admin-only) in the batch overview and scoring card. Reloads after delete so batch membership stays correct.

Safety

  • Additive server fields (claimedBy, scoredBy); claim/score/ballot logic unchanged.
  • 438 server tests pass (decimal validator, claimedBy/scoredBy, delete authorized/IDOR/not-found); client build + lint clean.
  • Two judges can already score the same batch concurrently (claims aren't exclusive; scores are per-judge-unique) — now they see each other working on it.

Rollout (live-safe)

  1. Run migration 20260617000000_submission_scores_decimal.sql — backward-compatible, can go anytime.
  2. Deploy code during a scoring lull (scoring hasn't started yet, so low risk now).
  3. Delete-after-scoring shifts batch membership — intended for pre-scoring cleanup (noted in the confirm + code).

…ores, delete submission

- Batch overview replaces the flat chips: expand each batch to preview its
  submissions, see which judges are working on it (claimedBy), multi-select
  several unclaimed batches and 'Claim selected'. Per-submission shows which
  judges have saved a score (scoredBy).
- Decimal scores (e.g. 4.3/5): widen score columns INTEGER -> NUMERIC(3,1)
  (backward-compatible), validator accepts 1dp, inputs step 0.1.
- Admin-only delete submission (DELETE /:slug/submissions/:id, IDOR-guarded,
  scores cascade) with a trash button in the batch overview + scoring card.

Server changes are additive (claimedBy/scoredBy fields); scoring write path +
ballot gate unchanged. 438 server tests pass; client build + lint clean.
@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)
stadium Ready Ready Preview, Comment Jun 17, 2026 4:07pm

…udges; fix NUMERIC string coercion

- Any judge can expand any batch to see its submissions with name, VIDEO and
  GITHUB links, the current average score /12 (per-judge breakdown on hover),
  and who has scored. Batch header shows who's working on it (incl. you).
- Surface per-submission 'scores' in listForJudge (additive).
- Coerce NUMERIC score columns Number() in the repo transform — PostgREST
  returns NUMERIC as strings post-migration, which would corrupt score sums.
@sacha-l sacha-l marked this pull request as ready for review June 17, 2026 16:09
@sacha-l sacha-l merged commit 99fbd2d into develop Jun 17, 2026
2 checks passed
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