Skip to content

Refactor metrics display into reusable MetaStrip component - #470

Closed
TonsOfFun wants to merge 1 commit into
mainfrom
claude/zealous-goodall-2uopt1
Closed

TonsOfFun wants to merge 1 commit into
mainfrom
claude/zealous-goodall-2uopt1

Conversation

@TonsOfFun

Copy link
Copy Markdown
Contributor

Summary

This PR refactors the metrics display logic in trace cards and interaction sessions into a reusable MetaStrip component that maintains consistent column alignment across all rows, regardless of which metrics are present or missing.

Key Changes

  • New MetaStrip component in TelemetryObject.jsx: A grid-based layout component that renders a consistent set of metric columns (model, context, duration, tokens, cost, status, etc.) with fixed widths. Empty cells display a muted dash ("—") with explanatory tooltips instead of being omitted, ensuring all rows maintain visual alignment.

  • New META_COLUMN constants: Defines fixed pixel widths for each metric column type (context: 132px, duration: 76px, tokens: 104px, cost: 88px, status: 68px, count: 96px, age: 76px).

  • Updated formatTokens() function in TraceCard.jsx: Changed to return null when no tokens are recorded (instead of "0"), allowing the MetaStrip to display a dash for missing data with appropriate messaging.

  • Refactored TraceCard metrics display: Replaced inline flex layout with MetaStrip component, passing metrics as a structured cell array with content, width, title, and empty state descriptions.

  • Refactored InteractionsView session metrics: Applied the same MetaStrip pattern to session rows, ensuring consistent column alignment between trace cards and session cards.

  • Enhanced PreviewLines component: Added hold prop to optionally preserve empty preview lines (showing a dash) so that rows in a list maintain consistent height and label alignment, while still allowing individual expanded traces to omit missing values.

Notable Implementation Details

  • The MetaStrip uses CSS Grid with column widths anchored at the right edge, allowing only the first column (model name) to size to its content while other columns maintain fixed widths.
  • Empty cells show a muted dash with context-specific tooltips explaining why data is missing (e.g., "No token counts recorded for this trace").
  • The refactoring improves readability of lists by preventing metric values from shifting columns when some rows lack certain data (e.g., errored traces with no tokens or cost).

https://claude.ai/code/session_01LM8AkEnmLvp6pW2qgCGtyd

An errored trace has no tokens, no cost and nothing in context, and the
trace row rendered only the values it had. The cells that survived slid
rightward into the columns the healthy rows spend on something else, so a
list of traces stopped reading as a list: an error's duration sat under
its neighbours' cost, its model badge under their context meter, and the
card lost a line of height where the `output:` preview would have been.

Give the header strip its own primitive. MetaStrip lays the cells out as
fixed columns — the widths live in META_COLUMN, next to the compact
ContextMeter's own 132px — and a cell with nothing to show keeps its
column and prints a muted dash with a title saying what is missing,
rather than dropping out of the row. Only the leading column sizes to
content, which is safe because the strip is anchored at its right edge: a
model name is the one value with no sensible fixed width.

PreviewLines gains `hold` for the same reason, so a trace that errored
before it answered still prints its `output:` line and its card stands as
tall as the ones around it. Spans don't take it — a span's missing half
is usually one the panel above already showed, and a dash there would
deny content the span really carried.

The Interactions session header is the same object header, with the same
gaps when an interaction reported no tokens, so it moves to the strip
too. Trace tokens now read "—" rather than "0 tokens" when nothing was
recorded: a run that failed before the provider answered spent an unknown
amount, not zero.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LM8AkEnmLvp6pW2qgCGtyd

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@TonsOfFun
TonsOfFun marked this pull request as ready for review September 21, 2026 20:40
@TonsOfFun

Copy link
Copy Markdown
Contributor Author

Superseded by #471, which merged as 6fb8816.

#471's first commit (94c783d3d, "Hold every column in an object header's metrics strip") is this change re-applied: the three source files — InteractionsView.jsx, TelemetryObject.jsx, TraceCard.jsx — are byte-identical to this PR's head, and the two commits share a git patch-id (97d12ca382d3cc1b). All three now match main exactly, so the MetaStrip work has landed in full.

The only thing that differed was the compiled action_agent.js, which is why this PR now reports a conflict: two builds of a minified bundle can't be merged. Rebuilding here would reproduce what main already has. Before merging #471 I confirmed its committed action_agent.js and action_agent.css rebuild byte-identical from its sources, so nothing is stale.

Closing rather than merging so the change isn't applied twice.

@TonsOfFun TonsOfFun closed this Sep 21, 2026
aoki-ryusei pushed a commit to aoki-ryusei/activeagent that referenced this pull request Sep 22, 2026
Ports the MetaStrip from activeagents#470 so the evaluation runs list can keep its
cost, movement and status columns aligned on every row — a failed run with
nothing to put in a column prints a dash there rather than sliding its
neighbours over. The trace and interaction lists take the same strip, as
that change has it; the source is identical to the branch so it no-ops once
activeagents#470 merges.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QmHbHdDkfVrg3WX95CnFhd
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.

3 participants