From 5ded14057f3ce85c18286bcb61d4425149eefc2c Mon Sep 17 00:00:00 2001 From: Flotapponnier <160007691+Flotapponnier@users.noreply.github.com> Date: Fri, 19 Jun 2026 13:47:20 +0300 Subject: [PATCH] fix(bench): resolve {{p50:slug}} placeholders on overlayEditorial fast path (#571) --- src/lib/spec.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/lib/spec.ts b/src/lib/spec.ts index 341de948..bcafcb6a 100644 --- a/src/lib/spec.ts +++ b/src/lib/spec.ts @@ -71,7 +71,7 @@ async function benchFromStore( * untouched. */ function overlayEditorial(stored: Benchmark, spec: Spec): Benchmark { - return { + const overlaid: Benchmark = { ...stored, seoTitle: spec.seo_title ?? stored.seoTitle, seoDescription: spec.seo_description ?? stored.seoDescription, @@ -91,6 +91,15 @@ function overlayEditorial(stored: Benchmark, spec: Spec): Benchmark { // worker to rewrite the snapshot. dimensions: spec.dimensions ?? stored.dimensions, }; + // Resolve `{{p50:slug}}`, `{{name:slug}}`, `{{best_name}}` etc. in the + // overlaid editorial text. Without this, a YAML edit that ships AHEAD + // of the next materialise sweep renders literal `{{p50:geckoterminal}}` + // tokens on the page because the stored snapshot was rendered against + // an older spec text (or never rendered at all on the fast path that + // hits overlayEditorial directly). The materialise sweep also passes + // its output through renderBenchmarkText; calling it here on the + // fallback path keeps the two paths consistent. + return renderBenchmarkText(overlaid); } // Per-bench unfiltered cache. ONE unstable_cache entry per slug so a