Skip to content

fix: review follow-ups on metrics, trace controls and inspector width - #13

Merged
cboulay merged 1 commit into
devfrom
fix/inspector-and-metric-polish
Aug 15, 2026
Merged

cboulay merged 1 commit into
devfrom
fix/inspector-and-metric-polish

Conversation

@cboulay

@cboulay cboulay commented Aug 14, 2026

Copy link
Copy Markdown
Member

Targets dev. Follow-ups from the main...dev review — findings 1, 2, 3 and 5.

1. Non-finite profiling metrics displayed as 0

toNumber mapped anything that wasn't a finite number to zero, and non-finite floats now arrive as tokens — so a rate of NaN rendered as 0.0 Hz, indistinguishable from an idle publisher. That's the exact ambiguity that made an empty trace look broken last week, so it seemed worth closing rather than leaving.

It now decodes tokens and lets the value stay non-finite: toFixed spells it out (Infinity Hz, NaN Hz), and the consumers that do arithmetic on rates already guard (estimateAutoYMaxMsFromRateHz, formatWindowSeconds, defaultTraceWindowSecondsForRate all check Number.isFinite first). Genuinely non-numeric junk still becomes 0.

The decode lives in utils/nonFiniteNumbers.ts as metricNumber so it's unit-testable; toNumber delegates.

2. Selecting a unit collapsed a capturing row

revealRows replaced expandedIds wholesale, so clicking a unit collapsed a publisher row that was mid-capture — hiding "Stop Profiling Trace" while the capture kept running. Active trace rows are now kept in the expanded set.

3. The 900px ceiling

You asked whether it's still needed — it isn't, and it was the wrong shape: arbitrary at the top, and on a narrow window it still let the topology be squeezed to a sliver. The bound is now what the topology needs: at least 480px for the graph, so the inspector's maximum is viewport - 480.

Enforced in two places on purpose:

  • clampInspectorWidth keeps the stored number sane (drag, arrow keys, Home, and the settings number input all share it now — the number input previously had its own hardcoded 360/900 pair).
  • the grid template applies min(var(--inspector-width), calc(100vw - 480px)), so a width stored on a wide monitor can't squash the graph after a resize or on a smaller screen, with no resize listener.

5. Docs

The global settings bullet list didn't mention the settings-channel toggle.

Verification

  • npm test: 40 passed (3 new metricNumber cases, including that a decoded non-finite formats as Infinity Hz).
  • npm run test:e2e: 32 passed, two new:
    • a capturing row survives a unit selection with its stop control visible — confirmed it fails without the fix (I reverted the one line and watched it go red);
    • dragging the divider hard left on a 1000px viewport leaves the topology ≥ 480px.
  • One existing test updated: the clamp test asserted the removed 900 constant, and now asserts viewport - 480 (920 at its 1400px viewport) with the reasoning in a comment.
  • pytest 57, ruff and format clean, packaged _web rebuilt and in sync.

Skipping finding 4 (immutable assuming hashed asset names) per your call, and no CHANGELOG per repo convention.

🤖 Generated with Claude Code

Three findings from the dev->main review, plus a docs gap.

Non-finite profiling metrics displayed as 0. `toNumber` mapped anything that
was not a finite number to zero, and non-finite floats now arrive as tokens, so
a rate of NaN rendered as `0.0 Hz` -- indistinguishable from an idle publisher,
which is precisely the confusion that makes an empty trace look broken. Decode
tokens instead and let the value stay non-finite; `toFixed` spells it out
("Infinity Hz") and the consumers that do arithmetic on rates already guard.

Selecting a unit collapsed a publisher row that was capturing, hiding its stop
control while the capture kept running. Keep active trace rows expanded when
the list refocuses.

The inspector's 900px ceiling was arbitrary, and on a narrow window it still
allowed the topology to be squeezed to a sliver. Bound the inspector by what
the topology needs instead: at least 480px, enforced in the grid template too,
so a width stored on a wide monitor cannot squash the graph after a resize.

The global settings list in the user guide did not mention the settings-channel
toggle.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@cboulay
cboulay merged commit ac1f1c0 into dev Aug 15, 2026
11 checks passed
@cboulay
cboulay deleted the fix/inspector-and-metric-polish branch August 15, 2026 00:06
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