Skip to content

Commit bf67229

Browse files
fix(compare): clarify narrative is anchored to slug defaults (Bugbot #5)
Bugbot flagged that the SSR narrative doesn't recompute when a reader changes model/sequence/precision client-side (the table and chart do). Making the narrative client-reactive would require duplicating the interpolation pipeline on the client; the SSR text is also the SEO payload and must remain server-rendered. Mitigate with an inline italicized caveat appended to the narrative on both routes: "(Numbers reflect the default <sequence> · <precision> selection for this URL — table and chart below update if you change sequence, precision, or model in the controls.)" — sets reader expectations without losing the indexable prose. JSDoc on compareTableNarrative documents the design choice. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 6dd0f62 commit bf67229

3 files changed

Lines changed: 22 additions & 3 deletions

File tree

packages/app/src/app/compare-per-dollar/[slug]/page-client.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,12 @@ export default function ComparePerDollarPageClient({
143143
className="mt-3 text-sm text-foreground/80 max-w-3xl"
144144
data-testid="compare-per-dollar-narrative"
145145
>
146-
{narrative}
146+
{narrative}{' '}
147+
<span className="text-muted-foreground italic">
148+
(Numbers reflect the default {defaultSequence ?? 'sequence'} ·{' '}
149+
{defaultPrecision ?? 'precision'} selection for this URL — table and chart below
150+
update if you change sequence, precision, or model in the controls.)
151+
</span>
147152
</p>
148153
)}
149154
{(aCostPerGpuHr > 0 || bCostPerGpuHr > 0) && (

packages/app/src/app/compare/[slug]/page-client.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,12 @@ export default function ComparePageClient({
120120
className="mt-3 text-sm text-foreground/80 max-w-3xl"
121121
data-testid="compare-narrative"
122122
>
123-
{narrative}
123+
{narrative}{' '}
124+
<span className="text-muted-foreground italic">
125+
(Numbers reflect the default {defaultSequence ?? 'sequence'} ·{' '}
126+
{defaultPrecision ?? 'precision'} selection for this URL — table and chart below
127+
update if you change sequence, precision, or model in the controls.)
128+
</span>
124129
</p>
125130
)}
126131
<p className="mt-2 text-sm">

packages/app/src/lib/compare-ssr.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,16 @@ function fmtPctDelta(ratio: number): string {
338338
* the points readers care about), or falls back to a single-GPU description
339339
* at the mid row if there's no overlap. Template differs by variant —
340340
* `'full'` mentions both cost and throughput; `'per-dollar'` focuses on cost
341-
* and references the table for the rest. */
341+
* and references the table for the rest.
342+
*
343+
* The returned prose anchors to the SSR'd default model / sequence /
344+
* precision — i.e. the slug's canonical operating point. The chart and
345+
* interpolated table beneath the narrative re-render on client-side filter
346+
* changes; the narrative does not. This is intentional: the URL slug *is*
347+
* the canonical view, and the narrative is the canonical view's prose
348+
* summary. The caller adds a small "(default configuration)" caveat after
349+
* the narrative so a reader who fiddles with the chart controls sees that
350+
* the narrative is fixed to the slug's defaults. */
342351
export function compareTableNarrative(
343352
variant: CompareJsonLdVariant,
344353
modelLabel: string,

0 commit comments

Comments
 (0)