diff --git a/next.config.ts b/next.config.ts index 1c5468f..64ec06a 100644 --- a/next.config.ts +++ b/next.config.ts @@ -30,6 +30,16 @@ const nextConfig: NextConfig = { destination: "/builders/:slug", permanent: true, }, + { + source: "/economic-indicators", + destination: "/prosperity-dashboard", + permanent: true, + }, + { + source: "/economic-indicators/:path*", + destination: "/prosperity-dashboard/:path*", + permanent: true, + }, ]; }, async rewrites() { diff --git a/src/app/api/economy/series/route.ts b/src/app/api/economy/series/route.ts index 37d971f..30fec77 100644 --- a/src/app/api/economy/series/route.ts +++ b/src/app/api/economy/series/route.ts @@ -1,6 +1,6 @@ import { NextRequest, NextResponse } from "next/server"; import { getEconomicSeries } from "@/lib/api/economy"; -import { MEASURE_SLUGS } from "@/app/economic-indicators/indicators"; +import { MEASURE_SLUGS } from "@/app/prosperity-dashboard/indicators"; // Same-origin proxy for york_factory's public series endpoint so client // components (the canvas page) can fetch without cross-origin config. The diff --git a/src/app/economic-indicators/CombinedSectionChart.tsx b/src/app/prosperity-dashboard/CombinedSectionChart.tsx similarity index 98% rename from src/app/economic-indicators/CombinedSectionChart.tsx rename to src/app/prosperity-dashboard/CombinedSectionChart.tsx index fb8ef91..7a1e22e 100644 --- a/src/app/economic-indicators/CombinedSectionChart.tsx +++ b/src/app/prosperity-dashboard/CombinedSectionChart.tsx @@ -162,7 +162,7 @@ export default function CombinedSectionChart({ return (
{grapherState ? (
diff --git a/src/app/economic-indicators/CombinedSectionChartClient.tsx b/src/app/prosperity-dashboard/CombinedSectionChartClient.tsx similarity index 81% rename from src/app/economic-indicators/CombinedSectionChartClient.tsx rename to src/app/prosperity-dashboard/CombinedSectionChartClient.tsx index 5935577..4b8e4a5 100644 --- a/src/app/economic-indicators/CombinedSectionChartClient.tsx +++ b/src/app/prosperity-dashboard/CombinedSectionChartClient.tsx @@ -9,7 +9,7 @@ const CombinedSectionChart = dynamic(() => import("./CombinedSectionChart"), { loading: () => ( // Mirrors the useChartSize clamp so deep-link hash scrolls stay accurate // when the placeholder swaps for the real chart. -
+
), }); diff --git a/src/app/economic-indicators/IndicatorChart.tsx b/src/app/prosperity-dashboard/IndicatorChart.tsx similarity index 98% rename from src/app/economic-indicators/IndicatorChart.tsx rename to src/app/prosperity-dashboard/IndicatorChart.tsx index d3f1027..ba15871 100644 --- a/src/app/economic-indicators/IndicatorChart.tsx +++ b/src/app/prosperity-dashboard/IndicatorChart.tsx @@ -168,7 +168,7 @@ export default function IndicatorChart({ // axis and right-edge labels get clipped unless the svg can overflow.
{grapherState ? (
diff --git a/src/app/economic-indicators/IndicatorChartClient.tsx b/src/app/prosperity-dashboard/IndicatorChartClient.tsx similarity index 79% rename from src/app/economic-indicators/IndicatorChartClient.tsx rename to src/app/prosperity-dashboard/IndicatorChartClient.tsx index 4591b9d..919c5ee 100644 --- a/src/app/economic-indicators/IndicatorChartClient.tsx +++ b/src/app/prosperity-dashboard/IndicatorChartClient.tsx @@ -9,7 +9,7 @@ const IndicatorChart = dynamic(() => import("./IndicatorChart"), { loading: () => ( // Mirrors the useChartSize clamp so deep-link hash scrolls stay accurate // when the placeholder swaps for the real chart. -
+
), }); diff --git a/src/app/economic-indicators/SectionNav.tsx b/src/app/prosperity-dashboard/SectionNav.tsx similarity index 93% rename from src/app/economic-indicators/SectionNav.tsx rename to src/app/prosperity-dashboard/SectionNav.tsx index 65d9ce4..547ae1a 100644 --- a/src/app/economic-indicators/SectionNav.tsx +++ b/src/app/prosperity-dashboard/SectionNav.tsx @@ -10,7 +10,7 @@ export default function SectionNav({ currentId }: { currentId?: string }) { >
s.id === sectionId); - const title = section?.title ?? "Economic Indicators"; + const title = section?.title ?? "Prosperity Dashboard"; const description = section?.description ?? "Are we moving in the right direction? Canadian prosperity, measured against the G7 and OECD."; @@ -43,12 +43,12 @@ export default async function OpengraphImage({ const footnote = source ? `Source: ${humanizeSourceName(source.name)}` : ""; const fonts = await loadOgFonts( - `${title}${description}${chartHeading}${chart?.latestLabel ?? ""}${footnote}Economic Indicators`, + `${title}${description}${chartHeading}${chart?.latestLabel ?? ""}${footnote}Prosperity Dashboard`, ); return new ImageResponse( s.id === sectionId); if (!section) return {}; - const title = `${section.title} — Economic Indicators`; + const title = `${section.title} — Prosperity Dashboard`; return { title, description: section.description, - alternates: { canonical: `/economic-indicators/${section.id}` }, + alternates: { canonical: `/prosperity-dashboard/${section.id}` }, openGraph: { title, description: section.description, @@ -131,7 +131,7 @@ export default async function IndicatorSectionPage({ params }: PageProps) { const jsonLd = buildGraph( generateOrganizationSchema(configData), generateBreadcrumbSchema( - `/economic-indicators/${section.id}`, + `/prosperity-dashboard/${section.id}`, section.title, configData.siteUrl, ), @@ -240,7 +240,7 @@ export default async function IndicatorSectionPage({ params }: PageProps) { > {prev ? ( ← {prev.title} @@ -250,7 +250,7 @@ export default async function IndicatorSectionPage({ params }: PageProps) { )} {next ? ( {next.title} → diff --git a/src/app/economic-indicators/canvas/CanvasClient.tsx b/src/app/prosperity-dashboard/canvas/CanvasClient.tsx similarity index 99% rename from src/app/economic-indicators/canvas/CanvasClient.tsx rename to src/app/prosperity-dashboard/canvas/CanvasClient.tsx index 6f2c425..c20ad5e 100644 --- a/src/app/economic-indicators/canvas/CanvasClient.tsx +++ b/src/app/prosperity-dashboard/canvas/CanvasClient.tsx @@ -111,7 +111,7 @@ export default function CanvasClient() { const params = new URLSearchParams(); params.set("f", serializeFeeds(resolvedFeeds)); if (mode !== "indexed") params.set("mode", mode); - const next = `/economic-indicators/canvas?${params.toString()}`; + const next = `/prosperity-dashboard/canvas?${params.toString()}`; if (`${window.location.pathname}${window.location.search}` !== next) { window.history.replaceState(null, "", next); } diff --git a/src/app/economic-indicators/canvas/OverlayChart.tsx b/src/app/prosperity-dashboard/canvas/OverlayChart.tsx similarity index 100% rename from src/app/economic-indicators/canvas/OverlayChart.tsx rename to src/app/prosperity-dashboard/canvas/OverlayChart.tsx diff --git a/src/app/economic-indicators/canvas/opengraph-image.tsx b/src/app/prosperity-dashboard/canvas/opengraph-image.tsx similarity index 98% rename from src/app/economic-indicators/canvas/opengraph-image.tsx rename to src/app/prosperity-dashboard/canvas/opengraph-image.tsx index 65229f4..f34c658 100644 --- a/src/app/economic-indicators/canvas/opengraph-image.tsx +++ b/src/app/prosperity-dashboard/canvas/opengraph-image.tsx @@ -52,7 +52,7 @@ export default async function OpengraphImage() { return new ImageResponse(
- ← All economic indicators + ← Prosperity Dashboard
diff --git a/src/app/economic-indicators/indicators.ts b/src/app/prosperity-dashboard/indicators.ts similarity index 99% rename from src/app/economic-indicators/indicators.ts rename to src/app/prosperity-dashboard/indicators.ts index a9c710f..3cb95a0 100644 --- a/src/app/economic-indicators/indicators.ts +++ b/src/app/prosperity-dashboard/indicators.ts @@ -1,5 +1,5 @@ // Shared catalog of the economic indicator measures served by york_factory's -// /kpis/series endpoint — each section gets its own /economic-indicators/[section] +// /kpis/series endpoint — each section gets its own /prosperity-dashboard/[section] // page and the canvas page uses the flat list as the feed picker. export type Indicator = { diff --git a/src/app/economic-indicators/og-card.tsx b/src/app/prosperity-dashboard/og-card.tsx similarity index 99% rename from src/app/economic-indicators/og-card.tsx rename to src/app/prosperity-dashboard/og-card.tsx index 3b73de5..2769489 100644 --- a/src/app/economic-indicators/og-card.tsx +++ b/src/app/prosperity-dashboard/og-card.tsx @@ -2,7 +2,7 @@ import type { EconomySeriesResponse } from "@/lib/api/economy"; import { CANADA_COLOR } from "./indicators"; import { formatValue } from "./units"; -// Shared plumbing for the /economic-indicators opengraph images: one branded +// Shared plumbing for the /prosperity-dashboard opengraph images: one branded // card layout plus builders that bake a series into a data-URI SVG. Satori // lays out the text; the chart travels as an so resvg rasterizes real // vector paths instead of satori's partial SVG support. diff --git a/src/app/economic-indicators/opengraph-image.tsx b/src/app/prosperity-dashboard/opengraph-image.tsx similarity index 91% rename from src/app/economic-indicators/opengraph-image.tsx rename to src/app/prosperity-dashboard/opengraph-image.tsx index 9d22d31..1d3fbe1 100644 --- a/src/app/economic-indicators/opengraph-image.tsx +++ b/src/app/prosperity-dashboard/opengraph-image.tsx @@ -11,7 +11,7 @@ import { export const runtime = "nodejs"; export const alt = - "Build Canada — Economic Indicators: Canadian prosperity, measured against the G7 and OECD"; + "Build Canada — Prosperity Dashboard: Canadian prosperity, measured against the G7 and OECD"; export const size = OG_SIZE; @@ -22,7 +22,7 @@ export const revalidate = 3600; // The landing card leads with the dashboard's clearest single chart. const FEATURED_SLUG = "gdp-per-capita-ppp"; -const TITLE = "Economic Indicators"; +const TITLE = "Prosperity Dashboard"; const DESCRIPTION = "Are we moving in the right direction? Canadian prosperity, measured against the G7 and OECD."; diff --git a/src/app/economic-indicators/page.tsx b/src/app/prosperity-dashboard/page.tsx similarity index 59% rename from src/app/economic-indicators/page.tsx rename to src/app/prosperity-dashboard/page.tsx index 1ea42cd..a1fd4b0 100644 --- a/src/app/economic-indicators/page.tsx +++ b/src/app/prosperity-dashboard/page.tsx @@ -14,21 +14,21 @@ const DESCRIPTION = "Are we moving in the right direction? Canada's growth, incomes, housing, safety, and wellbeing, measured against the G7 and OECD."; export const metadata: Metadata = { - title: "Economic Indicators", + title: "Prosperity Dashboard", description: DESCRIPTION, - alternates: { canonical: "/economic-indicators" }, + alternates: { canonical: "/prosperity-dashboard" }, openGraph: { - title: "Economic Indicators", + title: "Prosperity Dashboard", description: DESCRIPTION, type: "website", }, twitter: { card: "summary_large_image", - title: "Economic Indicators", + title: "Prosperity Dashboard", }, }; -export default async function EconomicIndicatorsPage() { +export default async function ProsperityDashboardPage() { const configData = getSiteConfig(); const featuredSeries = await Promise.all( @@ -40,8 +40,8 @@ export default async function EconomicIndicatorsPage() { const jsonLd = buildGraph( generateOrganizationSchema(configData), generateBreadcrumbSchema( - "/economic-indicators", - "Economic Indicators", + "/prosperity-dashboard", + "Prosperity Dashboard", configData.siteUrl, ), ); @@ -53,36 +53,14 @@ export default async function EconomicIndicatorsPage() { dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }} />
-
-

- - Canada should be the most prosperous country in the world. - {" "} - The question - is whether we are turning those advantages into better lives — - and that is measurable. -

-

- Prosperity is more than a growing GDP. It’s paycheques - that buy more each year, homes people can afford, streets that - are safe, air that is clean, institutions worth trusting, and - lives people are satisfied with, confident enough in the - future to build one here. That is what these charts measure. -

-

- Where the world offers a yardstick, Canada is the red line - against its G7 and OECD peers. Where the question is ours alone, how many homes we start, how fast people climb out of low income, we measure Canada against its own record. Every chart - asks the same question: are we moving in the right direction? -

-
+
{SECTIONS.map((section, i) => { @@ -93,15 +71,12 @@ export default async function EconomicIndicatorsPage() { return (

{section.title}

-

- {section.description} -

{preview && (

@@ -124,21 +99,6 @@ export default async function EconomicIndicatorsPage() { ); })} - -

- Indicator Canvas -

-

- Overlay up to three indicator series and eyeball how they move - together. -

- - Open the canvas → - -
@@ -151,7 +111,7 @@ export default async function EconomicIndicatorsPage() { — tell us and we’ll track it.

Email us diff --git a/src/app/economic-indicators/units.ts b/src/app/prosperity-dashboard/units.ts similarity index 100% rename from src/app/economic-indicators/units.ts rename to src/app/prosperity-dashboard/units.ts diff --git a/src/app/economic-indicators/useChartSize.ts b/src/app/prosperity-dashboard/useChartSize.ts similarity index 55% rename from src/app/economic-indicators/useChartSize.ts rename to src/app/prosperity-dashboard/useChartSize.ts index 41a376e..dfc568f 100644 --- a/src/app/economic-indicators/useChartSize.ts +++ b/src/app/prosperity-dashboard/useChartSize.ts @@ -13,8 +13,16 @@ export function useChartSize() { const el = containerRef.current; if (!el) return; const measure = () => { - const w = Math.min(1040, Math.max(320, el.clientWidth - 16)); - const h = Math.max(320, Math.min(460, Math.round(w * 0.5))); + // Never exceed the container: a floor above the phone-width inner size + // (~264px on a 320px screen) would overflow and clip the right edge. + const w = Math.min(1040, Math.max(240, el.clientWidth - 16)); + // Portrait-ish on phones — Grapher's line legend eats up to a third of + // the width there, so extra height keeps the plot area readable. Wide + // 2:1 on larger screens. + const h = + w < 480 + ? Math.max(320, Math.min(400, Math.round(w * 1.05))) + : Math.max(320, Math.min(460, Math.round(w * 0.5))); setSize({ width: w, height: h }); }; measure(); diff --git a/src/app/sitemap.ts b/src/app/sitemap.ts index 5245bb0..21887af 100644 --- a/src/app/sitemap.ts +++ b/src/app/sitemap.ts @@ -8,7 +8,7 @@ import type { import { getBillsFromCivicsProject } from "@/app/bills/server/get-all-bills-from-civics-project"; import { getAllBillsFromDB } from "@/app/bills/server/get-all-bills-from-db"; import { buildAbsoluteUrl } from "@/app/bills/utils/basePath"; -import { SECTIONS as ECONOMIC_SECTIONS } from "@/app/economic-indicators/indicators"; +import { SECTIONS as ECONOMIC_SECTIONS } from "@/app/prosperity-dashboard/indicators"; function toValidDate(value?: Date | string): Date | undefined { if (!value) return undefined; @@ -24,14 +24,14 @@ export default async function sitemap(): Promise { { url: `${baseUrl}/memos`, lastModified: new Date(), changeFrequency: "daily", priority: 0.9 }, { url: `${baseUrl}/posts`, lastModified: new Date(), changeFrequency: "daily", priority: 0.8 }, { url: `${baseUrl}/projects`, lastModified: new Date(), changeFrequency: "weekly", priority: 0.8 }, - { url: `${baseUrl}/economic-indicators`, lastModified: new Date(), changeFrequency: "weekly", priority: 0.7 }, + { url: `${baseUrl}/prosperity-dashboard`, lastModified: new Date(), changeFrequency: "weekly", priority: 0.7 }, ...ECONOMIC_SECTIONS.map((section) => ({ - url: `${baseUrl}/economic-indicators/${section.id}`, + url: `${baseUrl}/prosperity-dashboard/${section.id}`, lastModified: new Date(), changeFrequency: "weekly" as const, priority: 0.6, })), - { url: `${baseUrl}/economic-indicators/canvas`, lastModified: new Date(), changeFrequency: "weekly", priority: 0.5 }, + { url: `${baseUrl}/prosperity-dashboard/canvas`, lastModified: new Date(), changeFrequency: "weekly", priority: 0.5 }, { url: `${baseUrl}/tracker`, lastModified: new Date(), changeFrequency: "weekly", priority: 0.8 }, { url: `${baseUrl}/tracker/commitments`, lastModified: new Date(), changeFrequency: "weekly", priority: 0.7 }, { url: `${baseUrl}/tracker/faq`, lastModified: new Date(), changeFrequency: "monthly", priority: 0.4 }, diff --git a/src/components/custom/signpost/config.ts b/src/components/custom/signpost/config.ts index 36edb6c..d739518 100644 --- a/src/components/custom/signpost/config.ts +++ b/src/components/custom/signpost/config.ts @@ -14,7 +14,7 @@ export interface SignpostProps { shareTitle?: string; shareUrl?: string; // Pages with an extra sticky bar below the global navbar (e.g. the - // economic-indicators section nav) push the rail and scroll target down, + // prosperity-dashboard section nav) push the rail and scroll target down, // and may already have their own narrow-screen navigation. desktopTopClass?: string; scrollOffset?: number; diff --git a/src/lib/schemas/generators/breadcrumb.ts b/src/lib/schemas/generators/breadcrumb.ts index ef42646..c0d855f 100644 --- a/src/lib/schemas/generators/breadcrumb.ts +++ b/src/lib/schemas/generators/breadcrumb.ts @@ -3,7 +3,7 @@ const ROUTE_LABELS: Record = { about: "About", projects: "Projects", content: "Content", - "economic-indicators": "Economic Indicators", + "prosperity-dashboard": "Prosperity Dashboard", }; export function generateBreadcrumbSchema(