Skip to content

feat(inference): rework point-label toggle and default line labels on#474

Merged
functionstackx merged 2 commits into
masterfrom
feat/labels-toggle-defaults
Jun 20, 2026
Merged

feat(inference): rework point-label toggle and default line labels on#474
functionstackx merged 2 commits into
masterfrom
feat/labels-toggle-defaults

Conversation

@functionstackx

@functionstackx functionstackx commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Summary

Three related chart-label changes, applied to both the latency Scatter chart and the GPU chart:

  1. "Hide Labels" → "Labels" (off by default). The toggle is renamed and its meaning inverted. Previously point labels were shown by default and "Hide Labels" hid them; now point labels are hidden by default and "Labels" shows them. State hidePointLabelsshowPointLabels.

  2. "Line Labels" is now on by default. Date line labels render without any interaction.

  3. Turning "Parallelism Labels" on auto-enables "Labels" if it's off. Parallelism labels are point labels, so without this they'd toggle on but stay invisible.

URL params

  • i_nolabeli_label (=1 shows point labels; default off, so absent = hidden).
  • i_linelabel now defaults on: the non-default OFF state is encoded as i_linelabel=0; the default-on state is stripped from share links. Existing i_linelabel=1 links still work.

Overlay support

Works for both official runs and ?unofficialrun= overlays — the overlay point-label render path (showLabels = showPointLabels && !showGradientLabels) was updated alongside the official path, and the line-label default applies uniformly to overlay rooflines.

Testing

  • pnpm typecheck, pnpm fmt, lint on changed files, and pnpm test:unit (2417 tests) all pass.
  • Updated line-labels.cy.ts: default-on assertion, off→on round-trip, and new i_linelabel=0 load coverage.
  • Updated the cypress mock context (showPointLabels) and docs/state-ownership.md.

🤖 Generated with Claude Code


Note

Low Risk
Chart display and URL param renames with explicit legacy read paths; no auth, data, or backend changes. Main risk is share-link edge cases, covered by new e2e tests.

Overview
Inference chart legends now treat point labels and line labels with clearer defaults and shareable URL semantics.

Point labels: hidePointLabels becomes showPointLabels (off by default). The legend switch is renamed from Hide Labels to Labels. Share links use i_label=1 when labels are on; i_nolabel=1 is still read on load but not written. Loading i_advlabel=1 without an explicit label flag turns Labels on so old parallelism-only links still show text; i_nolabel=1 overrides that.

Line labels: Default is on (i_linelabel absent); share URLs emit i_linelabel=0 only when the user turns them off. i_linelabel=1 remains valid.

UI behavior: Enabling Parallelism Labels auto-enables Labels on scatter and GPU comparison charts when needed. Scatter overlay point labels follow the same showPointLabels logic.

Docs (state-ownership.md), Cypress (line-labels.cy.ts), and mocks are updated for the new defaults and legacy URL cases.

Reviewed by Cursor Bugbot for commit 9c5ea62. Bugbot is set up for automated code reviews on this repo. Configure here.

- Rename the "Hide Labels" toggle to "Labels" and invert it: off by
  default now means point labels are hidden; turning it on shows them.
  State renamed hidePointLabels -> showPointLabels; URL param
  i_nolabel -> i_label (=1 shows labels).
- Enable "Line Labels" by default. URL encodes the non-default OFF state
  as i_linelabel=0 (on, the default, is stripped from share links).
- Turning "Parallelism Labels" on now auto-enables "Labels" if it's off,
  so the parallelism text actually renders instead of being hidden.

Applied to both the latency Scatter chart and the GPU chart, including
the unofficial-run overlay label path. Updated mock context, the
line-labels e2e specs (default-on + i_linelabel=0 coverage), and docs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@functionstackx functionstackx requested a review from adibarra as a code owner June 20, 2026 06:32
@vercel

vercel Bot commented Jun 20, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
inferencemax-app Ready Ready Preview, Comment Jun 20, 2026 9:42am

Request Review

