Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion apps/evals/__tests__/leaderboard-mobile.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ test("mobile history can be shared and restores earlier campaigns", () => {

test("invalid view parameters recover to usable defaults and empty filters can be cleared", () => {
const html = render("#/leaderboard?metric=invalid&view=invalid&search=no-such-model");
expect(html).toContain("About Overall");
expect(html).toContain("Overall");
expect(html).not.toContain("lb-evidence-trigger");
expect(html).toContain("No matching results");
expect(html).toContain("Clear filters");
});
20 changes: 12 additions & 8 deletions apps/evals/__tests__/leaderboard-outcomes.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { ModelProfileOverview } from "../src/components/model-profile-overview";
import { modelRowHref } from "../src/components/leaderboard-results";
import { renderToStaticMarkup } from "react-dom/server";
import { createElement } from "react";
import { afterEach, expect, test, vi } from "vitest";
Expand Down Expand Up @@ -105,7 +107,7 @@ test("retains visible outcomes when a later configuration has incomplete grading
expect(html).not.toMatch(/>\s*—\s*</u);
expect(html).toContain("#/models/astra?run=astra-max-spot-1");
const evidence = renderToStaticMarkup(
createElement(LeaderboardPage, { rows: [row], initialExpandedModel: row.model.id }),
createElement(ModelProfileOverview, { row, onInspectRun: () => {} }),
);
expect(evidence).toContain("run=astra-max-perps-1");
});
Expand Down Expand Up @@ -159,13 +161,15 @@ test("Fable low, medium, high and incomplete max are visible without a setting s
}
});

test("expanded evidence uses separate identities for each setting of the same model", () => {
const html = renderToStaticMarkup(
createElement(LeaderboardPage, { initialExpandedModel: "claude-fable" }),
);
test("leaderboard details link to each recorded setting without expanding the table", () => {
vi.stubGlobal("window", { location: { hash: "#/leaderboard?campaign=all" } });
const rows = configurationLeaderboardRows().filter((row) => row.model.id === "claude-fable");
const html = renderToStaticMarkup(createElement(LeaderboardPage, { rows }));
for (const row of rows) expect(html).toContain(`href="${modelRowHref(row)}"`);
const ids = [...html.matchAll(/ id="([^"]+)"/gu)].map((match) => match[1]);
expect(new Set(ids).size).toBe(ids.length);
expect(html).toContain("Source artifact SHA-256");
expect(html).toContain("Recorded tokens");
expect(html).toContain("View Predictions tasks and conversations");
expect(html).not.toContain("lb-expanded-row");
expect(html).not.toContain("lb-evidence-trigger");
expect(html).not.toContain("Show evidence");
expect(html).toContain("View model details.");
});
2 changes: 1 addition & 1 deletion apps/evals/src/components/eval-ui.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export function PageShell({
</a>
<header className="eval-header">
<a className="eval-wordmark" href="#/leaderboard" aria-label="Ask Gina home">
<img src="/favicon.svg" width={40} height={40} alt="" />
<img src="/favicon.svg" width={32} height={32} alt="" />
<img
className="eval-wordmark-light"
src="/images/brand/typography-full-blackOnNone-v2.svg"
Expand Down
54 changes: 0 additions & 54 deletions apps/evals/src/components/leaderboard-evidence.tsx

This file was deleted.

32 changes: 2 additions & 30 deletions apps/evals/src/components/leaderboard-mobile.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
import { useId, useState } from "react";
import { ChevronDown, MoreHorizontal } from "lucide-react";
import { ChevronDown } from "lucide-react";
import { SCORED_FAMILIES, type LeaderboardModelRow } from "../canonical/selectors";
import { useLeaderboard, type LeaderboardController } from "../lib/leaderboard-state";
import {
columns,
CompactScore,
followModelRow,
rowKey,
rowLabel,
rowMetricValue,
RowIdentity,
} from "./leaderboard-results";
import { InfoPopover } from "./results-ui";
import { LeaderboardEvidence } from "./leaderboard-evidence";
import { TransactionResult } from "./transaction-results";

/** Standalone entry point for previews; the app supplies its shared controller. */
Expand All @@ -29,22 +25,16 @@ export function LeaderboardMobile({

export function LeaderboardMobileView({ controller }: { controller: LeaderboardController }) {
const { state, shown, clear } = controller;
const [selected, setSelected] = useState<string | null>(null);
const [openGroups, setOpenGroups] = useState<ReadonlySet<string>>(new Set());
const id = useId();
const groups = new Map<string, LeaderboardModelRow[]>();
shown.forEach((row) => groups.set(row.model.id, [...(groups.get(row.model.id) ?? []), row]));
const efficiency = state.efficiency;
function renderRow(row: LeaderboardModelRow, index: number) {
const key = rowKey(row);
const open = selected === key;
return (
<li key={key} data-mobile-configuration={key}>
<div
className="lb-mobile-row"
data-selected={open}
onClick={(event) => followModelRow(event, row)}
>
<div className="lb-mobile-row" onClick={(event) => followModelRow(event, row)}>
<span className="lb-mobile-position" aria-hidden="true">
{rowMetricValue(row, state.metric) === null ? "·" : index + 1}
</span>
Expand All @@ -55,16 +45,6 @@ export function LeaderboardMobileView({ controller }: { controller: LeaderboardC
<CompactScore row={row} metric={efficiency} />
</small>
</div>
<button
type="button"
className="lb-evidence-trigger"
aria-label={`Evidence and sources for ${rowLabel(row)}`}
aria-expanded={open}
aria-controls={`${id}-evidence-${key}`}
onClick={() => setSelected(open ? null : key)}
>
<MoreHorizontal size={17} />
</button>
<div className="lb-mobile-category-strip">
{SCORED_FAMILIES.map((family) => (
<span key={family}>
Expand All @@ -74,11 +54,6 @@ export function LeaderboardMobileView({ controller }: { controller: LeaderboardC
<TransactionResult row={row} compact />
</div>
</div>
{open && (
<div id={`${id}-evidence-${key}`}>
<LeaderboardEvidence row={row} />
</div>
)}
</li>
);
}
Expand All @@ -87,9 +62,6 @@ export function LeaderboardMobileView({ controller }: { controller: LeaderboardC
<div className="lb-mobile-list-heading">
<span>{`${shown.length} ${state.campaign === "all" ? "records" : "settings"}`}</span>
<span>Overall</span>
<InfoPopover label="About Overall">
<p>{columns.find((column) => column.metric === "overall")?.explanation}</p>
</InfoPopover>
</div>
{state.group === "models" ? (
<div className="lb-mobile-groups">
Expand Down
Loading
Loading