Skip to content
Merged
11 changes: 11 additions & 0 deletions apps/bench/src/__tests__/query-state.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,17 @@ describe("parseBenchQuery", () => {
});
});

test("accepts S4 offscreen-autosize scenario", () => {
expect(parseBenchQuery("?scenario=S4&scale=dev&script=scroll")).toEqual({
adapterId: "pretable",
scenarioId: "S4",
profile: "default",
scale: "dev",
scriptName: "scroll",
autorun: false,
});
});

test("accepts S3 many-columns scenario", () => {
expect(parseBenchQuery("?scenario=S3&scale=dev&script=scroll")).toEqual({
adapterId: "pretable",
Expand Down
2 changes: 1 addition & 1 deletion apps/bench/src/bench-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { BenchScriptName } from "@pretable-internal/bench-runner";

export interface BenchQueryState {
adapterId: "pretable" | "ag-grid" | "tanstack" | "mui";
scenarioId: "S1" | "S2" | "S3" | "S7";
scenarioId: "S1" | "S2" | "S3" | "S4" | "S7";
profile: "default";
scale: "smoke" | "dev" | "hypothesis" | "target";
scriptName: Extract<
Expand Down
2 changes: 2 additions & 0 deletions apps/bench/src/pretable-adapter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export function PretableAdapter({
const adapterRef = useRef<HTMLElement>(null);
const surfaceColumns = useMemo(() => [...dataset.columns], [dataset.columns]);
const surfaceRows = useMemo(() => [...dataset.rows], [dataset.rows]);
const autosize = dataset.scenario.autosize_all_columns === true;

const onTelemetryChangeRef = useRef(onTelemetryChange);
// eslint-disable-next-line react-hooks/refs -- sync ref to latest prop for use in callbacks
Expand Down Expand Up @@ -100,6 +101,7 @@ export function PretableAdapter({

<PretableSurface
ariaLabel="Pretable React adapter"
autosize={autosize}
columns={surfaceColumns}
getRowId={getScenarioRowId}
interactionState={
Expand Down
8 changes: 5 additions & 3 deletions apps/bench/src/query-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@ export function parseBenchQuery(
? "S2"
: scenario === "S3"
? "S3"
: scenario === "S7"
? "S7"
: DEFAULT_QUERY_STATE.scenarioId,
: scenario === "S4"
? "S4"
: scenario === "S7"
? "S7"
: DEFAULT_QUERY_STATE.scenarioId,
profile: DEFAULT_QUERY_STATE.profile,
scale:
scale === "smoke" ||
Expand Down
4 changes: 2 additions & 2 deletions apps/bench/src/tanstack-adapter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ export function TanStackAdapter({ dataset, runKey }: TanStackAdapterProps) {
const parentRef = useRef<HTMLDivElement>(null);
const displayRows = dataset.rows;
const totalWidth = dataset.columns.reduce(
(width, column) => width + column.widthPx,
(width, column) => width + (column.widthPx ?? 140),
0,
);
const gridTemplateColumns = dataset.columns
.map((column) => `${column.widthPx}px`)
.map((column) => `${column.widthPx ?? 140}px`)
.join(" ");
// Bench-only adapter: this hook owns virtualization locally and does not
// pass the returned functions through memoized boundaries.
Expand Down
Loading
Loading