Skip to content

Commit 76ad4be

Browse files
bloveclaude
andcommitted
docs(gtm): refresh the nav cta_id register and make it self-checking
The taxonomy's Nav section documented `nav_get_started`, `nav_docs`, `nav_pricing`, `nav_github`, `nav_npm` and `nav_cockpit`. Three of those were already not emitted before the navbar rebuild, so this register had drifted silently — and the rebuild replaced almost all of the rest. Records the real set (twenty panel ids plus the bar's own), notes that every one also exists with a `mobile_nav_` prefix because `trackNavItem` applies the surface, and lists what retired: `nav_demo_langgraph` / `nav_demo_ag_ui` are now `nav_docs_demo_*` since the Demo dropdown was absorbed into the Docs panel. More usefully, `nav-config.spec.ts` now asserts the doc mentions every id the nav emits. The ids are data, so the register can be checked rather than trusted. Removing one from the doc fails the test naming it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent b6932e3 commit 76ad4be

2 files changed

Lines changed: 55 additions & 2 deletions

File tree

apps/website/src/components/shared/nav-config.spec.ts

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { existsSync } from 'node:fs';
1+
import { existsSync, readFileSync } from 'node:fs';
22
import { dirname, join } from 'node:path';
33
import { fileURLToPath } from 'node:url';
44
import { describe, expect, it } from 'vitest';
@@ -7,6 +7,11 @@ import { docsConfig } from '../../lib/docs-config';
77
import { getAllSolutionSlugs } from '../../lib/solutions-data';
88

99
const APP_ROOT = join(dirname(fileURLToPath(import.meta.url)), '..', '..', 'app');
10+
const TAXONOMY = join(
11+
dirname(fileURLToPath(import.meta.url)),
12+
'..', '..', '..', '..', '..',
13+
'docs', 'gtm', 'taxonomy.md',
14+
);
1015

1116
/**
1217
* `/docs/:library/:section/:slug` is a dynamic route, so a page file cannot
@@ -88,4 +93,24 @@ describe('nav-config', () => {
8893
'Pricing',
8994
]);
9095
});
96+
97+
/**
98+
* The GTM taxonomy is the register analytics work reads to know which
99+
* `cta_id`s exist. It is hand-maintained prose, and it had silently drifted
100+
* before the navbar rebuild — it still listed `nav_get_started`, `nav_npm`
101+
* and `nav_cockpit`, none of which the nav emitted any more.
102+
*
103+
* The nav's ids are data, so the doc can be checked against them instead of
104+
* trusted. Only the `nav_` surface is asserted: `mobile_nav_` is the same
105+
* list with a different prefix, applied by `trackNavItem`, and the doc says
106+
* so once rather than duplicating twenty entries.
107+
*/
108+
it('documents every nav cta_id in the GTM taxonomy', () => {
109+
const taxonomy = readFileSync(TAXONOMY, 'utf8');
110+
const undocumented = navItems()
111+
.map((item) => `nav_${item.ctaId}`)
112+
.filter((id) => !taxonomy.includes(id));
113+
114+
expect(undocumented).toEqual([]);
115+
});
91116
});

docs/gtm/taxonomy.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,35 @@ Browser events never fire unless the consumer explicitly opts in. See `libs/tele
158158

159159
**Nav**
160160

161-
- `nav_get_started` `nav_docs` `nav_pricing` `nav_github` `nav_npm` `nav_cockpit`
161+
The navbar was rebuilt on 2026-09-08 into four triggers, three of which open panels.
162+
Every panel destination is data in `apps/website/src/components/shared/nav-config.ts`,
163+
and `trackNavItem` prefixes each item's `ctaId` with the surface — so **every id below
164+
also exists with a `mobile_nav_` prefix**, emitted by the same items in the mobile
165+
drill-in drawer. Add a destination there and its id appears on both surfaces
166+
automatically; there is no second list to keep in sync.
167+
168+
- Libraries panel — `nav_libraries_langgraph` `nav_libraries_ag_ui` `nav_libraries_chat`
169+
`nav_libraries_render` `nav_libraries_choosing_an_adapter`
170+
- Docs panel — `nav_docs_documentation` `nav_docs_quick_start`
171+
`nav_docs_choosing_an_adapter` `nav_docs_guides` `nav_docs_concepts`
172+
`nav_docs_api_reference`
173+
- Docs panel, external demos — `nav_docs_demo_langgraph` `nav_docs_demo_ag_ui`
174+
(derived from `DEMOS` in `lib/demos.ts`, so a new demo adds its own id)
175+
- Solutions panel — `nav_solutions_customer_support` `nav_solutions_analytics`
176+
`nav_solutions_compliance` `nav_solutions_pilot_to_prod` `nav_solutions_blog`
177+
`nav_solutions_about`
178+
- Bar itself — `nav_pricing` `nav_github` `nav_talk_to_us`
179+
- Mobile drawer only — `mobile_nav_docs_page` (any link inside the docs tree, with the
180+
page title in `cta_text` and the library in `library`)
181+
182+
- retired 2026-09-08: `nav_demo_langgraph` `nav_demo_ag_ui` (the hand-rolled `Demo ▾`
183+
dropdown was absorbed into the Docs panel — the demos are now
184+
`nav_docs_demo_langgraph` / `nav_docs_demo_ag_ui`); `nav_docs` (now
185+
`nav_docs_documentation`); `nav_pilot_to_prod` (now `nav_solutions_pilot_to_prod`)
186+
- retired earlier, date unknown: `nav_get_started` `nav_npm` `nav_cockpit` — these were
187+
already listed here but no longer emitted by the pre-redesign nav either, so this
188+
section had drifted before the rebuild. Recorded rather than silently dropped, in case
189+
a dashboard still filters them.
162190

163191
**Footer**
164192

0 commit comments

Comments
 (0)