Skip to content

Commit e44cd19

Browse files
committed
fix(studio): per-run compare timestamp appears duplicated (#1044)
In the per-run compare table each row rendered two lines in the Timestamp column: 1. `formatTimestamp(run.started_at)` → "YYYY-MM-DD HH:MM" 2. `shortenRunId(run.run_id)` → shortened run id For the common case where a run workspace is named after its own ISO timestamp, both lines started with the same date, so the secondary line read as a visual duplicate. Worse, `shortenRunId` always returned just the trailing timestamp segment, silently dropping the `experiment::` prefix for runs stored under `runs/<experiment>/<timestamp>/` — so two runs from different experiments at the same minute looked identical unless you hovered the tooltip. Replace `shortenRunId` with `runSubLabel`, which returns: - `null` for plain-timestamp ids → secondary line is hidden entirely - the `::`-joined prefix ("with-skills", "remote", "remote · with-skills", …) otherwise → meaningful disambiguator Move the full-id tooltip to the outer `<td>` so it remains available on hover in either rendering path. Regenerate the docs screenshot at apps/web/src/assets/screenshots/studio-compare-per-run.png and its alt text to reflect the fix and the filter-by-tag chip row added by #1043.
1 parent 8864cd2 commit e44cd19

3 files changed

Lines changed: 26 additions & 13 deletions

File tree

apps/studio/src/components/CompareTab.tsx

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,7 @@ function PerRunRow({
628628
const tagsBtnRef = useRef<HTMLButtonElement>(null);
629629
const tags = run.tags ?? [];
630630
const runLabel = tags[0] ?? run.run_id;
631+
const subLabel = runSubLabel(run.run_id);
631632

632633
// Restore focus to the tags trigger button once the inline editor closes,
633634
// so keyboard users don't lose their place in the table.
@@ -655,13 +656,11 @@ function PerRunRow({
655656
aria-label={`Select run ${runLabel}`}
656657
/>
657658
</td>
658-
<td className="px-4 py-3 align-middle">
659+
<td className="px-4 py-3 align-middle" title={run.run_id}>
659660
<div className="font-medium text-gray-200 tabular-nums">
660661
{formatTimestamp(run.started_at)}
661662
</div>
662-
<div className="text-xs text-gray-500 tabular-nums" title={run.run_id}>
663-
{shortenRunId(run.run_id)}
664-
</div>
663+
{subLabel && <div className="text-xs text-gray-500 tabular-nums">{subLabel}</div>}
665664
</td>
666665
<td className="px-4 py-3 align-middle">
667666
{canEdit ? (
@@ -1152,12 +1151,26 @@ function formatTimestamp(iso: string): string {
11521151
}
11531152
}
11541153

1155-
/** Abbreviate the run id for display (keeps the last segment). */
1156-
function shortenRunId(id: string): string {
1157-
const parts = id.split('::');
1158-
if (parts.length >= 2) {
1159-
const tail = parts[parts.length - 1];
1160-
return tail.length > 22 ? `${tail.slice(0, 10)}${tail.slice(-8)}` : tail;
1161-
}
1162-
return id.length > 22 ? `${id.slice(0, 10)}${id.slice(-8)}` : id;
1154+
/**
1155+
* Derive a sub-label shown below the formatted timestamp in the per-run
1156+
* compare view. Returns `null` when the run id is a plain timestamp —
1157+
* the common case where the sub-label would just repeat what the
1158+
* formatted timestamp already shows, adding visual noise.
1159+
*
1160+
* Run ids are built by `buildRunId` in `apps/cli/src/commands/inspect/
1161+
* utils.ts` and optionally wrapped with `remote::` by
1162+
* `encodeRemoteRunId` in `apps/cli/src/commands/results/remote.ts`, so
1163+
* the shape is one of:
1164+
* - `2026-04-01T10-00-00-000Z` → null
1165+
* - `with-skills::2026-04-01T10-00-00-000Z` → "with-skills"
1166+
* - `remote::2026-04-01T10-00-00-000Z` → "remote"
1167+
* - `remote::with-skills::2026-04-01T10-...` → "remote · with-skills"
1168+
*
1169+
* The full run id stays available via the `title` attribute on the
1170+
* timestamp cell so keyboard / pointer users can always recover it.
1171+
*/
1172+
function runSubLabel(runId: string): string | null {
1173+
const parts = runId.split('::');
1174+
if (parts.length < 2) return null;
1175+
return parts.slice(0, -1).join(' · ');
11631176
}
2.02 KB
Loading

apps/web/src/content/docs/docs/tools/studio.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ agentv studio # Compare tab shows 2x2 matrix
9696

9797
Running the same `(experiment, target)` twice no longer collapses into a single cell. Switch to **Per run** mode to see every run as its own row, select two or more, and compare them head-to-head.
9898

99-
<Image src={studioComparePerRun} alt="AgentV Studio per-run compare mode listing individual runs with timestamps, tags, experiment, target, and pass rate" />
99+
<Image src={studioComparePerRun} alt="AgentV Studio per-run compare mode with a filter-by-tag chip row and individual runs listing timestamp, tags, experiment, target, and pass rate; experiment-prefixed runs surface the experiment name under the timestamp" />
100100

101101
Use per-run mode when you want to:
102102

0 commit comments

Comments
 (0)