Skip to content

fix(mcp): keep close method-spectrum labels apart on the card - #47

Merged
Stanback merged 1 commit into
mainfrom
fix/mcp-spectrum-labels
Oct 24, 2026
Merged

Stanback merged 1 commit into
mainfrom
fix/mcp-spectrum-labels

Conversation

@Stanback

Copy link
Copy Markdown
Owner

Follow-up to #46: the MCP card had the same method-spectrum label collision. At phone width, women's 1650 SCY 17:36.20 → SCM printed "NCAA" and "Equivalence" over each other.

  • The label layout moves to src/lib/spectrum-layout.ts. The web component and the card both call it, so they cannot drift.
  • The card runs the layout once its collapsed details open, using a ResizeObserver on the track that also covers resize and text zoom. A colliding label drops to a lower row with a leader tick, and dots keep their true positions.
  • The card resource becomes ui://turnmark/conversion/0.3.0-r8.html, so hosts do not reuse the cached r7 view.

Tests

  • test-mcp-ui reproduces the 1650 card at 680px and 390px. It fails on the previous card ("Spectrum labels overlap at 390px") and passes now, over both stdio and HTTP.
  • A new unit test, spectrum-layout.test.ts, covers the layout. Vitest passes (191), the existing web spectrum Playwright test passes on desktop and mobile, and svelte-check, ci-changes (81) and test-mcp pass.

🤖 Generated with Claude Code

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]>
@Stanback
Stanback merged commit f4e200d into main Oct 24, 2026
12 checks passed
@Stanback
Stanback deleted the fix/mcp-spectrum-labels branch October 24, 2026 17:27
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