Skip to content

feat: add support in the UX for public benchmarks#150

Open
jrvb-rl wants to merge 1 commit intomainfrom
jrvb/public-benchmarks
Open

feat: add support in the UX for public benchmarks#150
jrvb-rl wants to merge 1 commit intomainfrom
jrvb/public-benchmarks

Conversation

@jrvb-rl
Copy link
Copy Markdown
Contributor

@jrvb-rl jrvb-rl commented Mar 6, 2026

The main part of this PR adds the ability for RLI to pull from public benchmarks as well as private ones, and hooks these into the various parts of the interactive and command-line UX. There are also a number of fit-and-polish fixes along the way:

  • rename strings to avoid shortcut key conflict
  • fix pagination and loading of benchmark scenarios
  • various other small fixes

rename strings to avoid shortcut key conflict

fix: change benchmark job shortcut to [r] "Run Benchmark Job"

The previous shortcut "c" conflicted with "copy id" on the detail page,
and "n" conflicted with "next page" on the list page. Use "r" for "Run
Benchmark Job" on both screens for consistency.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

fix pagenation and loading of benchmark scenarios

fmt
@jrvb-rl jrvb-rl requested review from james-rl and ross-rl March 6, 2026 16:04
Copy link
Copy Markdown
Contributor

@james-rl james-rl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we're still going with custom benchmarks rather than private

A few other minor suggestions

Comment on lines +207 to +218
const BENCHMARK_ID_PREFIXES = ["bm_", "bmk_", "bmd_"];

function looksLikeBenchmarkId(s: string): boolean {
return BENCHMARK_ID_PREFIXES.some((p) => s.startsWith(p));
}

// Extract a benchmark ID from strings like "Name (bmd_xxx)" copied from the TUI
function extractEmbeddedId(s: string): string | null {
const match = s.match(/\((bm[dk]?_\S+)\)\s*$/);
return match ? match[1] : null;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

they always start with bmd_

message BenchmarkDefinitionPb {
  option (db_schema_options) = {
    db_table_name: "benchmark_definition"
    db_table_schema_type: DB_TABLE_SCHEMA
    db_type_prefix: "bmd"
  };

const [showPopup, setShowPopup] = React.useState(false);
const [selectedOperation, setSelectedOperation] = React.useState(0);
const [tab, setTab] = React.useState<"private" | "public">(
params.tab === "public" ? "public" : "private",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

private should be custom to match our branding for non-public benchmarks

});
} else if (input === "/") {
search.enterSearchMode();
} else if (input === "1" && tab !== "private") {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"private" --> "custom"

Comment on lines +142 to +146
const result = await listScenarioRuns({
limit: 100,
startingAfter,
benchmarkRunId,
});
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this limit seems very low; maybe somewhere in [500, 1k] instead?

describe("updateCurrentParams", () => {
it("merges new params into current params without changing screen or history", () => {
let state = navigate(initialNavigationState, "benchmark-list" as ScreenName, {
benchmarkId: "bm_1",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bmd_

color={!isPublic ? colors.primary : colors.textDim}
bold={!isPublic}
>
[1] Private
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Custom

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.

2 participants