From 54dfaeead55fa018b424b38bc8027dab3dddd7bc Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 1 May 2026 02:38:33 +0000 Subject: [PATCH 1/4] chore(benchmarks-website): refresh stale "first group is open by default" comments The four UI iterations landed on a layout where every group's disclosure renders collapsed by default; only the *payload* for the first group is inlined into the cold HTML. Several comments still described the older "first group is opened by default" model. Update them in api.rs (GROUP_ORDER), html.rs (LANDING_INLINE_N, UiQuery, LandingGroup, the per-iteration shell-vs-inline branch), chart-init.js (lazy-fetch comment), and the matching web_ui test messages so a future reader doesn't chase a behaviour the code no longer implements. No observable behaviour changes. Signed-off-by: Claude --- benchmarks-website/server/src/api.rs | 5 ++-- benchmarks-website/server/src/html.rs | 29 +++++++++---------- .../server/static/chart-init.js | 8 ++--- benchmarks-website/server/tests/web_ui.rs | 18 +++++++----- 4 files changed, 31 insertions(+), 29 deletions(-) diff --git a/benchmarks-website/server/src/api.rs b/benchmarks-website/server/src/api.rs index 42c3ab6c83c..6b2397e07ca 100644 --- a/benchmarks-website/server/src/api.rs +++ b/benchmarks-website/server/src/api.rs @@ -39,8 +39,9 @@ pub const DEFAULT_COMMIT_WINDOW: u32 = 100; /// Canonical group ordering, ported from the v2 site's hard-coded list at /// `origin/ct/vfvb:benchmarks-website/index.html`. Group names not in this /// list sort after every listed name in alphabetical order. The order is -/// significant for the landing page render — the first group is opened by -/// default and the rest are collapsed. +/// significant for the landing page render — every group is collapsed by +/// default, and only the first group's chart payloads are inlined into the +/// HTML so opening it skips a fetch round-trip. pub const GROUP_ORDER: &[&str] = &[ "Random Access", "Compression", diff --git a/benchmarks-website/server/src/html.rs b/benchmarks-website/server/src/html.rs index 4bfa12ee3fa..234da3919c2 100644 --- a/benchmarks-website/server/src/html.rs +++ b/benchmarks-website/server/src/html.rs @@ -82,10 +82,10 @@ const VORTEX_BLACK_SVG: &[u8] = include_bytes!("../../public/vortex_black_nobg.s const VORTEX_WHITE_SVG: &[u8] = include_bytes!("../../public/vortex_white_nobg.svg"); const STATIC_ASSET_VERSION: &str = "bench-v3-ui-16"; -/// Commits to inline for the open-by-default group. The chart's -/// initial visible window is ~100 commits; bigger windows just bloat -/// the cold-page HTML. Users who zoom out trigger a refetch with -/// `?n=all` via `chart-init.js`. +/// Commits to inline for the first group's pre-fetched chart payloads. +/// The chart's initial visible window is ~100 commits; bigger windows +/// just bloat the cold-page HTML. Users who zoom out trigger a refetch +/// with `?n=all` via `chart-init.js`. const LANDING_INLINE_N: u32 = 100; /// HTML routes mounted under `/`. @@ -127,8 +127,7 @@ pub struct UiQuery { impl UiQuery { /// Resolve the [`CommitWindow`] for HTML routes. Defaults to /// [`CommitWindow::All`] so users can pan/zoom all the way back to - /// the very first commit on every chart, including the first - /// (open-by-default) group on the landing page. Visual downsampling + /// the very first commit on every chart. Visual downsampling /// happens client-side on the visible commit range only. fn fetch_window(&self) -> CommitWindow { match self.n.as_deref() { @@ -208,12 +207,12 @@ async fn landing(State(state): State, Query(ui): Query) -> Re /// One group's worth of data for the landing page. /// -/// The first group (in canonical order) ships with `charts` populated so -/// the moment the user expands it the chart hydrates from the inline -/// JSON without a network round-trip. Every other group ships -/// with `charts` empty and only their chart-card shells — payloads are -/// fetched client-side on first `details.toggle` to keep the cold landing -/// HTML small. +/// Every disclosure renders closed by default. The first group (in +/// canonical order) ships with its chart payloads inlined, so the moment +/// the user expands it the chart hydrates from the inline JSON without a +/// network round-trip. Every other group ships only its chart-card +/// shells — payloads are fetched client-side on first `details.toggle` +/// to keep the cold landing HTML small. struct LandingGroup { name: String, summary: Option, @@ -221,8 +220,8 @@ struct LandingGroup { /// the slugs server-side so the chart-card shell can carry /// `data-chart-slug` for the lazy fetch. chart_links: Vec, - /// Pre-fetched payloads. Populated only for the open-by-default group. - /// `Vec` indices line up with `chart_links`. + /// Pre-fetched payloads. Populated only for the first group in + /// canonical order. `Vec` indices line up with `chart_links`. inlined: Vec>, } @@ -263,7 +262,7 @@ fn collect_landing_groups(conn: &Connection) -> Result> { } v } else { - // Closed groups: ship only the shells. The client fetches on + // Other groups: ship only the shells. The client fetches on // first `details.toggle`. (0..group.charts.len()).map(|_| None).collect() }; diff --git a/benchmarks-website/server/static/chart-init.js b/benchmarks-website/server/static/chart-init.js index f7062e8d949..3b5e616c3e9 100644 --- a/benchmarks-website/server/static/chart-init.js +++ b/benchmarks-website/server/static/chart-init.js @@ -1235,7 +1235,8 @@ } // ----------------------------------------------------------------------- - // Lazy fetch on `
` toggle for closed-by-default groups. + // Lazy fetch on `
` toggle. Every group renders closed; this + // hydrates the chart cards inside whichever group the user expands. // ----------------------------------------------------------------------- function fetchAndConstruct(card) { var canvas = card.querySelector("canvas"); @@ -1243,9 +1244,8 @@ if (canvas.__bench_chart) return Promise.resolve(); // `constructChart` reads inline JSON (`