feat: add knockout wheel fixture - #123
Merged
Merged
Conversation
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.
Adds Knockout Wheel, the second version on the Fixtures page: the same tournament tree wrapped around its champion.
What it looks like
The geometry
The hub is the final. Each round becomes a ring further out, and the teams themselves form the rim, so a 32-team draw is 63 nodes across 5 rings. Every parent splits its angular wedge between its two feeders, halving each level, with a small gap pulling siblings toward their parent so subtrees separate visually. Sibling pairs are joined by an arc at the midpoint radius plus a radial stem to the parent; the hub's two feeders sit opposite each other and get plain radial lines, since an arc between them would be a half circle.
Nothing is hard-coded to a bracket size.
rounds.lengthdrives the ring count and radii, so 8, 16 or 32 teams all render without special cases.Interaction
Round · Teams · Score, and that flag alone stays lit.Tooltipis pointer-only by design. Tap again to release.Props
rounds— outermost round first, each holding half as many matches as the one before.initialRound— index of the outermost round to draw. Earlier rounds are dropped and the kept round's own teams become the rim, so2on a 32-team draw opens at the quarter-finals. Defaults to the whole tree.The
Match/Roundtypes are a local copy of the bracket's rather than an import: importing would make the registry bundle the entire bracket into@beui/knockout-wheel. They stay structurally compatible, so one tournament object feeds both components.Accessibility
role="img"prunes the svg's descendants, so every result is restated in ansr-onlylist of named lists — deliberately not<section aria-label>, which would add five landmarks competing with real page navigation. Focus usesring-foregroundrather than the--ringtoken, which is a 10% white hairline that disappears over a flag.Notes for review
Two things worth knowing about, both verified rather than assumed:
Math.sin/Math.cosare implementation-defined in their last digits, so Bun's SSR and the browser disagreed on every derived coordinate and React reported a mismatch on each one.polar()now quantizes to 3 decimals, far below sub-pixel at a 760-unit viewBox.<image>has noloading="lazy", so 63 requests fired on mount. They're now gated behinduseInView: 0 requests off-screen, 63 once the wheel approaches the viewport.Below
32remthe wheel holds its size and pans inside its own scroll container, the same patternKnockoutBracketuses — letting it shrink put 32 rim flags at 21px, too small to tell apart or tap.Checks
bun run check(typecheck, lint, registry) andbun testpass — 41 tests, 53 registry components. Verified in the browser across pointer, touch and keyboard, in both themes, and underprefers-reduced-motion.