Skip to content

Keep model labels inside the plot, not out in the axis gutter - #1088

Open
rahuldoval wants to merge 1 commit into
mainfrom
hotfix/board-labels-inside-plot
Open

Keep model labels inside the plot, not out in the axis gutter#1088
rahuldoval wants to merge 1 commit into
mainfrom
hotfix/board-labels-inside-plot

Conversation

@rahuldoval

Copy link
Copy Markdown
Contributor

Hotfix for #1079. One file, 23 lines.

The bug

The board's viewBox is extended left by GUTTER so the axis tick labels and the rotated axis title can hang there. The label placement search was bounded by that same extended edge:

if (left < PL - GUTTER || right > PL + PW) continue;

So a model label was free to land in the gutter as well — well outside the plot frame. With every model selected, Claude Opus 5 and Claude Sonnet 4.6 floated to the left of the chart.

Point labels are now held to the plot column; only the axis hangs. The fallback path had no horizontal bound at all, so it now takes whichever side fits and drops the label if neither does, rather than placing it outside.

Why the existing checks missed it

They measured labels against the svg element, whose bounds include the gutter by design — a label sitting out there was inside the element and counted as fine. And it only reproduces with all 30 models selected, not in the default 20-model view.

The check now measures against the plot frame, derived from the gridlines the dots actually sit in. Run against the merged code it fails on exactly the two reported labels:

FAIL 1440 all  outside=2  Claude Opus 5 [57..138] | Claude Sonnet 4.6 [108..209]
FAIL 1920 all  outside=2  Claude Opus 5 [297..378] | Claude Sonnet 4.6 [348..449]

With this change, every width passes.

Verification

At 390 / 768 / 1024 / 1440 / 1920, in the default view and with all 30 selected:

  • every point label inside the plot frame
  • zero label-to-label and label-to-dot overlaps
  • every visible model still labelled — none dropped to satisfy the new bound
  • no horizontal page overflow

prettier, tsc, eslint, next build (325 pages) and all three benchmark audits (22/22 contracts) pass.

🤖 Generated with Claude Code

The board's viewBox is extended left by GUTTER so the axis tick labels and
the rotated title can hang there. The label placement search was bounded by
that same extended edge, so a point label was free to land in the gutter
too, well outside the plot frame. With every model selected, Claude Opus 5
and Claude Sonnet 4.6 ended up floating to the left of the chart.

Point labels are now held to the plot column. Only the axis hangs. The
fallback path had no horizontal bound at all, so it takes whichever side
fits and drops the label if neither does, rather than placing it outside.

This survived earlier checks because those measured labels against the svg
element, whose bounds include the gutter by design — a label sitting out
there was inside the element and counted as fine. The check now measures
against the plot frame, taken from the gridlines the dots actually sit in.
Against the merged code it fails on exactly the two labels reported; with
this change it passes at 390 through 1920, in the default view and with all
30 selected, with no label overlaps and no model left unlabelled.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Aug 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
openui-docs Ready Ready Preview Aug 26, 2026 1:20pm

Request Review

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