Repository navigation
fix(web): keep close method-spectrum labels from colliding - #46
Merged
Merged
Conversation
Each spectrum pin centred its name and time under the dot, so methods whose converted times sit close together printed over each other (women's 1650 SCY 17:36.20 -> 1500 SCM rendered "NCAAEquivalence" / "17:33.04 17:45.52"). Dots stay on a zero-width anchor at their true position. Labels are measured and laid out separately: centred on the pin when it fits, clamped inside the track, and moved to the first lower row where they touch no other label, with a leader tick back to the dot. The label is now the button, so its focus ring and hit area match what is drawn. The Playwright case reproduces the 1650 example at desktop and 390px in light and dark, asserting no label overlap, containment in the card and true dot positions. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Stanback
added a commit
that referenced
this pull request
Oct 24, 2026
The MCP card had the same collision the web fixed in #46: at phone width the women's 1650 SCY 17:36.20 -> SCM card printed "NCAA" and "Equivalence" over each other. The label layout now lives in src/lib/spectrum-layout.ts and both the web component and the card call it. The card lays labels out after its collapsed details open (a ResizeObserver on the track), dropping a colliding label to a lower row with a leader tick; dots keep their true positions. The card resource moves to ui://turnmark/conversion/0.3.0-r8.html so hosts do not reuse the cached r7 view. test-mcp-ui reproduces the 1650 card at 680px and 390px (it fails on the previous card at 390px), and a unit test covers the shared layout. Co-authored-by: Claude Opus 5.5 <[email protected]>
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.
Problem
On the converter's Compare methods card, each spectrum pin centred its name and time under its dot. When two methods convert to nearby times, the labels printed over each other. With women's 1650 SCY 17:36.20 → 1500 SCM, NCAA (17:33.04) and Equivalence (17:45.52) are about 10% of the track apart, so the card showed "NCAAEquivalence" and "17:33.0417:45.52".
Fix (
src/lib/MethodComparison.svelte)bind:bindings. Each label centres on its pin when it fits, is clamped inside the track, and moves to the first lower row where it touches no other label, with a leader tick back to its dot. Rows where no leader runs through a label are preferred. Labels have an opaque surface background, so an unavoidable leader passes behind text, not over it.<button>, so its focus ring and hit area match what is drawn.Test
New Playwright case
method spectrum keeps close method labels apart and inside the card. It uses the 1650 example at desktop and 390px, in light and dark, and asserts that:It fails on
mainwith "NCAA overlaps Equivalence".Other surfaces
Verification
npm run check,npm test(187),npx playwright test(57 passed, 1 pre-existing mobile-only skip),node --test scripts/ci-changes.test.mjs scripts/native-test-support.test.mjs(84).🤖 Generated with Claude Code