Comment thread packages/app/src/components/inference/InferenceContext.tsx Outdated
@functionstackx functionstackx enabled auto-merge (squash) June 20, 2026 06:45
@adibarra

Copy link
Copy Markdown
Contributor

@claude all url params changes must be backwards compatible. Make sure your change is, because it looks like it isn't.

@github-actions

github-actions Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Claude finished @adibarra's task in 7m 12s —— View job


Backwards-compat fix pushed

You were right — two explicit URL params broke after the rename. Fixed in 9c5ea62:

Legacy share link Old behavior Before this fix After this fix
?i_nolabel=1 point labels hidden param ignored (matched new default only by accident) param honored — showPointLabels=false explicitly
?i_advlabel=1 advanced point labels rendered parallelism toggle on, but Labels off → invisible parallelism toggle on and Labels auto-enabled → renders
?i_advlabel=1&i_nolabel=1 hidden hidden hidden (legacy explicit i_nolabel wins over auto-enable)
?i_linelabel=1 line labels shown already worked (!== '0' check) unchanged

Changes

  • packages/app/src/lib/url-state.ts — re-added i_nolabel to URL_STATE_KEYS as a read-only legacy alias. New code only writes i_label; the address-bar cleanup still strips it.
  • packages/app/src/components/inference/InferenceContext.tsx:159-169showPointLabels hydration now consults i_nolabel, i_label, and i_advlabel in that order.
  • packages/app/cypress/e2e/line-labels.cy.ts — three new tests covering ?i_nolabel=1, ?i_advlabel=1, and the combo.
  • docs/state-ownership.md — documented the legacy param.

Scope note

This fix covers explicit URL params. The PR also flips the defaults (point labels off, line labels on) — which means old share links that had no label params will render slightly differently in the new code (old default = point on / line off vs new default = point off / line on). Without a versioning marker we can't distinguish a fresh new link from a legacy default-state link, so this default flip is left in place as the PR's intended UX change. If you want it preserved too, the cleanest path is to keep the old defaults (showPointLabels=true, showLineLabels=false) and only rebrand the toggle UI — let me know if you'd like that instead.

Verified

  • pnpm typecheck
  • pnpm lint
  • pnpm fmt
  • pnpm test:unit (2124 tests) ✅
  • Cypress assertions for the legacy URL paths added but not run in this environment — Vercel preview will exercise them on PR sync.

Tasks

  • Read the URL state changes (src/lib/url-state.ts)
  • Read InferenceContext.tsx to confirm how params hydrate state
  • Verify i_nolabel=1 (old) still hides labels after the rename
  • Verify i_linelabel=1 (old) still works alongside new i_linelabel=0
  • Implement backwards-compat fix
  • Run typecheck + lint + unit tests
  • Push
    • Branch: feat/labels-toggle-defaults

…s working

- Re-add `i_nolabel` as a read-only legacy alias so pre-rename share links
  explicitly hide point labels (survives future default changes).
- Hydrate `showPointLabels=true` when `?i_advlabel=1` is present and
  `?i_nolabel=1` is not, mirroring the toggle's auto-enable side-effect so
  parallelism labels actually render on legacy links.
- Add Cypress coverage for the three URL combinations.

Co-authored-by: Alec Ibarra <adibarra@users.noreply.github.com>
@functionstackx functionstackx merged commit 1392807 into master Jun 20, 2026
7 of 8 checks passed
@functionstackx functionstackx deleted the feat/labels-toggle-defaults branch June 20, 2026 09:42

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 9c5ea62. Configure here.

selectedDates,
selectedDateRange,
hideNonOptimal,
hidePointLabels,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Legacy i_nolabel poisons share URLs

Medium Severity

After opening a link with legacy i_nolabel=1, turning point labels on writes i_label=1 but leaves the original i_nolabel=1 in share state. Hydration checks i_nolabel before i_label, so re-shared or reloaded links keep labels hidden despite the user enabling them.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 9c5ea62. Configure here.

adibarra added a commit that referenced this pull request Jun 22, 2026
…useStableValue scale configs with replay fixed-axes (#434) and showPointLabels rename (#474)
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.

2 participants