From 5d6ae7946bfdf01393e3e4c1a586bb4243466ee8 Mon Sep 17 00:00:00 2001 From: Josh Knapp Date: Sun, 12 Jul 2026 20:56:11 -0700 Subject: [PATCH] =?UTF-8?q?fix(builder):=20item=2015=20=E2=80=94=20default?= =?UTF-8?q?=20header=20nav=20no=20longer=20links=20nonexistent=20pages?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DEFAULT_HEADER_STATE's Navbar linked Home/About/Services/Contact, but a brand new site only has a Home page — About/Services/Contact were dead links on first click. Simplified the default to Home + an inert "Get Started" CTA (href: '#') rather than seeding placeholder pages nobody asked for. Updated default-header.test.ts's HTML-export assertions to match the new default (and assert the removed links are gone). Co-Authored-By: Claude Opus 4.8 (1M context) --- craft/src/state/PageContext.tsx | 11 ++++++++--- craft/src/state/default-header.test.ts | 8 +++++++- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/craft/src/state/PageContext.tsx b/craft/src/state/PageContext.tsx index 946b890..b18e3bd 100644 --- a/craft/src/state/PageContext.tsx +++ b/craft/src/state/PageContext.tsx @@ -119,6 +119,13 @@ export function treeToCraftState(tree: SerializedTreeNode): string { // Container), so there was no menu to edit and the empty zone rendered as a // stray band above the page. Seeding a real Navbar gives every new site an // editable menu-with-links out of the box (and removes the empty-header gap). +// +// Item 15: the nav used to link Home/About/Services/Contact, but a brand +// new site only has a "Home" page -- About/Services/Contact were dead links +// on first click. Rather than seeding three empty placeholder pages nobody +// asked for, the simpler default is a nav with just the one real page (Home) +// plus a CTA button, which is inert (`href: '#'`) rather than pointing at a +// page that doesn't exist. Users add pages/links as their site grows. // Node shape matches treeToCraftState() / Craft's actions.deserialize(). export const DEFAULT_HEADER_STATE = JSON.stringify({ ROOT: { @@ -144,9 +151,7 @@ export const DEFAULT_HEADER_STATE = JSON.stringify({ logoFontSize: '20px', links: [ { text: 'Home', href: '/' }, - { text: 'About', href: '#about' }, - { text: 'Services', href: '#services' }, - { text: 'Contact', href: '#contact', isCta: true }, + { text: 'Get Started', href: '#', isCta: true }, ], backgroundColor: '#ffffff', textColor: '#3f3f46', diff --git a/craft/src/state/default-header.test.ts b/craft/src/state/default-header.test.ts index bd325b8..f28bcaf 100644 --- a/craft/src/state/default-header.test.ts +++ b/craft/src/state/default-header.test.ts @@ -23,8 +23,14 @@ describe('DEFAULT_HEADER_STATE seed', () => { const { html } = exportBodyHtml(DEFAULT_HEADER_STATE); expect(html).toContain('