Skip to content

Visual drag-and-drop bracket builder for knockout entrants - #54

Merged
ylynfatt merged 3 commits into
mainfrom
bracket-ordering-view
Jul 20, 2026
Merged

ylynfatt merged 3 commits into
mainfrom
bracket-ordering-view

Conversation

@ylynfatt

@ylynfatt ylynfatt commented Jul 19, 2026 •

Copy link
Copy Markdown
Owner

Summary

Reworks the knockout entrants builder into a visual, drag-and-drop bracket — replacing the earlier flat list of qualifier dropdowns (with up/down reorder + a separate projected-paths panel), which was hard to use. Design was approved from an interactive mockup first.

  • Qualifier palette — chips grouped as group winners / runners-up / best-placed (colour-dotted), dragged onto bracket slots; a placed chip dims in the palette.
  • The bracket tree is the editing surface — round-1 matches you fill, then the derived later rounds shown as winner M1 vs winner M2, so the paths are visible while building (no separate panel).
  • Drag to arrange — grab a matchup by its ⠿ handle to reorder it (which reshapes the downstream rounds); drag a placed chip between slots to move or swap; × to unassign.
  • Native HTML5 drag-and-drop — no new dependency.
  • Templates (classic / seeded) and all server-side validation unchanged; slots mirror into the saved entrants only once every slot is filled.

Supersedes this branch's earlier flat-list iteration; keeps the BracketAdjacencyTest contract test.

Testing

  • BracketAdjacencyTest (unchanged) locks the entrant-order → next-round-pairing contract the builder produces, end-to-end through the real generator + AdvanceBracketWinner.
  • Core builder logic (assign, swap, reorder, template fill, saved-payload mapping, derived-round structure) cross-checked in isolation; the interaction is a faithful port of the verified mockup.
  • Type-check + build clean (no new errors); full suite 440 passed.
  • Note: the edit page is owner-gated, so this couldn't be driven headlessly in CI — verification is the mockup + logic cross-check + types/build, over the same validated config.entrants payload.

🤖 Generated with Claude Code

ylynfatt and others added 2 commits July 19, 2026 18:57
The entrant slot list is the whole bracket tree: consecutive round-1
matches feed each next-round game, so the order the matches sit in
decides who can meet in the Round of 16 and beyond. The builder showed a
flat match list with no view of that, making it easy to arrange a bracket
whose later-round pairings are wrong.

- Each round-1 match gets up/down controls to reorder it
- A live "Projected bracket paths" panel folds the current order into the
  Round of 16 (with the feeding matchups' teams inlined) and the deeper
  rounds, updating as slots and order change
- BracketAdjacencyTest locks the underlying contract end-to-end: adjacent
  round-1 match winners are routed into the same next-round game, and
  changing the match order changes who meets

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Replaces the flat list of qualifier dropdowns (with up/down reorder and a
separate projected-paths panel) with a visual bracket builder, after the
list proved hard to use:

- A qualifier palette (group winners / runners-up / best-placed, colour-
  dotted) whose chips drag onto bracket slots; placed chips dim
- The real bracket tree as the editing surface: round-1 matches you fill,
  then the derived later rounds (winner M1 vs winner M2 …) so the paths
  are visible while you build
- Drag a matchup by its handle to reorder it; drag a placed chip between
  slots to move or swap; × to unassign
- Native HTML5 drag-and-drop — no new dependency
- Templates (classic/seeded) and all validation unchanged; slots only
  save once every one is filled

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@ylynfatt ylynfatt changed the title Show projected bracket paths and let admins reorder round-1 matches Visual drag-and-drop bracket builder for knockout entrants Jul 20, 2026
Addresses two gaps in the visual builder:

Screen real estate — the edit form was capped at max-w-2xl, cramping the
bracket into a narrow scroll. Bracket stages now use the full width
(max-w-6xl) with the plain text fields kept readable at max-w-2xl, and the
palette moves beside the bracket (sticky) on large screens, stacking above
it on small ones.

Touch support — native HTML5 drag never fires on touch screens, so the
builder was unusable on phones/tablets. Added tap-to-place as a first-class
alternative (also better for keyboard/pointer): tap a qualifier then a slot
to place it, tap a placed chip to pick it up/move, tap a matchup handle
then another to reorder. Drag still works on desktop. Chips and handles are
now real buttons for accessibility.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@ylynfatt
ylynfatt merged commit b8875e9 into main Jul 20, 2026
1 check passed
@ylynfatt
ylynfatt deleted the bracket-ordering-view branch July 20, 2026 01:06
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