From 33b29d69bd1dc2cb8ca28acfcb6657481ca9438f Mon Sep 17 00:00:00 2001 From: Sweets Sweetman Date: Tue, 7 Jul 2026 18:04:39 -0500 Subject: [PATCH] feat: prefer the Weekly valuation + streams report starter template The homepage starter task now reaches for the new valuation report template first (the video's hero flow), keeping Weekly Performance Dashboard and any Report-tagged template as fallbacks so the card never disappears while the new template rolls out (chat#1850). Co-Authored-By: Claude Fable 5 --- .../__tests__/findStarterTemplate.test.ts | 19 ++++++++++++++++++- lib/home/findStarterTemplate.ts | 19 ++++++++++++------- 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/lib/home/__tests__/findStarterTemplate.test.ts b/lib/home/__tests__/findStarterTemplate.test.ts index 36a2bc7bd..430f566c5 100644 --- a/lib/home/__tests__/findStarterTemplate.test.ts +++ b/lib/home/__tests__/findStarterTemplate.test.ts @@ -18,7 +18,24 @@ const template = (over: Partial): AgentTemplateRow => }) as AgentTemplateRow; describe("findStarterTemplate", () => { - it("prefers the Weekly Performance Dashboard template", () => { + it("prefers the weekly valuation + streams template above all others", () => { + const templates = [ + template({ id: "a", title: "Run Performance Report", tags: ["Report"] }), + template({ + id: "b", + title: "Weekly Performance Dashboard", + tags: ["Report"], + }), + template({ + id: "c", + title: "Weekly valuation + streams report", + tags: ["Report"], + }), + ]; + expect(findStarterTemplate(templates)?.id).toBe("c"); + }); + + it("falls back to the Weekly Performance Dashboard template", () => { const templates = [ template({ id: "a", title: "Run Performance Report", tags: ["Report"] }), template({ diff --git a/lib/home/findStarterTemplate.ts b/lib/home/findStarterTemplate.ts index 78c014f28..5c2c75095 100644 --- a/lib/home/findStarterTemplate.ts +++ b/lib/home/findStarterTemplate.ts @@ -1,20 +1,25 @@ import type { AgentTemplateRow } from "@/types/AgentTemplates"; -const PREFERRED_TITLE = "Weekly Performance Dashboard"; +/** Most-preferred first — the valuation report is the video's hero flow (chat#1850). */ +const PREFERRED_TITLES = [ + "Weekly valuation + streams report", + "Weekly Performance Dashboard", +]; /** * Picks the agent template behind the homepage starter task (DRY — the * task's prompt comes from the existing /agents templates, never a * hand-written string; recoupable/chat#1850 review). Prefers the weekly - * dashboard template, falls back to any Report-tagged agent, and returns - * undefined (card hidden) when none exist. + * valuation report, then the weekly dashboard, falls back to any + * Report-tagged agent, and returns undefined (card hidden) when none exist. */ export function findStarterTemplate( templates: AgentTemplateRow[] | undefined, ): AgentTemplateRow | undefined { if (!templates?.length) return undefined; - return ( - templates.find((t) => t.title === PREFERRED_TITLE) ?? - templates.find((t) => (t.tags ?? []).includes("Report")) - ); + for (const title of PREFERRED_TITLES) { + const match = templates.find((t) => t.title === title); + if (match) return match; + } + return templates.find((t) => (t.tags ?? []).includes("Report")); }