Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

derive the last eight hand-maintained page tab lists from the nav manifest (#6383)

[._.]/ Adam Eivyf02d47d10332
diff --git a/client/src/components/brain/constants.js b/client/src/components/brain/constants.js
index bfb6ccfdaa..d47904a466 100644
--- a/client/src/components/brain/constants.js
+++ b/client/src/components/brain/constants.js
@@ -1,25 +1,31 @@
import { MessageSquare, Database, Calendar, Rss, Shield, Users, FolderKanban, Lightbulb, ClipboardList, Settings, Link2, BookOpen, Network, FileText, NotebookPen, Upload, Target, BookText, Music, Video } from 'lucide-react';
+import { getPageNavTabs } from '../../../../server/lib/navManifest.js';
+import { buildPageNavTabs } from '../../lib/pageNavTabs.js';
-// Main navigation tabs.
-// `fullBleed: true` marks a tab that fills the available height and owns its
-// own internal scroll — Brain renders these inside an overflow-hidden wrapper
-// with no padding (the rest scroll inside a padded wrapper). See issue #1177.
-export const TABS = [
- { id: 'inbox', label: 'Inbox', icon: MessageSquare },
- { id: 'ideas', label: 'Ideas', icon: Lightbulb },
- { id: 'daily-log', label: 'Daily Log', icon: NotebookPen, fullBleed: true },
- { id: 'links', label: 'Links', icon: Link2 },
- { id: 'memory', label: 'Memory', icon: Database },
- { id: 'notes', label: 'Notes', icon: FileText, fullBleed: true },
- { id: 'graph', label: 'Graph', icon: Network, fullBleed: true },
- { id: 'digest', label: 'Digest', icon: Calendar },
- { id: 'feeds', label: 'Feeds', icon: Rss },
- { id: 'trust', label: 'Trust', icon: Shield },
- { id: 'import', label: 'Import', icon: Upload },
- { id: 'spotify', label: 'Spotify', icon: Music },
- { id: 'youtube', label: 'YouTube', icon: Video },
- { id: 'config', label: 'Config', icon: Settings }
-];
+// Icon + layout per tab id. The manifest (`tabGroup: 'brain'`) owns id/label/
+// order — this file owns only how each tab looks. `fullBleed: true` marks a tab
+// that fills the available height and owns its own internal scroll: Brain
+// renders those inside an overflow-hidden wrapper with no padding (the rest
+// scroll inside a padded wrapper). See issue #1177. Throws at import time on
+// drift between the manifest and this map.
+const TAB_PRESENTATION = {
+ inbox: { icon: MessageSquare },
+ ideas: { icon: Lightbulb },
+ 'daily-log': { icon: NotebookPen, fullBleed: true },
+ links: { icon: Link2 },
+ memory: { icon: Database },
+ notes: { icon: FileText, fullBleed: true },
+ graph: { icon: Network, fullBleed: true },
+ digest: { icon: Calendar },
+ feeds: { icon: Rss },
+ trust: { icon: Shield },
+ import: { icon: Upload },
+ spotify: { icon: Music },
+ youtube: { icon: Video },
+ config: { icon: Settings },
+};
+
+export const TABS = buildPageNavTabs(getPageNavTabs('brain'), TAB_PRESENTATION, 'Brain');
// Tab ids that render full-bleed (derived from TABS so the list can't drift).
export const FULL_BLEED_TAB_IDS = new Set(TABS.filter((t) => t.fullBleed).map((t) => t.id));
diff --git a/client/src/components/brain/constants.test.js b/client/src/components/brain/constants.test.js
index 773f642ec4..0860ab9adf 100644
--- a/client/src/components/brain/constants.test.js
+++ b/client/src/components/brain/constants.test.js
@@ -1,5 +1,6 @@
import { describe, expect, it } from 'vitest';
-import { MEMORY_TABS, TABS } from './constants';
+import { FULL_BLEED_TAB_IDS, MEMORY_TABS, TABS } from './constants';
+import { expectPageNavTabs } from '../../test/pageNavTabAssertions.js';
describe('Brain navigation', () => {
it('keeps native Ideas on its dedicated URL-backed Brain tab', () => {
@@ -7,3 +8,22 @@ describe('Brain navigation', () => {
expect(MEMORY_TABS.map(({ id }) => id)).not.toContain('ideas');
});
});
+
+// Brain derives its tab bar from the nav manifest's `tabGroup: 'brain'` (#6383)
+// — this pins the id/label/order the page means to render, and that every
+// manifest tab has a presentation entry (icon, `fullBleed`) in constants.js,
+// which would otherwise only surface as a thrown import-time error.
+describe('Brain TABS ↔ nav manifest', () => {
+ it('renders the brain tabGroup in page order with a presentation entry each', () => {
+ expectPageNavTabs(TABS, [
+ 'inbox:Inbox', 'ideas:Ideas', 'daily-log:Daily Log', 'links:Links',
+ 'memory:Memory', 'notes:Notes', 'graph:Graph', 'digest:Digest',
+ 'feeds:Feeds', 'trust:Trust', 'import:Import', 'spotify:Spotify',
+ 'youtube:YouTube', 'config:Config',
+ ]);
+ });
+
+ it('keeps the full-bleed set derived from the presentation map', () => {
+ expect([...FULL_BLEED_TAB_IDS].sort()).toEqual(['daily-log', 'graph', 'notes']);
+ });
+});
diff --git a/client/src/components/cos/constants.js b/client/src/components/cos/constants.js
index 58c0e55c9c..1daba96312 100644
--- a/client/src/components/cos/constants.js
+++ b/client/src/components/cos/constants.js
@@ -19,25 +19,31 @@ import {
import { normalizeReviewerSlug, REVIEWER_VALUES } from '../../lib/reviewerPins';
import { AVATAR_STYLE_LABELS } from '../../lib/avatarStyles';
import { inPlaceClipName } from '../../utils/animationClips';
+import { getPageNavTabs } from '../../../../server/lib/navManifest.js';
+import { buildPageNavTabs } from '../../lib/pageNavTabs.js';
+
+// Icon per tab id. The manifest (`tabGroup: 'cos'`) owns id/label/order — this
+// file owns only how each tab looks. Throws at import time on drift.
+const TAB_PRESENTATION = {
+ briefing: { icon: Newspaper },
+ tasks: { icon: FileText },
+ agents: { icon: Cpu },
+ jobs: { icon: Bot },
+ runs: { icon: Play },
+ 'run-events': { icon: ScrollText },
+ schedule: { icon: Clock },
+ workflow: { icon: ChartGantt },
+ digest: { icon: Calendar },
+ gsd: { icon: Compass },
+ productivity: { icon: BarChart2 },
+ learning: { icon: GraduationCap },
+ memory: { icon: Brain },
+ mind: { icon: MessageCircle },
+ health: { icon: Activity },
+ config: { icon: Settings },
+};
-export const TABS = [
- { id: 'briefing', label: 'Briefing', icon: Newspaper },
- { id: 'tasks', label: 'Tasks', icon: FileText },
- { id: 'agents', label: 'Agents', icon: Cpu },
- { id: 'jobs', label: 'System Tasks', icon: Bot },
- { id: 'runs', label: 'Runs', icon: Play },
- { id: 'run-events', label: 'Run Events', icon: ScrollText },
- { id: 'schedule', label: 'Schedule', icon: Clock },
- { id: 'workflow', label: 'Timeline', icon: ChartGantt },
- { id: 'digest', label: 'Digest', icon: Calendar },
- { id: 'gsd', label: 'GSD', icon: Compass },
- { id: 'productivity', label: 'Productivity', icon: BarChart2 },
- { id: 'learning', label: 'Learning', icon: GraduationCap },
- { id: 'memory', label: 'Memory', icon: Brain },
- { id: 'mind', label: 'Mind', icon: MessageCircle },
- { id: 'health', label: 'Health', icon: Activity },
- { id: 'config', label: 'Config', icon: Settings }
-];
+export const TABS = buildPageNavTabs(getPageNavTabs('cos'), TAB_PRESENTATION, 'CoS');
// Intentional category-color enum (#1909/#1924 caution), NOT off-token theme
// inconsistency: 9 files (CoSCharacter, CyberCoSAvatar, EsotericCoSAvatar,
diff --git a/client/src/components/cos/constants.test.js b/client/src/components/cos/constants.test.js
index aa0cc4bc97..1ea3418f64 100644
--- a/client/src/components/cos/constants.test.js
+++ b/client/src/components/cos/constants.test.js
@@ -21,8 +21,10 @@ import {
fresherHealth,
providerPinPatch,
hasProviderPin,
- providerPinDivergesFromSchedule
+ providerPinDivergesFromSchedule,
+ TABS
} from './constants';
+import { expectPageNavTabs } from '../../test/pageNavTabAssertions.js';
// These mirror the server's domainBudgets/domainAutonomy helpers so the UI's
// "is a cap set?" / "what mode?" view never disagrees with enforcement.
@@ -375,3 +377,18 @@ describe('REVIEWER_OPTIONS derivation', () => {
}
});
});
+
+// CoS derives its tab bar from the nav manifest's `tabGroup: 'cos'` (#6383) —
+// this pins the id/label/order the page means to render, and that every manifest
+// tab has a presentation entry (icon) in constants.js, which would otherwise
+// only surface as a thrown import-time error.
+describe('CoS TABS ↔ nav manifest', () => {
+ it('renders the cos tabGroup in page order with a presentation entry each', () => {
+ expectPageNavTabs(TABS, [
+ 'briefing:Briefing', 'tasks:Tasks', 'agents:Agents', 'jobs:System Tasks',
+ 'runs:Runs', 'run-events:Run Events', 'schedule:Schedule', 'workflow:Timeline',
+ 'digest:Digest', 'gsd:GSD', 'productivity:Productivity', 'learning:Learning',
+ 'memory:Memory', 'mind:Mind', 'health:Health', 'config:Config',
+ ]);
+ });
+});
diff --git a/client/src/components/digital-twin/constants.js b/client/src/components/digital-twin/constants.js
index 22d9c24be2..4fa42c01ba 100644
--- a/client/src/components/digital-twin/constants.js
+++ b/client/src/components/digital-twin/constants.js
@@ -32,39 +32,43 @@ import {
Package,
UserRound
} from 'lucide-react';
+import { getPageNavTabs } from '../../../../server/lib/navManifest.js';
+import { buildPageNavTabs } from '../../lib/pageNavTabs.js';
-// Main navigation sections, ordered by the group they belong to (see
-// SECTION_GROUPS below). This array stays FLAT and stays the single registry of
-// section ids: `server/lib/navManifest.test.js` scrapes `id:` out of it to prove
-// every section is addressable as `/digital-twin/<id>` from ⌘K and voice, and
-// its extractor stops at the first `];` — so a nested array here would silently
-// truncate the guard. Grouping therefore lives in a separate constant.
-export const TABS = [
+// Icon per section id. The manifest (`tabGroup: 'digital-twin'`) owns
+// id/label/order — this file owns only how each section looks, plus the
+// SECTION_GROUPS slicing below. The page-local "Goals"/"Legacy" labels (vs the
+// manifest's "Twin Goals"/"Legacy Bundle", which need the qualifier to be
+// unambiguous in ⌘K) come from the manifest's `tabLabel`. Throws at import time
+// on drift.
+const TAB_PRESENTATION = {
// Profile
- { id: 'overview', label: 'Overview', icon: Heart },
- { id: 'identity', label: 'Identity', icon: Fingerprint },
- { id: 'personas', label: 'Personas', icon: Drama },
- { id: 'goals', label: 'Goals', icon: Target },
- { id: 'taste', label: 'Taste', icon: Palette },
+ overview: { icon: Heart },
+ identity: { icon: Fingerprint },
+ personas: { icon: Drama },
+ goals: { icon: Target },
+ taste: { icon: Palette },
// Sources
- { id: 'documents', label: 'Documents', icon: FileText },
- { id: 'import', label: 'Import', icon: Upload },
- { id: 'accounts', label: 'Accounts', icon: Globe },
- { id: 'interview', label: 'Interview', icon: MessageSquare },
- { id: 'autobiography', label: 'Autobiography', icon: PenLine },
- { id: 'enrich', label: 'Enrich', icon: Sparkles },
+ documents: { icon: FileText },
+ import: { icon: Upload },
+ accounts: { icon: Globe },
+ interview: { icon: MessageSquare },
+ autobiography: { icon: PenLine },
+ enrich: { icon: Sparkles },
// Assessment
- { id: 'test', label: 'Test', icon: CheckCircle },
- { id: 'personality', label: 'Personality', icon: Brain },
+ test: { icon: CheckCircle },
+ personality: { icon: Brain },
// Presence
- { id: 'voice', label: 'Voice', icon: Mic },
- { id: 'appearance', label: 'Appearance', icon: Camera },
- { id: 'avatar-bio', label: 'Avatar Bio', icon: UserRound },
+ voice: { icon: Mic },
+ appearance: { icon: Camera },
+ 'avatar-bio': { icon: UserRound },
// Legacy
- { id: 'export', label: 'Export', icon: Download },
- { id: 'legacy', label: 'Legacy', icon: Package },
- { id: 'time-capsule', label: 'Time Capsule', icon: Archive }
-];
+ export: { icon: Download },
+ legacy: { icon: Package },
+ 'time-capsule': { icon: Archive },
+};
+
+export const TABS = buildPageNavTabs(getPageNavTabs('digital-twin'), TAB_PRESENTATION, 'Digital Twin');
// Two-level nav taxonomy (#3795). 19 sections in one flat strip stopped working
// as navigation, so they collapse into five groups keyed on what the user is
diff --git a/client/src/components/digital-twin/constants.test.js b/client/src/components/digital-twin/constants.test.js
new file mode 100644
index 0000000000..504e20219d
--- /dev/null
+++ b/client/src/components/digital-twin/constants.test.js
@@ -0,0 +1,29 @@
+import { describe, expect, it } from 'vitest';
+import { SECTION_GROUPS, TABS } from './constants';
+import { expectPageNavTabs } from '../../test/pageNavTabAssertions.js';
+
+// Digital Twin derives its section strip from the nav manifest's
+// `tabGroup: 'digital-twin'` (#6383) — this pins the id/label/order the page
+// means to render, and that every manifest section has a presentation entry
+// (icon) in constants.js, which would otherwise only surface as a thrown
+// import-time error. The short "Goals"/"Legacy" labels come from the manifest's
+// `tabLabel`; ⌘K and voice still show the qualified "Twin Goals"/"Legacy Bundle".
+describe('Digital Twin TABS ↔ nav manifest', () => {
+ it('renders the digital-twin tabGroup in page order with a presentation entry each', () => {
+ expectPageNavTabs(TABS, [
+ 'overview:Overview', 'identity:Identity', 'personas:Personas', 'goals:Goals',
+ 'taste:Taste', 'documents:Documents', 'import:Import', 'accounts:Accounts',
+ 'interview:Interview', 'autobiography:Autobiography', 'enrich:Enrich',
+ 'test:Test', 'personality:Personality', 'voice:Voice', 'appearance:Appearance',
+ 'avatar-bio:Avatar Bio', 'export:Export', 'legacy:Legacy', 'time-capsule:Time Capsule',
+ ]);
+ });
+
+ // The two-level nav (#3795) slices the SAME ids back out of the manifest
+ // order, so a section added to the tabGroup without a group lands nowhere.
+ it('assigns every section to exactly one SECTION_GROUPS group', () => {
+ const grouped = SECTION_GROUPS.flatMap((group) => group.sectionIds);
+ expect([...grouped].sort()).toEqual(TABS.map((tab) => tab.id).sort());
+ expect(new Set(grouped).size).toBe(grouped.length);
+ });
+});
diff --git a/client/src/components/meatspace/constants.js b/client/src/components/meatspace/constants.js
index 7652e0378b..62bd8058eb 100644
--- a/client/src/components/meatspace/constants.js
+++ b/client/src/components/meatspace/constants.js
@@ -11,20 +11,28 @@ import {
Stethoscope,
FileText,
} from 'lucide-react';
+import { getPageNavTabs } from '../../../../server/lib/navManifest.js';
+import { buildPageNavTabs } from '../../lib/pageNavTabs.js';
-export const TABS = [
- { id: 'overview', label: 'Overview', icon: Activity },
- { id: 'age', label: 'Age', icon: Clock },
- { id: 'alcohol', label: 'Alcohol', icon: Beer },
- { id: 'blood', label: 'Blood', icon: HeartPulse },
- { id: 'body', label: 'Body', icon: Scale },
- { id: 'export', label: 'Export', icon: FileText },
- { id: 'genome', label: 'Genome', icon: Dna },
- { id: 'health', label: 'Health', icon: Stethoscope },
- { id: 'settings', label: 'Settings', icon: Settings },
- { id: 'lifestyle', label: 'Lifestyle', icon: ClipboardList },
- { id: 'nicotine', label: 'Nicotine', icon: Cigarette },
-];
+// Icon per tab id. The manifest (`tabGroup: 'meatspace'`) owns id/label/order —
+// this file owns only how each tab looks; the page-local "Health" label (vs the
+// manifest's "Body Health", which disambiguates it from CoS Health in ⌘K) comes
+// from the manifest's `tabLabel`. Throws at import time on drift.
+const TAB_PRESENTATION = {
+ overview: { icon: Activity },
+ age: { icon: Clock },
+ alcohol: { icon: Beer },
+ blood: { icon: HeartPulse },
+ body: { icon: Scale },
+ export: { icon: FileText },
+ genome: { icon: Dna },
+ health: { icon: Stethoscope },
+ settings: { icon: Settings },
+ lifestyle: { icon: ClipboardList },
+ nicotine: { icon: Cigarette },
+};
+
+export const TABS = buildPageNavTabs(getPageNavTabs('meatspace'), TAB_PRESENTATION, 'MeatSpace');
// Lifestyle adjustment table for death clock
export const LIFESTYLE_ADJUSTMENTS = {
diff --git a/client/src/components/meatspace/constants.test.js b/client/src/components/meatspace/constants.test.js
new file mode 100644
index 0000000000..00ed2f8abc
--- /dev/null
+++ b/client/src/components/meatspace/constants.test.js
@@ -0,0 +1,19 @@
+import { describe, it } from 'vitest';
+import { TABS } from './constants';
+import { expectPageNavTabs } from '../../test/pageNavTabAssertions.js';
+
+// MeatSpace derives its tab bar from the nav manifest's `tabGroup: 'meatspace'`
+// (#6383) — this pins the id/label/order the page means to render, and that
+// every manifest tab has a presentation entry (icon) in constants.js, which
+// would otherwise only surface as a thrown import-time error. The short "Health"
+// label comes from the manifest's `tabLabel`; ⌘K and voice still show
+// "Body Health" so it doesn't collide with CoS Health.
+describe('MeatSpace TABS ↔ nav manifest', () => {
+ it('renders the meatspace tabGroup in page order with a presentation entry each', () => {
+ expectPageNavTabs(TABS, [
+ 'overview:Overview', 'age:Age', 'alcohol:Alcohol', 'blood:Blood', 'body:Body',
+ 'export:Export', 'genome:Genome', 'health:Health', 'settings:Settings',
+ 'lifestyle:Lifestyle', 'nicotine:Nicotine',
+ ]);
+ });
+});
diff --git a/client/src/lib/README.md b/client/src/lib/README.md
index 147b1d5697..28f9e534dd 100644
--- a/client/src/lib/README.md
+++ b/client/src/lib/README.md
@@ -24,6 +24,7 @@ grep -i "what you want to do" client/src/lib/README.md
```
| `navFeatures.js` | `filterNavByFeatures(navEntries, isFeatureEnabled)` — drops nav-manifest entries whose optional instance feature (`post`, `datadog`, `jira`, `gsd`) is off. The single gate for BROWSE surfaces (sidebar, ⌘K); routes stay reachable by URL, bookmark, and voice. Pair with `useInstanceFeatures`. |
+| `pageNavTabs.js` | `buildPageNavTabs(manifestTabs, presentation, pageName)` — merges `getPageNavTabs(group)` (nav-manifest, owns id/label/order) with a page-owned presentation map (icon, layout flags), throwing at import time when a manifest tab has no entry. The one way a tabbed page builds its tab bar. |
| `eidoverseFrame.js` | Versioned hosted Eidoverse message guards, exact section navigation allowlist, and browser label preferences. |
| `eidoverseWorldReset.js` | Client reset-reconciliation maps for Eidoverse source kinds and district asset slots; parity-tested against the authoritative server world-design contracts. |
| `postQuickSession.js` | Pure Quick POST duration presets, local-observation estimator, deterministic budget composer, and preview metadata. |
diff --git a/client/src/lib/index.js b/client/src/lib/index.js
index 9ae14659c8..2e3cf69dce 100644
--- a/client/src/lib/index.js
+++ b/client/src/lib/index.js
@@ -150,6 +150,7 @@ export * from './managedAppSources.js';
export * from './metronome.js';
export * from './mindThinkingPresets.js';
export * from './navFeatures.js';
+export * from './pageNavTabs.js';
export * from './midiChords.js';
export * from './midiNotes.js';
export * from './midiPlayback.js';
diff --git a/client/src/lib/pageNavTabs.js b/client/src/lib/pageNavTabs.js
new file mode 100644
index 0000000000..34bcb5a1f4
--- /dev/null
+++ b/client/src/lib/pageNavTabs.js
@@ -0,0 +1,28 @@
+// The one way a page builds its own tab bar from the nav manifest.
+//
+// `server/lib/navManifest.js` is the single registry of navigable destinations,
+// so a tabbed page must not restate its tab ids, labels or order in a local
+// array — that second list drifts, and a tab that exists only there is
+// unreachable from ⌘K and voice `ui_navigate`. Instead the page declares
+// `tabGroup: '<group>'` on each manifest entry and pairs `getPageNavTabs(group)`
+// with a PRESENTATION map holding only what the manifest has no business
+// knowing: the icon, and any page-only layout flag (`fullBleed`, …).
+//
+// A manifest tab with no presentation entry throws HERE, at module load, rather
+// than rendering an iconless tab or silently dropping it — a page that can't
+// render its own nav is a build error, not a runtime degradation.
+
+/**
+ * @param {Array<{id: string}>} manifestTabs from `getPageNavTabs(group)`
+ * @param {Record<string, object>} presentation per-tab-id icon/layout, page-owned
+ * @param {string} pageName used in the drift error, e.g. "Wiki"
+ */
+export const buildPageNavTabs = (manifestTabs, presentation, pageName) => (
+ manifestTabs.map((tab) => {
+ const tabPresentation = presentation[tab.id];
+ if (!tabPresentation) throw new Error(`${pageName}: no tab presentation for manifest tab "${tab.id}"`);
+ return { ...tab, ...tabPresentation };
+ })
+);
+
+export default buildPageNavTabs;
diff --git a/client/src/pages/Calendar.jsx b/client/src/pages/Calendar.jsx
index 73275d5c5b..fe5e87f4f7 100644
--- a/client/src/pages/Calendar.jsx
+++ b/client/src/pages/Calendar.jsx
@@ -8,6 +8,7 @@ import TabPills from '../components/ui/TabPills';
import { useValidTab } from '../hooks/useValidTab';
import useUrlParams from '../hooks/useUrlParams';
import { getPageNavTabs } from '../../../server/lib/navManifest.js';
+import { buildPageNavTabs } from '../lib/pageNavTabs.js';
import AgendaTab from '../components/calendar/AgendaTab';
import DayView from '../components/calendar/DayView';
@@ -33,11 +34,7 @@ const TAB_PRESENTATION = {
config: { icon: Settings },
};
-export const TABS = getPageNavTabs('calendar').map((tab) => {
- const presentation = TAB_PRESENTATION[tab.id];
- if (!presentation) throw new Error(`Calendar: no tab presentation for manifest tab "${tab.id}"`);
- return { ...tab, ...presentation };
-});
+export const TABS = buildPageNavTabs(getPageNavTabs('calendar'), TAB_PRESENTATION, 'Calendar');
export default function Calendar() {
const navigate = useNavigate();
diff --git a/client/src/pages/Calendar.test.jsx b/client/src/pages/Calendar.test.jsx
index b0ee3f146c..5edefc2bae 100644
--- a/client/src/pages/Calendar.test.jsx
+++ b/client/src/pages/Calendar.test.jsx
@@ -1,16 +1,15 @@
-import { describe, it, expect } from 'vitest';
+import { describe, it } from 'vitest';
import { TABS } from './Calendar';
-import { getPageNavTabs } from '../../../server/lib/navManifest.js';
+import { expectPageNavTabs } from '../test/pageNavTabAssertions.js';
// Calendar derives its tab bar from the nav manifest's `tabGroup: 'calendar'`
// (#6365) — this pins that TABS stays in sync (id, label, declaration order)
// and that every manifest tab has a presentation entry (icon) in Calendar.jsx,
// which would otherwise only surface as a thrown import-time error.
describe('Calendar TABS ↔ nav manifest', () => {
- it('derives every tab, in order, from the "calendar" tabGroup with a presentation entry', () => {
- const manifestTabs = getPageNavTabs('calendar');
- expect(TABS.map((t) => t.id)).toEqual(manifestTabs.map((t) => t.id));
- expect(TABS.map((t) => t.label)).toEqual(manifestTabs.map((t) => t.label));
- expect(TABS.every((t) => typeof t.icon === 'function' || typeof t.icon === 'object')).toBe(true);
+ it('renders the calendar tabGroup in page order with a presentation entry each', () => {
+ expectPageNavTabs(TABS, [
+ 'agenda:Agenda', 'day:Day', 'week:Week', 'month:Month', 'lifetime:Lifetime', 'review:Review', 'sync:Sync', 'config:Config',
+ ]);
});
});
diff --git a/client/src/pages/Goals.jsx b/client/src/pages/Goals.jsx
index f8ba661a5f..0c2ab5d6fe 100644
--- a/client/src/pages/Goals.jsx
+++ b/client/src/pages/Goals.jsx
@@ -9,6 +9,7 @@ import TabPills from '../components/ui/TabPills';
import PageSkeleton from '../components/ui/PageSkeleton';
import { useValidTab } from '../hooks/useValidTab';
import { getPageNavTabs } from '../../../server/lib/navManifest.js';
+import { buildPageNavTabs } from '../lib/pageNavTabs.js';
const GoalsTreeView = lazy(() => import('../components/goals/GoalsTreeView'));
@@ -21,11 +22,7 @@ const TAB_PRESENTATION = {
tree: { icon: TreePine },
};
-export const TABS = getPageNavTabs('goals').map((tab) => {
- const presentation = TAB_PRESENTATION[tab.id];
- if (!presentation) throw new Error(`Goals: no tab presentation for manifest tab "${tab.id}"`);
- return { ...tab, ...presentation };
-});
+export const TABS = buildPageNavTabs(getPageNavTabs('goals'), TAB_PRESENTATION, 'Goals');
export default function Goals() {
// `/goals/list/:goalId` carries no `:tab` segment, so `useValidTab` falls back to
diff --git a/client/src/pages/Goals.test.jsx b/client/src/pages/Goals.test.jsx
index eccea24f5a..ee04f04054 100644
--- a/client/src/pages/Goals.test.jsx
+++ b/client/src/pages/Goals.test.jsx
@@ -1,6 +1,6 @@
-import { describe, it, expect } from 'vitest';
+import { describe, it } from 'vitest';
import { TABS } from './Goals';
-import { getPageNavTabs } from '../../../server/lib/navManifest.js';
+import { expectPageNavTabs } from '../test/pageNavTabAssertions.js';
// Goals derives its tab bar from the nav manifest's `tabGroup: 'goals'` (#6365)
// — this pins that TABS stays in sync (id, label, declaration order) and that
@@ -9,10 +9,9 @@ import { getPageNavTabs } from '../../../server/lib/navManifest.js';
// "List"/"Tree" labels differ from the manifest's "Goals"/"Goals Tree" via
// the manifest's `tabLabel`.
describe('Goals TABS ↔ nav manifest', () => {
- it('derives every tab, in order, from the "goals" tabGroup with a presentation entry', () => {
- const manifestTabs = getPageNavTabs('goals');
- expect(TABS.map((t) => t.id)).toEqual(manifestTabs.map((t) => t.id));
- expect(TABS.map((t) => t.label)).toEqual(['List', 'Tree']);
- expect(TABS.every((t) => typeof t.icon === 'function' || typeof t.icon === 'object')).toBe(true);
+ it('renders the goals tabGroup in page order with a presentation entry each', () => {
+ expectPageNavTabs(TABS, [
+ 'list:List', 'tree:Tree',
+ ]);
});
});
diff --git a/client/src/pages/Insights.jsx b/client/src/pages/Insights.jsx
index 4fae348ae3..6a6cec8f48 100644
--- a/client/src/pages/Insights.jsx
+++ b/client/src/pages/Insights.jsx
@@ -20,6 +20,7 @@ import TabPills from '../components/ui/TabPills';
import PageSkeleton from '../components/ui/PageSkeleton';
import { timeAgo } from '../utils/formatters';
import { getPageNavTabs } from '../../../server/lib/navManifest.js';
+import { buildPageNavTabs } from '../lib/pageNavTabs.js';
// Icon per tab id. The manifest (`tabGroup: 'insights'`) owns id/label/order —
// this page owns only how each tab looks. Throws at import time on drift.
@@ -31,11 +32,7 @@ const TAB_PRESENTATION = {
'goal-scorecard': { icon: Target },
};
-export const TABS = getPageNavTabs('insights').map((tab) => {
- const presentation = TAB_PRESENTATION[tab.id];
- if (!presentation) throw new Error(`Insights: no tab presentation for manifest tab "${tab.id}"`);
- return { ...tab, ...presentation };
-});
+export const TABS = buildPageNavTabs(getPageNavTabs('insights'), TAB_PRESENTATION, 'Insights');
export function OverviewTab() {
const navigate = useNavigate();
diff --git a/client/src/pages/Insights.test.jsx b/client/src/pages/Insights.test.jsx
index 8b489f62c0..6a168253fd 100644
--- a/client/src/pages/Insights.test.jsx
+++ b/client/src/pages/Insights.test.jsx
@@ -28,14 +28,13 @@ import {
refreshInsightNarrative,
} from '../services/api';
import { OverviewTab, TABS } from './Insights';
-import { getPageNavTabs } from '../../../server/lib/navManifest.js';
+import { expectPageNavTabs } from '../test/pageNavTabAssertions.js';
describe('Insights TABS ↔ nav manifest', () => {
- it('derives every tab, in order, from the "insights" tabGroup with a presentation entry', () => {
- const manifestTabs = getPageNavTabs('insights');
- expect(TABS.map((t) => t.id)).toEqual(manifestTabs.map((t) => t.id));
- expect(TABS.map((t) => t.label)).toEqual(manifestTabs.map((t) => t.label));
- expect(TABS.every((t) => typeof t.icon === 'function' || typeof t.icon === 'object')).toBe(true);
+ it('renders the insights tabGroup in page order with a presentation entry each', () => {
+ expectPageNavTabs(TABS, [
+ 'overview:Overview', 'genome-health:Genome-Health', 'taste-identity:Taste & Identity', 'cross-domain:Cross-Domain Patterns', 'goal-scorecard:Goal Scorecard',
+ ]);
});
});
diff --git a/client/src/pages/MediaGen.jsx b/client/src/pages/MediaGen.jsx
index 91949727bb..ad4eeff1e8 100644
--- a/client/src/pages/MediaGen.jsx
+++ b/client/src/pages/MediaGen.jsx
@@ -1,18 +1,27 @@
import { useNavigate, useLocation, Outlet } from 'react-router';
import { Layers, Image as ImageIcon, Film, History, Scissors, FolderOpen, Box, Pencil } from 'lucide-react';
import TabPills from '../components/ui/TabPills';
+import { getPageNavTabs } from '../../../server/lib/navManifest.js';
+import { buildPageNavTabs } from '../lib/pageNavTabs.js';
+// Icon per tab id. The manifest (`tabGroup: 'media'`) owns id/label/order —
+// this page owns only how each tab looks; the page-local "History"/"Three.js"
+// labels (vs the manifest's "Media History"/"Three.js Models", which need the
+// qualifier to be unambiguous in ⌘K) come from the manifest's `tabLabel`.
// LoRAs, Training and Models moved to the Models section (#4728) — they manage
// installed weights, while everything left here generates or browses output.
-export const TABS = [
- { id: 'image', label: 'Image', icon: ImageIcon },
- { id: 'video', label: 'Video', icon: Film },
- { id: 'threejs', label: 'Three.js', icon: Box },
- { id: 'annotate', label: 'Annotate', icon: Pencil },
- { id: 'timeline', label: 'Timeline', icon: Scissors },
- { id: 'history', label: 'History', icon: History },
- { id: 'collections', label: 'Collections', icon: FolderOpen }
-];
+// Throws at import time on drift.
+const TAB_PRESENTATION = {
+ image: { icon: ImageIcon },
+ video: { icon: Film },
+ threejs: { icon: Box },
+ annotate: { icon: Pencil },
+ timeline: { icon: Scissors },
+ history: { icon: History },
+ collections: { icon: FolderOpen },
+};
+
+export const TABS = buildPageNavTabs(getPageNavTabs('media'), TAB_PRESENTATION, 'Media Gen');
export default function MediaGen() {
const navigate = useNavigate();
diff --git a/client/src/pages/MediaGen.test.jsx b/client/src/pages/MediaGen.test.jsx
index 2dc58f00c5..6c6e0b6566 100644
--- a/client/src/pages/MediaGen.test.jsx
+++ b/client/src/pages/MediaGen.test.jsx
@@ -3,6 +3,7 @@ import { render, screen, within } from '@testing-library/react';
import { MemoryRouter } from 'react-router';
import MediaGen, { TABS } from './MediaGen.jsx';
+import { expectPageNavTabs } from '../test/pageNavTabAssertions.js';
describe('<MediaGen>', () => {
it('provides a labeled mobile section selector for the full tab set', () => {
@@ -18,3 +19,17 @@ describe('<MediaGen>', () => {
expect(select).toHaveValue('image');
});
});
+
+// Media Gen derives its tab bar from the nav manifest's `tabGroup: 'media'`
+// (#6383) — this pins the id/label/order the page means to render, and that
+// every manifest tab has a presentation entry (icon) in MediaGen.jsx, which
+// would otherwise only surface as a thrown import-time error. The short
+// "History"/"Three.js" labels come from the manifest's `tabLabel`.
+describe('MediaGen TABS ↔ nav manifest', () => {
+ it('renders the media tabGroup in page order with a presentation entry each', () => {
+ expectPageNavTabs(TABS, [
+ 'image:Image', 'video:Video', 'threejs:Three.js', 'annotate:Annotate',
+ 'timeline:Timeline', 'history:History', 'collections:Collections',
+ ]);
+ });
+});
diff --git a/client/src/pages/Messages.jsx b/client/src/pages/Messages.jsx
index 6e8f6b6ee7..ebfcdc1967 100644
--- a/client/src/pages/Messages.jsx
+++ b/client/src/pages/Messages.jsx
@@ -15,6 +15,7 @@ import IMessageTab from '../components/messages/IMessageTab';
import SignalTab from '../components/messages/SignalTab';
import ContactsTab from '../components/messages/ContactsTab';
import { getPageNavTabs } from '../../../server/lib/navManifest.js';
+import { buildPageNavTabs } from '../lib/pageNavTabs.js';
// Presentation per tab id. The manifest (`tabGroup: 'messages'`) owns
// id/label/order — this page owns how each tab looks and behaves.
@@ -31,11 +32,7 @@ const TAB_PRESENTATION = {
config: { icon: Settings, needsAccounts: true },
};
-export const TABS = getPageNavTabs('messages').map((tab) => {
- const presentation = TAB_PRESENTATION[tab.id];
- if (!presentation) throw new Error(`Messages: no tab presentation for manifest tab "${tab.id}"`);
- return { ...tab, ...presentation };
-});
+export const TABS = buildPageNavTabs(getPageNavTabs('messages'), TAB_PRESENTATION, 'Messages');
const FULL_BLEED_TAB_IDS = new Set(TABS.filter((t) => t.fullBleed).map((t) => t.id));
diff --git a/client/src/pages/Messages.test.jsx b/client/src/pages/Messages.test.jsx
index ff7a2b2393..c5052e1c3c 100644
--- a/client/src/pages/Messages.test.jsx
+++ b/client/src/pages/Messages.test.jsx
@@ -1,6 +1,6 @@
-import { describe, it, expect } from 'vitest';
+import { describe, it } from 'vitest';
import { TABS } from './Messages';
-import { getPageNavTabs } from '../../../server/lib/navManifest.js';
+import { expectPageNavTabs } from '../test/pageNavTabAssertions.js';
// Messages derives its tab bar from the nav manifest's `tabGroup: 'messages'`
// (#6365) — this pins that TABS stays in sync (id, label, declaration order)
@@ -8,10 +8,9 @@ import { getPageNavTabs } from '../../../server/lib/navManifest.js';
// `fullBleed`/`needsAccounts` flags) in Messages.jsx, which would otherwise
// only surface as a thrown import-time error.
describe('Messages TABS ↔ nav manifest', () => {
- it('derives every tab, in order, from the "messages" tabGroup with a presentation entry', () => {
- const manifestTabs = getPageNavTabs('messages');
- expect(TABS.map((t) => t.id)).toEqual(manifestTabs.map((t) => t.id));
- expect(TABS.map((t) => t.label)).toEqual(manifestTabs.map((t) => t.label));
- expect(TABS.every((t) => typeof t.icon === 'function' || typeof t.icon === 'object')).toBe(true);
+ it('renders the messages tabGroup in page order with a presentation entry each', () => {
+ expectPageNavTabs(TABS, [
+ 'inbox:Inbox', 'drafts:Drafts', 'imessage:iMessage', 'signal:Signal', 'contacts:Contacts', 'sync:Sync', 'config:Config',
+ ]);
});
});
diff --git a/client/src/pages/Music.jsx b/client/src/pages/Music.jsx
index 54e4a600eb..03a32df909 100644
--- a/client/src/pages/Music.jsx
+++ b/client/src/pages/Music.jsx
@@ -17,13 +17,22 @@ import AlbumsManager from '../components/music/AlbumsManager';
import TracksManager from '../components/music/TracksManager';
import MusicDesigner from '../components/music/MusicDesigner';
import TabPills from '../components/ui/TabPills';
+import { getPageNavTabs } from '../../../server/lib/navManifest.js';
+import { buildPageNavTabs } from '../lib/pageNavTabs.js';
-export const TABS = [
- { id: 'generate', label: 'Generate', icon: Wand2 },
- { id: 'artists', label: 'Artists', icon: Mic },
- { id: 'albums', label: 'Albums', icon: Disc3 },
- { id: 'tracks', label: 'Tracks', icon: AudioLines },
-];
+// Icon per tab id. The manifest (`tabGroup: 'music'`) owns id/label/order —
+// this page owns only how each tab looks; the short page-local labels (vs the
+// manifest's "Music Designer"/"Music Artists"/… , which need the "Music"
+// qualifier to be unambiguous in ⌘K) come from the manifest's `tabLabel`.
+// Throws at import time on drift.
+const TAB_PRESENTATION = {
+ generate: { icon: Wand2 },
+ artists: { icon: Mic },
+ albums: { icon: Disc3 },
+ tracks: { icon: AudioLines },
+};
+
+export const TABS = buildPageNavTabs(getPageNavTabs('music'), TAB_PRESENTATION, 'Music');
const VALID = new Set(TABS.map((t) => t.id));
diff --git a/client/src/pages/Music.test.jsx b/client/src/pages/Music.test.jsx
index 6d1f3e4e57..4308431b63 100644
--- a/client/src/pages/Music.test.jsx
+++ b/client/src/pages/Music.test.jsx
@@ -11,7 +11,8 @@ vi.mock('../components/music/AlbumsManager', () => ({ default: () => <div data-t
vi.mock('../components/music/TracksManager', () => ({ default: () => <div data-testid="tracks-manager" /> }));
vi.mock('../components/music/MusicDesigner', () => ({ default: () => <div data-testid="music-designer" /> }));
-import Music from './Music.jsx';
+import Music, { TABS } from './Music.jsx';
+import { expectPageNavTabs } from '../test/pageNavTabAssertions.js';
// Sibling readout of the current route, rendered alongside the page so a
// redirect's resulting pathname is directly observable (mirrors the
@@ -66,3 +67,17 @@ describe('<Music>', () => {
expect(screen.queryByTestId('artists-manager')).toBeNull();
});
});
+
+// Music derives its tab bar from the nav manifest's `tabGroup: 'music'` (#6383)
+// — this pins the id/label/order the page means to render, and that every
+// manifest tab has a presentation entry (icon) in Music.jsx, which would
+// otherwise only surface as a thrown import-time error. The short labels come
+// from the manifest's `tabLabel`; ⌘K and voice still show "Music Designer",
+// "Music Artists", … so they don't collide with the Create-section pages.
+describe('Music TABS ↔ nav manifest', () => {
+ it('renders the music tabGroup in page order with a presentation entry each', () => {
+ expectPageNavTabs(TABS, [
+ 'generate:Generate', 'artists:Artists', 'albums:Albums', 'tracks:Tracks',
+ ]);
+ });
+});
diff --git a/client/src/pages/Privacy.jsx b/client/src/pages/Privacy.jsx
index abf31fbe0a..bf0c3718df 100644
--- a/client/src/pages/Privacy.jsx
+++ b/client/src/pages/Privacy.jsx
@@ -15,6 +15,7 @@ import SubjectSwitcher from '../components/privacy/SubjectSwitcher';
import SubjectsDrawer from '../components/privacy/SubjectsDrawer';
import { SELF_SUBJECT_ID, privacyTabPath } from '../components/privacy/constants';
import { getPageNavTabs } from '../../../server/lib/navManifest.js';
+import { buildPageNavTabs } from '../lib/pageNavTabs.js';
// Icon per tab id. The manifest (`tabGroup: 'privacy'`) owns id/label/order —
// this page owns only how each tab looks; the page-local "Overview" label
@@ -28,11 +29,7 @@ const TAB_PRESENTATION = {
brokers: { icon: ShieldOff },
};
-export const TABS = getPageNavTabs('privacy').map((tab) => {
- const presentation = TAB_PRESENTATION[tab.id];
- if (!presentation) throw new Error(`Privacy: no tab presentation for manifest tab "${tab.id}"`);
- return { ...tab, ...presentation };
-});
+export const TABS = buildPageNavTabs(getPageNavTabs('privacy'), TAB_PRESENTATION, 'Privacy');
export default function Privacy() {
const navigate = useNavigate();
diff --git a/client/src/pages/Privacy.test.jsx b/client/src/pages/Privacy.test.jsx
index 0a0a460b45..9f19551b93 100644
--- a/client/src/pages/Privacy.test.jsx
+++ b/client/src/pages/Privacy.test.jsx
@@ -73,14 +73,13 @@ vi.mock('../services/api', () => ({
}));
import Privacy, { TABS } from './Privacy';
-import { getPageNavTabs } from '../../../server/lib/navManifest.js';
+import { expectPageNavTabs } from '../test/pageNavTabAssertions.js';
describe('Privacy TABS ↔ nav manifest', () => {
- it('derives every tab, in order, from the "privacy" tabGroup with a presentation entry', () => {
- const manifestTabs = getPageNavTabs('privacy');
- expect(TABS.map((t) => t.id)).toEqual(manifestTabs.map((t) => t.id));
- expect(TABS.map((t) => t.label)).toEqual(manifestTabs.map((t) => t.label));
- expect(TABS.every((t) => typeof t.icon === 'function' || typeof t.icon === 'object')).toBe(true);
+ it('renders the privacy tabGroup in page order with a presentation entry each', () => {
+ expectPageNavTabs(TABS, [
+ 'overview:Overview', 'vault:Vault', 'organizations:Organizations', 'changes:Changes', 'brokers:Brokers',
+ ]);
});
});
import {
diff --git a/client/src/pages/Sharing.jsx b/client/src/pages/Sharing.jsx
index 17f93e65ac..cf296017b1 100644
--- a/client/src/pages/Sharing.jsx
+++ b/client/src/pages/Sharing.jsx
@@ -28,6 +28,8 @@ import {
listShareInbox, promoteShareInboxItem, dismissShareInboxItem,
listShareActivity, getSettings, updateSettings,
} from '../services/api';
+import { getPageNavTabs } from '../../../server/lib/navManifest.js';
+import { buildPageNavTabs } from '../lib/pageNavTabs.js';
const emptyForm = () => ({ name: '', path: '', mode: 'inbox', displayNameOverride: '', bioOverride: '' });
@@ -44,14 +46,19 @@ export function isLiveSubscription(item, now = Date.now()) {
return (now - receivedMs) < SUBSCRIPTION_LIVE_WINDOW_MS;
}
-// Top-level deep-linkable sections. Buckets is the bucket-management view;
-// Duplicates + Conflicts are the sync-hygiene review surfaces.
-// Exported for the nav-manifest tab-coverage guard (server/lib/navManifest.test.js).
-export const SECTIONS = [
- { id: 'buckets', label: 'Buckets', icon: Folder, path: '/sharing' },
- { id: 'duplicates', label: 'Duplicates', icon: Copy, path: '/sharing/duplicates' },
- { id: 'conflicts', label: 'Conflicts', icon: GitMerge, path: '/sharing/conflicts' },
-];
+// Icon per top-level section id. The manifest (`tabGroup: 'sharing'`) owns
+// id/label/order and the absolute path (`to`) — this page owns only how each
+// section looks; the page-local "Buckets" label (vs the manifest's page-level
+// "Sharing") comes from the manifest's `tabLabel`. Buckets is the
+// bucket-management view; Duplicates + Conflicts are the sync-hygiene review
+// surfaces. Throws at import time on drift.
+const SECTION_PRESENTATION = {
+ buckets: { icon: Folder },
+ duplicates: { icon: Copy },
+ conflicts: { icon: GitMerge },
+};
+
+export const SECTIONS = buildPageNavTabs(getPageNavTabs('sharing'), SECTION_PRESENTATION, 'Sharing');
// Per-bucket detail sub-tabs. Held in the `?tab=` URL search param (not local
// state) so the open view is deep-linkable, reload-safe, and stays in sync with
@@ -66,10 +73,10 @@ function SharingHeader({ active }) {
<h1 className="text-2xl font-bold text-white">Sharing</h1>
</div>
<nav className="flex items-center gap-1 mb-6 border-b border-port-border">
- {SECTIONS.map(({ id, label, icon: Icon, path }) => (
+ {SECTIONS.map(({ id, label, icon: Icon, to }) => (
<Link
key={id}
- to={path}
+ to={to}
className={`inline-flex items-center gap-2 px-3 py-2 text-sm border-b-2 -mb-px ${
active === id
? 'border-port-accent text-white'
diff --git a/client/src/pages/Sharing.test.jsx b/client/src/pages/Sharing.test.jsx
index a0aeed52f7..59129705ad 100644
--- a/client/src/pages/Sharing.test.jsx
+++ b/client/src/pages/Sharing.test.jsx
@@ -19,7 +19,8 @@ vi.mock('../services/api', () => ({
updateSettings: vi.fn(),
}));
-import Sharing, { isLiveSubscription } from './Sharing';
+import Sharing, { SECTIONS, isLiveSubscription } from './Sharing';
+import { expectPageNavTabs } from '../test/pageNavTabAssertions.js';
import * as api from '../services/api';
const NOW = Date.parse('2026-05-18T12:00:00Z');
@@ -119,3 +120,17 @@ describe('Sharing bucket detail tab (URL-derived)', () => {
await waitFor(() => expect(screen.getByText('Import mode')).toBeInTheDocument());
});
});
+
+// Sharing derives its top section strip from the nav manifest's
+// `tabGroup: 'sharing'` (#6383) — this pins the id/label/order the page means to
+// render, and that every manifest section has a presentation entry (icon) in
+// Sharing.jsx, which would otherwise only surface as a thrown import-time error.
+// The page-local "Buckets" label comes from the manifest's `tabLabel`; ⌘K and
+// voice still show the page-level "Sharing" for the same `/sharing` route.
+describe('Sharing SECTIONS ↔ nav manifest', () => {
+ it('renders the sharing tabGroup in page order with a presentation entry each', () => {
+ expectPageNavTabs(SECTIONS, [
+ 'buckets:Buckets', 'duplicates:Duplicates', 'conflicts:Conflicts',
+ ]);
+ });
+});
diff --git a/client/src/pages/SystemHealthPage.jsx b/client/src/pages/SystemHealthPage.jsx
index b1a55dedea..056558ff80 100644
--- a/client/src/pages/SystemHealthPage.jsx
+++ b/client/src/pages/SystemHealthPage.jsx
@@ -11,6 +11,8 @@ import StoragePanel from '../components/system-resources/StoragePanel.jsx';
import QueuesPanel from '../components/system-resources/QueuesPanel.jsx';
import MediaCapacityPanel from '../components/system-resources/MediaCapacityPanel.jsx';
import BuildStampPanel from '../components/system-resources/BuildStampPanel.jsx';
+import { getPageNavTabs } from '../../../server/lib/navManifest.js';
+import { buildPageNavTabs } from '../lib/pageNavTabs.js';
const HEALTH_STYLE = {
healthy: { color: 'text-port-success', bg: 'bg-port-success/10', icon: CheckCircle, label: 'Healthy' },
@@ -51,14 +53,21 @@ function barTone(pct, warn, critical) {
return 'bg-port-success';
}
-// The downloaded-model inventory used to be a fourth tab here. It answered the
-// same question Models → Status answers, in a different section, so it folded
-// into that page (#4728); /system-resources/models redirects there.
-export const RESOURCE_TABS = [
- { id: 'overview', label: 'Overview', icon: Activity },
- { id: 'storage', label: 'Storage', icon: HardDrive },
- { id: 'queues', label: 'Queues', icon: ListOrdered },
-];
+// Icon per tab id. The manifest (`tabGroup: 'system-resources'`) owns
+// id/label/order — this page owns only how each tab looks; the short page-local
+// labels (vs the manifest's "System Resources Overview"/"Storage Report"/
+// "Active Queues", which need the qualifier to be unambiguous in ⌘K) come from
+// the manifest's `tabLabel`. The downloaded-model inventory used to be a fourth
+// tab here. It answered the same question Models → Status answers, in a
+// different section, so it folded into that page (#4728);
+// /system-resources/models redirects there. Throws at import time on drift.
+const TAB_PRESENTATION = {
+ overview: { icon: Activity },
+ storage: { icon: HardDrive },
+ queues: { icon: ListOrdered },
+};
+
+export const RESOURCE_TABS = buildPageNavTabs(getPageNavTabs('system-resources'), TAB_PRESENTATION, 'System Resources');
export default function SystemResourcesPage() {
const { tab = 'overview' } = useParams();
diff --git a/client/src/pages/SystemHealthPage.test.jsx b/client/src/pages/SystemHealthPage.test.jsx
index 9adbb313e8..f07d948424 100644
--- a/client/src/pages/SystemHealthPage.test.jsx
+++ b/client/src/pages/SystemHealthPage.test.jsx
@@ -53,7 +53,8 @@ vi.mock('../components/ui/Toast', () => ({
}));
import * as api from '../services/api';
-import SystemHealthPage from './SystemHealthPage';
+import SystemHealthPage, { RESOURCE_TABS } from './SystemHealthPage';
+import { expectPageNavTabs } from '../test/pageNavTabAssertions.js';
const renderPage = (path = '/system-resources/overview') => render(
<MemoryRouter initialEntries={[path]}>
@@ -204,3 +205,16 @@ describe('SystemHealthPage remediation links', () => {
await act(async () => { finishRescan({ ...firstReport, generatedAt: '2026-08-16T00:01:00.000Z', cleanupCandidates: [] }); });
});
});
+
+// System Resources derives its tab bar from the nav manifest's
+// `tabGroup: 'system-resources'` (#6383) — this pins the id/label/order the page
+// means to render, and that every manifest tab has a presentation entry (icon)
+// in SystemHealthPage.jsx, which would otherwise only surface as a thrown
+// import-time error. The short labels come from the manifest's `tabLabel`; ⌘K
+// and voice still show "System Resources Overview"/"Storage Report"/"Active
+// Queues" so each is unambiguous out of page context.
+describe('RESOURCE_TABS ↔ nav manifest', () => {
+ it('renders the system-resources tabGroup in page order with a presentation entry each', () => {
+ expectPageNavTabs(RESOURCE_TABS, ['overview:Overview', 'storage:Storage', 'queues:Queues']);
+ });
+});
diff --git a/client/src/pages/Wiki.jsx b/client/src/pages/Wiki.jsx
index 6758c7e818..dd307e15d4 100644
--- a/client/src/pages/Wiki.jsx
+++ b/client/src/pages/Wiki.jsx
@@ -12,6 +12,7 @@ import WikiSearchTab from '../components/wiki/tabs/SearchTab';
import WikiGraphTab from '../components/wiki/tabs/GraphTab';
import WikiLogTab from '../components/wiki/tabs/LogTab';
import { getPageNavTabs } from '../../../server/lib/navManifest.js';
+import { buildPageNavTabs } from '../lib/pageNavTabs.js';
// Icon per tab id. The manifest (`tabGroup: 'wiki'`) owns id/label/order —
// this page owns only how each tab looks; the page-local "Overview" label
@@ -25,11 +26,7 @@ const TAB_PRESENTATION = {
log: { icon: Activity },
};
-export const TABS = getPageNavTabs('wiki').map((tab) => {
- const presentation = TAB_PRESENTATION[tab.id];
- if (!presentation) throw new Error(`Wiki: no tab presentation for manifest tab "${tab.id}"`);
- return { ...tab, ...presentation };
-});
+export const TABS = buildPageNavTabs(getPageNavTabs('wiki'), TAB_PRESENTATION, 'Wiki');
export default function Wiki() {
const { tab } = useParams();
diff --git a/client/src/pages/Wiki.test.jsx b/client/src/pages/Wiki.test.jsx
index e718defe1b..461eb363ae 100644
--- a/client/src/pages/Wiki.test.jsx
+++ b/client/src/pages/Wiki.test.jsx
@@ -18,14 +18,13 @@ vi.mock('../components/wiki/tabs/LogTab', () => ({ default: () => <div>log</div>
import Wiki, { TABS } from './Wiki';
import { getNotesVaults, scanNotesVault } from '../services/api';
-import { getPageNavTabs } from '../../../server/lib/navManifest.js';
+import { expectPageNavTabs } from '../test/pageNavTabAssertions.js';
describe('Wiki TABS ↔ nav manifest', () => {
- it('derives every tab, in order, from the "wiki" tabGroup with a presentation entry', () => {
- const manifestTabs = getPageNavTabs('wiki');
- expect(TABS.map((t) => t.id)).toEqual(manifestTabs.map((t) => t.id));
- expect(TABS.map((t) => t.label)).toEqual(manifestTabs.map((t) => t.label));
- expect(TABS.every((t) => typeof t.icon === 'function' || typeof t.icon === 'object')).toBe(true);
+ it('renders the wiki tabGroup in page order with a presentation entry each', () => {
+ expectPageNavTabs(TABS, [
+ 'overview:Overview', 'browse:Browse', 'search:Search', 'graph:Graph', 'log:Log',
+ ]);
});
});
diff --git a/client/src/test/pageNavTabAssertions.js b/client/src/test/pageNavTabAssertions.js
new file mode 100644
index 0000000000..9445293f10
--- /dev/null
+++ b/client/src/test/pageNavTabAssertions.js
@@ -0,0 +1,28 @@
+/**
+ * Shared assertion for a page whose tab bar is derived from the nav manifest.
+ *
+ * Every tabbed page builds its `TABS` (or `SECTIONS`/`RESOURCE_TABS`) with
+ * `buildPageNavTabs(getPageNavTabs(group), …)`, so comparing the
+ * result back against `getPageNavTabs(group)` proves nothing — it is the same
+ * array. The regression worth catching is the MANIFEST drifting out from under
+ * the page: a tab reordered, relabelled, added to or dropped from the
+ * `tabGroup`. So each page pins the literal id/label list it means to render.
+ *
+ * A manifest tab with NO presentation entry already throws at module load, so
+ * this only has to prove the entries that exist carry something renderable (an
+ * icon) and a real destination path.
+ *
+ * Node-only consumer (test files); kept in `src/test/` for the same reason as
+ * `classNameScan.js` — `lib/` carries the enforced barrel + README rule and a
+ * test-only helper has no business in the browser barrel.
+ */
+
+import { expect } from 'vitest';
+
+// `expected` is the page's intended tab bar as `'<id>:<label>'` strings, in
+// render order — spelled out rather than derived so a manifest edit fails here.
+export function expectPageNavTabs(tabs, expected) {
+ expect(tabs.map((tab) => `${tab.id}:${tab.label}`)).toEqual(expected);
+ expect(tabs.filter((tab) => !tab.icon).map((tab) => tab.id)).toEqual([]);
+ expect(tabs.filter((tab) => !String(tab.to || '').startsWith('/')).map((tab) => tab.id)).toEqual([]);
+}
diff --git a/server/lib/navManifest.js b/server/lib/navManifest.js
index 8b42c71516..5a2238b3fe 100644
--- a/server/lib/navManifest.js
+++ b/server/lib/navManifest.js
@@ -44,11 +44,13 @@ const RAW_NAV_COMMANDS = [
{ id: 'nav.catalog.ingest', path: '/catalog/ingest', label: 'Catalog Ingest', section: 'Create', aliases: ['catalog-ingest', 'ingest', 'paste-scrap', 'extract-ingredients'], keywords: ['paste', 'snippet', 'scene', 'idea', 'extract', 'scrap', 'import-catalog'] },
{ id: 'nav.catalog.settings', path: '/catalog?settings=1', label: 'Catalog Types', section: 'Create', previousPaths: ['/settings/catalog'], aliases: ['catalog settings', 'catalog-settings', 'settings-catalog', 'catalog-types'], keywords: ['catalog', 'types', 'labels', 'character', 'place', 'object', 'taxonomy'] },
{ id: 'nav.media', path: '/media', label: 'Media Gen', section: 'Create', aliases: ['media', 'media-gen', 'mediagen', 'generate'], keywords: ['image', 'video', 'render', 'art', 'movie'] },
- { id: 'nav.media.image', path: '/media/image', label: 'Image', section: 'Create', previousPaths: ['/image-gen'], aliases: ['image-gen', 'imagegen', 'generate-image', 'sd', 'stable-diffusion'], keywords: ['stable diffusion', 'render', 'art', 'picture', 'photo', 'draw', 'flux', 'mflux'] },
- { id: 'nav.media.video', path: '/media/video', label: 'Video', section: 'Create', previousPaths: ['/video-gen'], aliases: ['video-gen', 'videogen', 'generate-video', 'ltx'], keywords: ['video', 'animate', 'movie', 'clip', 'ltx', 'episode composer', 'continuous video', 'multi-scene'] },
- { id: 'nav.media.history', path: '/media/history', label: 'Media History', section: 'Create', previousPaths: ['/media-history'], aliases: ['media-history', 'video-history'], keywords: ['videos', 'gallery', 'stitch'] },
- { id: 'nav.media.annotate', path: '/media/annotate', label: 'Annotate', section: 'Create', previousPaths: ['/annotate', '/annotate/:mediaKey'], aliases: ['annotate', 'media-annotate', 'sketch', 'draw-over', 'markup'], keywords: ['annotation', 'sketch', 'draw', 'markup', 'scribble', 'label', 'canvas', 'overlay', 'stroke'] },
- { id: 'nav.media.collections', path: '/media/collections', label: 'Collections', section: 'Create', aliases: ['collections', 'media-collections', 'stacks', 'projects'], keywords: ['bucket', 'group', 'project', 'album', 'organize'] },
+ { id: 'nav.media.image', path: '/media/image', label: 'Image', section: 'Create', tabGroup: 'media', tabId: 'image', previousPaths: ['/image-gen'], aliases: ['image-gen', 'imagegen', 'generate-image', 'sd', 'stable-diffusion'], keywords: ['stable diffusion', 'render', 'art', 'picture', 'photo', 'draw', 'flux', 'mflux'] },
+ { id: 'nav.media.video', path: '/media/video', label: 'Video', section: 'Create', tabGroup: 'media', tabId: 'video', previousPaths: ['/video-gen'], aliases: ['video-gen', 'videogen', 'generate-video', 'ltx'], keywords: ['video', 'animate', 'movie', 'clip', 'ltx', 'episode composer', 'continuous video', 'multi-scene'] },
+ { id: 'nav.media.threejs', path: '/media/threejs', label: 'Three.js Models', section: 'Create', tabGroup: 'media', tabId: 'threejs', tabLabel: 'Three.js', aliases: ['threejs', 'three-js', '3d-models', 'image-to-3d', 'img2threejs'], keywords: ['procedural', '3d', 'mesh', 'model', 'gallery', 'webgl', 'preview'] },
+ { id: 'nav.media.annotate', path: '/media/annotate', label: 'Annotate', section: 'Create', tabGroup: 'media', tabId: 'annotate', previousPaths: ['/annotate', '/annotate/:mediaKey'], aliases: ['annotate', 'media-annotate', 'sketch', 'draw-over', 'markup'], keywords: ['annotation', 'sketch', 'draw', 'markup', 'scribble', 'label', 'canvas', 'overlay', 'stroke'] },
+ { id: 'nav.media.timeline', path: '/media/timeline', label: 'Timeline', section: 'Create', tabGroup: 'media', tabId: 'timeline', aliases: ['timeline', 'video-timeline', 'editor'], keywords: ['edit', 'trim', 'composite', 'stitch', 'cut', 'compose'] },
+ { id: 'nav.media.history', path: '/media/history', label: 'Media History', section: 'Create', tabGroup: 'media', tabId: 'history', tabLabel: 'History', previousPaths: ['/media-history'], aliases: ['media-history', 'video-history'], keywords: ['videos', 'gallery', 'stitch'] },
+ { id: 'nav.media.collections', path: '/media/collections', label: 'Collections', section: 'Create', tabGroup: 'media', tabId: 'collections', aliases: ['collections', 'media-collections', 'stacks', 'projects'], keywords: ['bucket', 'group', 'project', 'album', 'organize'] },
{ id: 'nav.create.creative-director', path: '/creative-director', label: 'Creative Director', section: 'Create', previousPaths: ['/media/creative-director', '/media/creative-director/:id', '/media/creative-director/:id/:tab'], aliases: ['creative-director', 'creative', 'director', 'producer', 'orchestrator', 'long-form', 'episode'], keywords: ['story', 'episode', 'narrative', 'agent', 'auto-video', 'long-form', 'directive', 'production plan', 'plan board', 'orchestrator', 'studio', 'producer'] },
{ id: 'nav.create.creative-commission', path: '/creative-commission', label: 'Creative Commissions', section: 'Create', aliases: ['creative-commission', 'commissions', 'commission', 'creation-engine', 'autonomous-creation', 'standing-brief', 'recurring-brief'], keywords: ['schedule', 'recurring', 'nightly', 'brief', 'autonomous', 'creation engine', 'cron', 'feedback', 'taste', 'standing commission', 'auto-generate'] },
{ id: 'nav.create.fableloom', path: '/fableloom', label: 'FableLoom', section: 'Create', aliases: ['fableloom', 'fable-loom', 'loom', 'branching-narrative', 'interactive-story', 'branching-story'], keywords: ['branching', 'interactive', 'narrative', 'intent', 'endings', 'reader', 'scene', 'node', 'graph', 'nonlinear', 'play', 'story graph'] },
@@ -59,8 +61,6 @@ const RAW_NAV_COMMANDS = [
// The id stays `nav.media.sprites` — it's opaque and stored in palette
// history, so renaming it would orphan those entries.
{ id: 'nav.media.sprites', path: '/sprites', label: 'Sprites', section: 'Create', previousPaths: ['/media/sprites', '/media/sprites/:id'], aliases: ['sprites', 'sprite', 'sprite-manager', 'sprite-sheets'], keywords: ['sprite sheet', 'atlas', 'game art', 'pixel art', 'character animation', 'walk cycle', 'anchors'] },
- { id: 'nav.media.timeline', path: '/media/timeline', label: 'Timeline', section: 'Create', aliases: ['timeline', 'video-timeline', 'editor'], keywords: ['edit', 'trim', 'composite', 'stitch', 'cut', 'compose'] },
- { id: 'nav.media.threejs', path: '/media/threejs', label: 'Three.js Models', section: 'Create', aliases: ['threejs', 'three-js', '3d-models', 'image-to-3d', 'img2threejs'], keywords: ['procedural', '3d', 'mesh', 'model', 'gallery', 'webgl', 'preview'] },
{ id: 'nav.create.3d', path: '/3d', label: '3D', section: 'Create', previousPaths: ['/media/3d', '/media/3d/:id'], aliases: ['3d', 'image-to-mesh', 'mesh', 'trellis', 'pixal3d', 'neural-3d'], keywords: ['trellis', 'pixal3d', 'pixal', 'glb', 'mesh', 'photogrammetry', 'neural', 'image to 3d', 'render', 'generate', 'pbr'] },
{ id: 'nav.create.authors', path: '/authors', label: 'Authors', section: 'Create', aliases: ['authors', 'author', 'byline', 'author-persona', 'writer-persona'], keywords: ['author', 'byline', 'pen name', 'persona', 'writing style', 'bio', 'headshot', 'cover', 'book author'] },
{ id: 'nav.create.universe-builder', path: '/universes', label: 'Universes', section: 'Create', previousPaths: ['/media/universe-builder', '/media/universe-builder/:universeId', '/universe-builder', '/universe-builder/:universeId'], aliases: ['universes', 'universe', 'universe-builder', 'worldbuilder', 'worldbuild', 'world', 'lore', 'universe-canon', 'canon'], keywords: ['style template', 'sci-fi', 'fantasy', 'concept art', 'batch render', 'variations', 'characters', 'settings', 'objects', 'canon entries', 'list', 'manage'] },
@@ -70,18 +70,18 @@ const RAW_NAV_COMMANDS = [
{ id: 'nav.create.pipeline-continuity-bible', path: '/pipeline', label: 'Series Continuity', section: 'Create', aliases: ['continuity-bible', 'continuity', 'series-continuity', 'facts-ledger', 'established-facts', 'canon-ledger'], keywords: ['continuity', 'bible', 'facts', 'ledger', 'established', 'knowledge-leak', 'contradiction', 'timeline', 'wardrobe', 'prop', 'physical-traits', 'who-knows-what'] },
{ id: 'nav.create.pipeline-voice-fingerprint', path: '/pipeline', label: 'Voice Fingerprint', section: 'Create', aliases: ['voice-fingerprint', 'voice-drift', 'fingerprint', 'voice-matrix', 'prose-fingerprint'], keywords: ['voice', 'drift', 'fingerprint', 'matrix', 'style', 'prose', 'sentence-rhythm', 'outlier', 'metrics', 'deterministic', 'editorial', 'consistency', 'register', 'vocabulary-wells'] },
{ id: 'nav.create.pipeline-export', path: '/pipeline', label: 'Prose Series Export', section: 'Create', aliases: ['export', 'prose-export', 'series-export', 'manuscript-export', 'epub', 'ebook', 'publish'], keywords: ['export', 'manuscript', 'epub', 'ebook', 'pdf', 'print', 'interior', 'trade paperback', 'compiled', 'download', 'publish', 'trim size', 'title page', 'book'] },
- { id: 'nav.create.sharing', path: '/sharing', label: 'Sharing', section: 'Create', aliases: ['sharing', 'share', 'buckets', 'share-buckets'], keywords: ['google drive', 'dropbox', 'icloud', 'syncthing', 'export', 'import', 'collaborate', 'federation', 'peer', 'cross-network'] },
- { id: 'nav.create.sharing-duplicates', path: '/sharing/duplicates', label: 'Duplicates', section: 'Create', aliases: ['duplicates', 'duplicate-universes', 'duplicate-series', 'dedupe', 'merge-duplicates'], keywords: ['duplicate', 'merge', 'rename', 'same name', 'two copies', 'reconcile', 'collision'] },
+ { id: 'nav.create.sharing', path: '/sharing', label: 'Sharing', section: 'Create', tabGroup: 'sharing', tabId: 'buckets', tabLabel: 'Buckets', aliases: ['sharing', 'share', 'buckets', 'share-buckets'], keywords: ['google drive', 'dropbox', 'icloud', 'syncthing', 'export', 'import', 'collaborate', 'federation', 'peer', 'cross-network'] },
+ { id: 'nav.create.sharing-duplicates', path: '/sharing/duplicates', label: 'Duplicates', section: 'Create', tabGroup: 'sharing', tabId: 'duplicates', aliases: ['duplicates', 'duplicate-universes', 'duplicate-series', 'dedupe', 'merge-duplicates'], keywords: ['duplicate', 'merge', 'rename', 'same name', 'two copies', 'reconcile', 'collision'] },
+ { id: 'nav.create.sharing-conflicts', path: '/sharing/conflicts', label: 'Conflicts', section: 'Create', tabGroup: 'sharing', tabId: 'conflicts', aliases: ['conflicts', 'sync-conflicts', 'edit-conflicts', 'conflict-journal'], keywords: ['conflict', 'overwrite', 'lost edit', 'restore', 'merge fields', 'last write wins', 'diverged', 'recover'] },
{ id: 'nav.create.start-story', path: '/start-story', label: 'Start a Story', section: 'Create', aliases: ['start-story', 'start-a-story', 'start', 'begin-story', 'create-story', 'onramp'], keywords: ['start here', 'begin', 'idea', 'import', 'prose', 'story builder', 'writers room', 'importer', 'how to start', 'new', 'front door', 'choose'] },
{ id: 'nav.create.story-builder', path: '/story-builder', label: 'Story Builder', section: 'Create', aliases: ['story-builder', 'storybuilder', 'guided', 'new-story', 'story-wizard'], keywords: ['idea', 'universe', 'arc', 'reader map', 'guided', 'wizard', 'linear', 'lock', 'front door', 'episode', 'series'] },
{ id: 'nav.create.rounds', path: '/rounds', label: 'Rounds', section: 'Create', aliases: ['rounds', 'round', 'songs', 'song', 'a-cappella', 'acappella', 'sing'], keywords: ['round', 'song', 'lyrics', 'melody', 'harmony', 'dirge', 'ballad', 'a cappella', 'vocal', 'choir', 'singing', 'arrangement', 'quodlibet', '500 miles'] },
{ id: 'nav.create.rounds-guide', path: '/rounds/guide', label: 'Rounds Guide', section: 'Create', aliases: ['rounds-guide', 'round-guide', 'songs-guide', 'song-guide', 'singing-guide', 'round-learning'], keywords: ['rhythm shapes', 'dirge', 'voice layers', 'harmony', 'notation', 'lead sheet', 'solfege', 'learn round', 'learn song', 'a cappella', 'singing help'] },
{ id: 'nav.create.music', path: '/music', label: 'Music', section: 'Create', aliases: ['music', 'music-studio', 'generate-music'], keywords: ['music generation', 'ace-step', 'acestep', 'musicgen', 'audioldm', 'album', 'track', 'single', 'album art', 'artist', 'song generation', 'audio', 'beat', 'producer'] },
- { id: 'nav.create.music-generate', path: '/music/generate', label: 'Music Designer', section: 'Create', aliases: ['music-generate', 'music-designer', 'design-music', 'write-a-song', 'make-music'], keywords: ['generate music', 'music designer', 'describe music', 'enrich prompt', 'write lyrics', 'lyrics', 'ace-step', 'reference track', 'vibe', 'step by step', 'wizard'] },
- { id: 'nav.create.music-artists', path: '/music/artists', label: 'Music Artists', section: 'Create', aliases: ['music-artists', 'artists', 'artist', 'artist-persona', 'musician', 'band'], keywords: ['artist persona', 'musician', 'band', 'byline', 'portrait', 'genre', 'musical style', 'stage name'] },
- { id: 'nav.create.music-albums', path: '/music/albums', label: 'Music Albums', section: 'Create', aliases: ['albums', 'album', 'music-albums', 'discography', 'lp', 'ep'], keywords: ['album', 'cover art', 'tracklist', 'release', 'discography', 'record'] },
- { id: 'nav.create.music-tracks', path: '/music/tracks', label: 'Music Tracks', section: 'Create', aliases: ['tracks', 'track', 'music-tracks', 'singles', 'songs-audio'], keywords: ['track', 'single', 'audio', 'recording', 'lyrics', 'mp3', 'wav', 'generate track'] },
- { id: 'nav.create.sharing-conflicts', path: '/sharing/conflicts', label: 'Conflicts', section: 'Create', aliases: ['conflicts', 'sync-conflicts', 'edit-conflicts', 'conflict-journal'], keywords: ['conflict', 'overwrite', 'lost edit', 'restore', 'merge fields', 'last write wins', 'diverged', 'recover'] },
+ { id: 'nav.create.music-generate', path: '/music/generate', label: 'Music Designer', section: 'Create', tabGroup: 'music', tabId: 'generate', tabLabel: 'Generate', aliases: ['music-generate', 'music-designer', 'design-music', 'write-a-song', 'make-music'], keywords: ['generate music', 'music designer', 'describe music', 'enrich prompt', 'write lyrics', 'lyrics', 'ace-step', 'reference track', 'vibe', 'step by step', 'wizard'] },
+ { id: 'nav.create.music-artists', path: '/music/artists', label: 'Music Artists', section: 'Create', tabGroup: 'music', tabId: 'artists', tabLabel: 'Artists', aliases: ['music-artists', 'artists', 'artist', 'artist-persona', 'musician', 'band'], keywords: ['artist persona', 'musician', 'band', 'byline', 'portrait', 'genre', 'musical style', 'stage name'] },
+ { id: 'nav.create.music-albums', path: '/music/albums', label: 'Music Albums', section: 'Create', tabGroup: 'music', tabId: 'albums', tabLabel: 'Albums', aliases: ['albums', 'album', 'music-albums', 'discography', 'lp', 'ep'], keywords: ['album', 'cover art', 'tracklist', 'release', 'discography', 'record'] },
+ { id: 'nav.create.music-tracks', path: '/music/tracks', label: 'Music Tracks', section: 'Create', tabGroup: 'music', tabId: 'tracks', tabLabel: 'Tracks', aliases: ['tracks', 'track', 'music-tracks', 'singles', 'songs-audio'], keywords: ['track', 'single', 'audio', 'recording', 'lyrics', 'mp3', 'wav', 'generate track'] },
{ id: 'nav.media.settings', path: '/media/image?settings=1', label: 'Media Gen Settings', section: 'Create', aliases: ['media-settings', 'image-gen-settings', 'sd-settings', 'video-gen-settings'] },
{ id: 'nav.writers-room', path: '/writers-room', label: 'Writers Room', section: 'Create', aliases: ['writers-room', 'writersroom', 'writer', 'write', 'studio', 'novel'], keywords: ['prose', 'screenplay', 'story', 'draft', 'manuscript', 'literary', 'novel', 'short story'] },
{ id: 'nav.writers-room.guide', path: '/writers-room/guide', label: 'Writers Room Guide', section: 'Create', aliases: ['writers-room-guide', 'writing-guide', 'writing-rules', 'word-count', 'length-targets'], keywords: ['microfiction', 'flash fiction', 'short story', 'novelette', 'novella', 'novel length', 'word count', 'character count', 'book length', 'craft', 'writing advice', 'emotional roadmap', 'documentation', 'help'] },
@@ -89,22 +89,27 @@ const RAW_NAV_COMMANDS = [
{ id: 'nav.settings.providers', path: '/ai', label: 'Providers', section: 'Models', tabId: 'providers', aliases: ['providers', 'ai-providers'] },
{ id: 'nav.settings.fleet-llm', path: '/ai/fleet', label: 'Fleet LLM Setup', section: 'Settings', aliases: ['fleet-llm', 'gpu-host', 'remote-ai-provider'], keywords: ['3090', 'tailscale', 'vllm', 'qwen', 'coding model', 'dedicated host'] },
- { id: 'nav.brain.inbox', path: '/brain/inbox', label: 'Inbox', section: 'Brain', aliases: ['brain', 'brain-inbox', 'inbox'] },
- { id: 'nav.brain.config', path: '/brain/config', label: 'Config', section: 'Brain', aliases: ['brain-config'] },
- { id: 'nav.brain.daily-log', path: '/brain/daily-log', label: 'Daily Log', section: 'Brain', aliases: ['daily-log', 'journal'] },
- { id: 'nav.brain.digest', path: '/brain/digest', label: 'Digest', section: 'Brain', aliases: ['brain-digest'] },
- { id: 'nav.brain.feeds', path: '/brain/feeds', label: 'Feeds', section: 'Brain', aliases: ['brain-feeds', 'feeds', 'rss'], keywords: ['rss', 'subscriptions'] },
- { id: 'nav.brain.graph', path: '/brain/graph', label: 'Graph', section: 'Brain', aliases: ['brain-graph'] },
- { id: 'nav.brain.ideas', path: '/brain/ideas', label: 'Ideas', section: 'Brain', aliases: ['brain-ideas', 'ideas'], keywords: ['brainstorm', 'creative', 'thought', 'concept'] },
+ { id: 'nav.brain.inbox', path: '/brain/inbox', label: 'Inbox', section: 'Brain', tabGroup: 'brain', tabId: 'inbox', aliases: ['brain', 'brain-inbox', 'inbox'] },
+ { id: 'nav.brain.ideas', path: '/brain/ideas', label: 'Ideas', section: 'Brain', tabGroup: 'brain', tabId: 'ideas', aliases: ['brain-ideas', 'ideas'], keywords: ['brainstorm', 'creative', 'thought', 'concept'] },
+ { id: 'nav.brain.daily-log', path: '/brain/daily-log', label: 'Daily Log', section: 'Brain', tabGroup: 'brain', tabId: 'daily-log', aliases: ['daily-log', 'journal'] },
+ { id: 'nav.brain.links', path: '/brain/links', label: 'Links', section: 'Brain', tabGroup: 'brain', tabId: 'links', aliases: ['brain-links'] },
+ { id: 'nav.brain.memory', path: '/brain/memory', label: 'Memory', section: 'Brain', tabGroup: 'brain', tabId: 'memory', aliases: ['brain-memory', 'memory'] },
+ { id: 'nav.brain.notes', path: '/brain/notes', label: 'Notes', section: 'Brain', tabGroup: 'brain', tabId: 'notes', aliases: ['brain-notes', 'notes'] },
+ { id: 'nav.brain.graph', path: '/brain/graph', label: 'Graph', section: 'Brain', tabGroup: 'brain', tabId: 'graph', aliases: ['brain-graph'] },
+ { id: 'nav.brain.digest', path: '/brain/digest', label: 'Digest', section: 'Brain', tabGroup: 'brain', tabId: 'digest', aliases: ['brain-digest'] },
+ { id: 'nav.brain.feeds', path: '/brain/feeds', label: 'Feeds', section: 'Brain', tabGroup: 'brain', tabId: 'feeds', aliases: ['brain-feeds', 'feeds', 'rss'], keywords: ['rss', 'subscriptions'] },
+ { id: 'nav.brain.trust', path: '/brain/trust', label: 'Trust', section: 'Brain', tabGroup: 'brain', tabId: 'trust', aliases: ['brain-trust'] },
+ { id: 'nav.brain.import', path: '/brain/import', label: 'Import', section: 'Brain', tabGroup: 'brain', tabId: 'import', aliases: ['brain-import', 'import-chatgpt', 'chatgpt-import'], keywords: ['chatgpt', 'openai', 'export', 'third-party'] },
+ // Spotify and YouTube moved out of Settings into Brain (alongside Timeline,
+ // which these feed) — ids kept stable since they're opaque, persisted
+ // palette-history values; only the path and section move.
+ { id: 'nav.settings.spotify', path: '/brain/spotify', label: 'Spotify', section: 'Brain', tabGroup: 'brain', tabId: 'spotify', previousPaths: ['/settings/spotify'], aliases: ['settings-spotify', 'spotify', 'spotify-settings', 'brain-spotify'], keywords: ['spotify', 'music', 'listening', 'recently played', 'oauth', 'timeline', 'taste', 'media'] },
+ { id: 'nav.settings.youtube', path: '/brain/youtube', label: 'YouTube', section: 'Brain', tabGroup: 'brain', tabId: 'youtube', previousPaths: ['/settings/youtube'], aliases: ['settings-youtube', 'youtube', 'youtube-settings', 'brain-youtube'], keywords: ['youtube', 'watch history', 'video', 'scrape', 'takeout', 'timeline', 'taste', 'media'] },
+ { id: 'nav.brain.config', path: '/brain/config', label: 'Config', section: 'Brain', tabGroup: 'brain', tabId: 'config', aliases: ['brain-config'] },
{ id: 'nav.brain.idealoom', path: '/brain/ideas?view=lists', label: 'IdeaLoom Lists', section: 'Brain', aliases: ['idealoom', 'idea-loom', 'idealoom-lists'], keywords: ['obsidian', 'vault', 'ordered list', 'local lists'] },
- { id: 'nav.brain.import', path: '/brain/import', label: 'Import', section: 'Brain', aliases: ['brain-import', 'import-chatgpt', 'chatgpt-import'], keywords: ['chatgpt', 'openai', 'export', 'third-party'] },
- { id: 'nav.brain.links', path: '/brain/links', label: 'Links', section: 'Brain', aliases: ['brain-links'] },
- { id: 'nav.brain.memory', path: '/brain/memory', label: 'Memory', section: 'Brain', aliases: ['brain-memory', 'memory'] },
- { id: 'nav.brain.notes', path: '/brain/notes', label: 'Notes', section: 'Brain', aliases: ['brain-notes', 'notes'] },
{ id: 'nav.rapid-reader', path: '/rapid-reader', label: 'Rapid Reader', section: 'Brain', aliases: ['rapid-reader', 'speed-reader', 'rsvp', 'spritz'], keywords: ['speed reading', 'rapid reading', 'rsvp', 'spritz', 'word per minute', 'wpm', 'focal'] },
// No 'songs'/'song' aliases — those already resolve to nav.create.rounds (first-declared wins).
{ id: 'nav.brain.songbook', path: '/songbook', label: 'SongBook', section: 'Brain', aliases: ['songbook', 'song-book', 'tabs', 'chords', 'guitar-tabs'], keywords: ['guitar', 'tab', 'tablature', 'chord chart', 'lyrics', 'sheet music', 'repertoire', 'autoscroll'] },
- { id: 'nav.brain.trust', path: '/brain/trust', label: 'Trust', section: 'Brain', aliases: ['brain-trust'] },
{ id: 'nav.calendar.agenda', path: '/calendar/agenda', label: 'Agenda', section: 'Calendar', tabGroup: 'calendar', tabId: 'agenda', aliases: ['calendar', 'agenda'] },
{ id: 'nav.calendar.day', path: '/calendar/day', label: 'Day', section: 'Calendar', tabGroup: 'calendar', tabId: 'day', aliases: ['calendar-day'] },
@@ -115,27 +120,28 @@ const RAW_NAV_COMMANDS = [
{ id: 'nav.calendar.sync', path: '/calendar/sync', label: 'Sync', section: 'Calendar', tabGroup: 'calendar', tabId: 'sync', aliases: ['calendar-sync'] },
{ id: 'nav.calendar.config', path: '/calendar/config', label: 'Config', section: 'Calendar', tabGroup: 'calendar', tabId: 'config', aliases: ['calendar-config'] },
- { id: 'nav.cos.tasks', path: '/cos/tasks', label: 'Tasks', section: 'Chief of Staff', aliases: ['tasks', 'cos', 'cos-tasks', 'chief-of-staff'] },
- { id: 'nav.cos.agents', path: '/cos/agents', label: 'Agents', section: 'Chief of Staff', aliases: ['agents', 'cos-agents'] },
- { id: 'nav.cos.briefing', path: '/cos/briefing', label: 'Briefing', section: 'Chief of Staff', aliases: ['briefing', 'cos-briefing'] },
- { id: 'nav.cos.config', path: '/cos/config', label: 'Config', section: 'Chief of Staff', aliases: ['cos-config'] },
- { id: 'nav.cos.digest', path: '/cos/digest', label: 'Digest', section: 'Chief of Staff', aliases: ['cos-digest'] },
+ { id: 'nav.cos.briefing', path: '/cos/briefing', label: 'Briefing', section: 'Chief of Staff', tabGroup: 'cos', tabId: 'briefing', aliases: ['briefing', 'cos-briefing'] },
+ { id: 'nav.cos.tasks', path: '/cos/tasks', label: 'Tasks', section: 'Chief of Staff', tabGroup: 'cos', tabId: 'tasks', aliases: ['tasks', 'cos', 'cos-tasks', 'chief-of-staff'] },
+ { id: 'nav.cos.agents', path: '/cos/agents', label: 'Agents', section: 'Chief of Staff', tabGroup: 'cos', tabId: 'agents', aliases: ['agents', 'cos-agents'] },
+ { id: 'nav.cos.jobs', path: '/cos/jobs', label: 'System Tasks', section: 'Chief of Staff', tabGroup: 'cos', tabId: 'jobs', aliases: ['cos-jobs', 'system-tasks'] },
+ { id: 'nav.cos.runs', path: '/cos/runs', label: 'Runs', section: 'Chief of Staff', tabGroup: 'cos', tabId: 'runs', previousPaths: ['/devtools/runs'], aliases: ['runs', 'ai-runs', 'cos-runs', 'recent-runs', 'run-history'], keywords: ['runs', 'run history', 'recent runs', 'ai runs', 'agent runs', 'failed runs'] },
+ { id: 'nav.cos.run-events', path: '/cos/run-events', label: 'Run Events', section: 'Chief of Staff', tabGroup: 'cos', tabId: 'run-events', aliases: ['run-events', 'cos-run-events', 'run-event-ledger', 'lifecycle-events'], keywords: ['run events', 'lifecycle', 'ledger', 'replay', 'diagnostics', 'orphaned', 'handoff', 'reconnect', 'interrupted', 'why did this run fail'] },
+ { id: 'nav.cos.schedule', path: '/cos/schedule', label: 'Schedule', section: 'Chief of Staff', tabGroup: 'cos', tabId: 'schedule', aliases: ['schedule', 'cos-schedule'] },
+ { id: 'nav.cos.workflow', path: '/cos/workflow', label: 'Timeline', section: 'Chief of Staff', tabGroup: 'cos', tabId: 'workflow', aliases: ['workflow', 'cos-workflow', 'cos-timeline', 'schedule-timeline'], keywords: ['timeline', 'schedule', 'launch order', 'run order', 'gantt', 'upcoming runs', 'overlap', 'dependencies'] },
+ { id: 'nav.cos.digest', path: '/cos/digest', label: 'Digest', section: 'Chief of Staff', tabGroup: 'cos', tabId: 'digest', aliases: ['cos-digest'] },
+ { id: 'nav.cos.gsd', path: '/cos/gsd', label: 'GSD', section: 'Chief of Staff', tabGroup: 'cos', tabId: 'gsd', feature: 'gsd', aliases: ['gsd', 'cos-gsd'] },
+ { id: 'nav.cos.productivity', path: '/cos/productivity', label: 'Productivity', section: 'Chief of Staff', tabGroup: 'cos', tabId: 'productivity', aliases: ['cos-productivity', 'work-patterns', 'streaks'] },
+ { id: 'nav.cos.learning', path: '/cos/learning', label: 'Learning', section: 'Chief of Staff', tabGroup: 'cos', tabId: 'learning', aliases: ['cos-learning'] },
+ { id: 'nav.cos.memory', path: '/cos/memory', label: 'Memory', section: 'Chief of Staff', tabGroup: 'cos', tabId: 'memory', aliases: ['cos-memory'] },
+ { id: 'nav.cos.mind', path: '/cos/mind', label: 'Mind', section: 'Chief of Staff', tabGroup: 'cos', tabId: 'mind', aliases: ['cos-mind', 'persistent-mind', 'mind-chat'], keywords: ['persistent mind', 'chat', 'annotation', 'resident mind', 'conversation'] },
+ { id: 'nav.cos.health', path: '/cos/health', label: 'Health', section: 'Chief of Staff', tabGroup: 'cos', tabId: 'health', aliases: ['cos-health', 'health'] },
+ { id: 'nav.cos.config', path: '/cos/config', label: 'Config', section: 'Chief of Staff', tabGroup: 'cos', tabId: 'config', aliases: ['cos-config'] },
{ id: 'nav.feature-agents', path: '/feature-agents', label: 'Feature Agents', section: 'Chief of Staff', aliases: ['feature-agents'] },
- { id: 'nav.cos.gsd', path: '/cos/gsd', label: 'GSD', section: 'Chief of Staff', feature: 'gsd', aliases: ['gsd', 'cos-gsd'] },
- { id: 'nav.cos.health', path: '/cos/health', label: 'Health', section: 'Chief of Staff', aliases: ['cos-health', 'health'] },
- { id: 'nav.cos.learning', path: '/cos/learning', label: 'Learning', section: 'Chief of Staff', aliases: ['cos-learning'] },
- { id: 'nav.cos.memory', path: '/cos/memory', label: 'Memory', section: 'Chief of Staff', aliases: ['cos-memory'] },
- { id: 'nav.cos.mind', path: '/cos/mind', label: 'Mind', section: 'Chief of Staff', aliases: ['cos-mind', 'persistent-mind', 'mind-chat'], keywords: ['persistent mind', 'chat', 'annotation', 'resident mind', 'conversation'] },
{ id: 'nav.cos.mind-tools', path: '/cos/mind?panel=tools', label: 'Mind Tools', section: 'Chief of Staff', previousPaths: ['/cos/tools', '/cos/mind/tools'], aliases: ['mind-tools', 'persistent-mind-tools', 'tools-access'], keywords: ['persistent mind', 'tools', 'access', 'permissions', 'authority', 'capabilities'] },
- { id: 'nav.cos.runs', path: '/cos/runs', label: 'Runs', section: 'Chief of Staff', previousPaths: ['/devtools/runs'], aliases: ['runs', 'ai-runs', 'cos-runs', 'recent-runs', 'run-history'], keywords: ['runs', 'run history', 'recent runs', 'ai runs', 'agent runs', 'failed runs'] },
- { id: 'nav.cos.run-events', path: '/cos/run-events', label: 'Run Events', section: 'Chief of Staff', aliases: ['run-events', 'cos-run-events', 'run-event-ledger', 'lifecycle-events'], keywords: ['run events', 'lifecycle', 'ledger', 'replay', 'diagnostics', 'orphaned', 'handoff', 'reconnect', 'interrupted', 'why did this run fail'] },
- { id: 'nav.cos.schedule', path: '/cos/schedule', label: 'Schedule', section: 'Chief of Staff', aliases: ['schedule', 'cos-schedule'] },
{ id: 'nav.social-agents', path: '/agents', label: 'Social Agents', section: 'Chief of Staff', aliases: ['social-agents'] },
// The page at /cos/workflow is now the Schedule Timeline (launch-order
// visualization + inline schedule editor). The `workflow` aliases are kept
// for muscle memory; the bare `timeline` alias stays with /media/timeline.
- { id: 'nav.cos.workflow', path: '/cos/workflow', label: 'Timeline', section: 'Chief of Staff', aliases: ['workflow', 'cos-workflow', 'cos-timeline', 'schedule-timeline'], keywords: ['timeline', 'schedule', 'launch order', 'run order', 'gantt', 'upcoming runs', 'overlap', 'dependencies'] },
- { id: 'nav.cos.productivity', path: '/cos/productivity', label: 'Productivity', section: 'Chief of Staff', aliases: ['cos-productivity', 'work-patterns', 'streaks'] },
{ id: 'nav.messages.inbox', path: '/messages/inbox', label: 'Inbox', section: 'Comms', tabGroup: 'messages', tabId: 'inbox', aliases: ['messages', 'comms', 'comms-inbox'], keywords: ['comms', 'email', 'inbox'] },
{ id: 'nav.messages.drafts', path: '/messages/drafts', label: 'Drafts', section: 'Comms', tabGroup: 'messages', tabId: 'drafts', aliases: ['drafts', 'comms-drafts'], keywords: ['comms'] },
@@ -151,11 +157,6 @@ const RAW_NAV_COMMANDS = [
{ id: 'nav.x', path: '/x', label: 'X', section: 'Comms', aliases: ['x', 'x-com', 'twitter', 'comms-x'], keywords: ['comms', 'social', 'reach', 'engagement', 'shadowban', 'diagnostics'] },
{ id: 'nav.timeline', path: '/timeline', label: 'Timeline', section: 'Brain', aliases: ['activity-timeline', 'activity', 'my-day', 'life-log', 'life-timeline'], keywords: ['human activity', 'life log', 'timeline', 'messages', 'calendar', 'history', 'what did i do', 'daily', 'import', 'backfill', 'whatsapp', 'spotify', 'discord', 'youtube'] },
{ id: 'nav.tribe', path: '/tribe', label: 'Tribe', section: 'Brain', aliases: ['tribe', 'relationships', 'relationship-manager', 'people'], keywords: ['dunbar', 'friends', 'family', 'network', 'social graph', 'care cadence'] },
- // Moved out of Settings into Brain (alongside Timeline, which these feed) —
- // ids kept stable since they're opaque, persisted palette-history values;
- // only the path and section move, per the /models/* precedent above.
- { id: 'nav.settings.spotify', path: '/brain/spotify', label: 'Spotify', section: 'Brain', previousPaths: ['/settings/spotify'], aliases: ['settings-spotify', 'spotify', 'spotify-settings', 'brain-spotify'], keywords: ['spotify', 'music', 'listening', 'recently played', 'oauth', 'timeline', 'taste', 'media'] },
- { id: 'nav.settings.youtube', path: '/brain/youtube', label: 'YouTube', section: 'Brain', previousPaths: ['/settings/youtube'], aliases: ['settings-youtube', 'youtube', 'youtube-settings', 'brain-youtube'], keywords: ['youtube', 'watch history', 'video', 'scrape', 'takeout', 'timeline', 'taste', 'media'] },
{ id: 'nav.devtools.agents', path: '/devtools/agents', label: 'AI Agents', section: 'Dev Tools', aliases: ['ai-agents', 'devtools'] },
{ id: 'nav.browser', path: '/browser', label: 'Browser', section: 'Dev Tools', aliases: ['browser'] },
@@ -180,51 +181,54 @@ const RAW_NAV_COMMANDS = [
// the grouping shows up here as a `keywords` group tag on every section plus a
// `twin-<group>` alias on one member of each group, so "twin sources" lands
// somewhere sensible without adding a group-only path that no route serves.
- { id: 'nav.twin.overview', path: '/digital-twin/overview', label: 'Overview', section: 'Identity', aliases: ['twin-profile', 'digital-twin', 'twin'], keywords: ['profile'] },
- { id: 'nav.twin.accounts', path: '/digital-twin/accounts', label: 'Accounts', section: 'Identity', aliases: ['twin-accounts'], keywords: ['sources'] },
- { id: 'nav.twin.appearance', path: '/digital-twin/appearance', label: 'Appearance', section: 'Identity', aliases: ['twin-appearance', 'appearance', 'photo'], keywords: ['presence', 'image', 'photo', 'vision', 'face', 'identity', 'presentation', 'look', 'avatar'] },
+ // Declaration order below is the page's tab order, which runs group by group
+ // (Profile → Sources → Assessment → Presence → Legacy) — getPageNavTabs
+ // preserves it, and SECTION_GROUPS slices the same ids back into headers.
+ { id: 'nav.twin.overview', path: '/digital-twin/overview', label: 'Overview', section: 'Identity', tabGroup: 'digital-twin', tabId: 'overview', aliases: ['twin-profile', 'digital-twin', 'twin'], keywords: ['profile'] },
+ { id: 'nav.twin.identity', path: '/digital-twin/identity', label: 'Identity', section: 'Identity', tabGroup: 'digital-twin', tabId: 'identity', aliases: ['twin-identity', 'identity'], keywords: ['profile'] },
+ { id: 'nav.twin.personas', path: '/digital-twin/personas', label: 'Personas', section: 'Identity', tabGroup: 'digital-twin', tabId: 'personas', aliases: ['twin-personas', 'personas', 'persona'], keywords: ['profile', 'context', 'professional', 'casual', 'voice', 'mode'] },
+ { id: 'nav.twin.goals', path: '/digital-twin/goals', label: 'Twin Goals', section: 'Identity', tabGroup: 'digital-twin', tabId: 'goals', tabLabel: 'Goals', aliases: ['twin-goals'], keywords: ['profile'] },
+ { id: 'nav.twin.taste', path: '/digital-twin/taste', label: 'Taste', section: 'Identity', tabGroup: 'digital-twin', tabId: 'taste', aliases: ['twin-taste'], keywords: ['profile'] },
+ { id: 'nav.twin.documents', path: '/digital-twin/documents', label: 'Documents', section: 'Identity', tabGroup: 'digital-twin', tabId: 'documents', aliases: ['twin-sources', 'twin-documents'], keywords: ['sources'] },
+ { id: 'nav.twin.import', path: '/digital-twin/import', label: 'Import', section: 'Identity', tabGroup: 'digital-twin', tabId: 'import', aliases: ['twin-import'], keywords: ['sources'] },
+ { id: 'nav.twin.accounts', path: '/digital-twin/accounts', label: 'Accounts', section: 'Identity', tabGroup: 'digital-twin', tabId: 'accounts', aliases: ['twin-accounts'], keywords: ['sources'] },
+ { id: 'nav.twin.interview', path: '/digital-twin/interview', label: 'Interview', section: 'Identity', tabGroup: 'digital-twin', tabId: 'interview', aliases: ['twin-interview'], keywords: ['sources'] },
+ { id: 'nav.twin.autobiography', path: '/digital-twin/autobiography', label: 'Autobiography', section: 'Identity', tabGroup: 'digital-twin', tabId: 'autobiography', aliases: ['twin-autobiography', 'autobiography'], keywords: ['sources'] },
+ { id: 'nav.twin.enrich', path: '/digital-twin/enrich', label: 'Enrich', section: 'Identity', tabGroup: 'digital-twin', tabId: 'enrich', aliases: ['twin-enrich'], keywords: ['sources'] },
+ { id: 'nav.twin.test', path: '/digital-twin/test', label: 'Test', section: 'Identity', tabGroup: 'digital-twin', tabId: 'test', aliases: ['twin-assessment', 'twin-test'], keywords: ['assessment'] },
+ { id: 'nav.twin.personality', path: '/digital-twin/personality', label: 'Personality', section: 'Identity', tabGroup: 'digital-twin', tabId: 'personality', aliases: ['twin-personality', 'personality', 'model-personality'], keywords: ['assessment', 'llm', 'model', 'traits', 'radar', 'alignment', 'self-profile', 'compare', 'sycophancy'] },
+ { id: 'nav.twin.voice', path: '/digital-twin/voice', label: 'Voice', section: 'Identity', tabGroup: 'digital-twin', tabId: 'voice', aliases: ['twin-presence', 'twin-voice', 'voice-style', 'spoken-written'], keywords: ['presence', 'speech', 'spoken', 'written', 'transcript', 'style', 'comparison', 'communication'] },
+ { id: 'nav.twin.appearance', path: '/digital-twin/appearance', label: 'Appearance', section: 'Identity', tabGroup: 'digital-twin', tabId: 'appearance', aliases: ['twin-appearance', 'appearance', 'photo'], keywords: ['presence', 'image', 'photo', 'vision', 'face', 'identity', 'presentation', 'look', 'avatar'] },
+ { id: 'nav.twin.avatar-bio', path: '/digital-twin/avatar-bio', label: 'Avatar Bio', section: 'Identity', tabGroup: 'digital-twin', tabId: 'avatar-bio', aliases: ['avatar-bio', 'twin-avatar-bio', 'avatar', 'live-avatar'], keywords: ['presence', 'heygen', 'tavus', 'simli', 'elevenlabs', 'persona', 'bio', 'voice', 'live avatar', 'who i am', 'how i speak', 'what i know'] },
+ { id: 'nav.twin.export', path: '/digital-twin/export', label: 'Export', section: 'Identity', tabGroup: 'digital-twin', tabId: 'export', aliases: ['twin-export'], keywords: ['legacy'] },
+ { id: 'nav.twin.legacy', path: '/digital-twin/legacy', label: 'Legacy Bundle', section: 'Identity', tabGroup: 'digital-twin', tabId: 'legacy', tabLabel: 'Legacy', aliases: ['twin-legacy', 'legacy-export', 'legacy-bundle', 'legacy'], keywords: ['legacy', 'bundle', 'backup', 'portable', 'pdf', 'archive', 'time capsule', 'export'] },
+ { id: 'nav.twin.time-capsule', path: '/digital-twin/time-capsule', label: 'Time Capsule', section: 'Identity', tabGroup: 'digital-twin', tabId: 'time-capsule', aliases: ['time-capsule', 'twin-time-capsule', 'capsule'], keywords: ['legacy', 'archive', 'snapshot'] },
{ id: 'nav.ask', path: '/ask', label: 'Ask Yourself', section: 'Identity', aliases: ['ask', 'ask-yourself', 'twin-chat'], keywords: ['chat', 'twin', 'conversation', 'advise', 'draft'] },
- { id: 'nav.twin.autobiography', path: '/digital-twin/autobiography', label: 'Autobiography', section: 'Identity', aliases: ['twin-autobiography', 'autobiography'], keywords: ['sources'] },
- { id: 'nav.twin.avatar-bio', path: '/digital-twin/avatar-bio', label: 'Avatar Bio', section: 'Identity', aliases: ['avatar-bio', 'twin-avatar-bio', 'avatar', 'live-avatar'], keywords: ['presence', 'heygen', 'tavus', 'simli', 'elevenlabs', 'persona', 'bio', 'voice', 'live avatar', 'who i am', 'how i speak', 'what i know'] },
{ id: 'nav.character', path: '/character', label: 'Character', section: 'Identity', aliases: ['character'] },
- { id: 'nav.twin.documents', path: '/digital-twin/documents', label: 'Documents', section: 'Identity', aliases: ['twin-sources', 'twin-documents'], keywords: ['sources'] },
- { id: 'nav.twin.enrich', path: '/digital-twin/enrich', label: 'Enrich', section: 'Identity', aliases: ['twin-enrich'], keywords: ['sources'] },
- { id: 'nav.twin.export', path: '/digital-twin/export', label: 'Export', section: 'Identity', aliases: ['twin-export'], keywords: ['legacy'] },
- { id: 'nav.twin.legacy', path: '/digital-twin/legacy', label: 'Legacy Bundle', section: 'Identity', aliases: ['twin-legacy', 'legacy-export', 'legacy-bundle', 'legacy'], keywords: ['legacy', 'bundle', 'backup', 'portable', 'pdf', 'archive', 'time capsule', 'export'] },
{ id: 'nav.goals', path: '/goals/list', label: 'Goals', section: 'Goals', tabGroup: 'goals', tabId: 'list', tabLabel: 'List', aliases: ['goals'] },
{ id: 'nav.goals.tree', path: '/goals/tree', label: 'Goals Tree', section: 'Goals', tabGroup: 'goals', tabId: 'tree', tabLabel: 'Tree', aliases: ['goals-tree', 'goal-tree'], keywords: ['hierarchy', 'decomposition', 'subgoals', 'breakdown'] },
- { id: 'nav.twin.goals', path: '/digital-twin/goals', label: 'Twin Goals', section: 'Identity', aliases: ['twin-goals'], keywords: ['profile'] },
- { id: 'nav.twin.identity', path: '/digital-twin/identity', label: 'Identity', section: 'Identity', aliases: ['twin-identity', 'identity'], keywords: ['profile'] },
- { id: 'nav.twin.import', path: '/digital-twin/import', label: 'Import', section: 'Identity', aliases: ['twin-import'], keywords: ['sources'] },
{ id: 'nav.insights', path: '/insights/overview', label: 'Insights', section: 'Identity', tabGroup: 'insights', tabId: 'overview', tabLabel: 'Overview', aliases: ['insights'] },
{ id: 'nav.insights.genome-health', path: '/insights/genome-health', label: 'Genome-Health', section: 'Identity', tabGroup: 'insights', tabId: 'genome-health', aliases: ['genome-health', 'insights-genome-health'], keywords: ['genome', 'dna', 'health', 'longevity', 'genetic'] },
{ id: 'nav.insights.taste-identity', path: '/insights/taste-identity', label: 'Taste & Identity', section: 'Identity', tabGroup: 'insights', tabId: 'taste-identity', aliases: ['taste-identity', 'insights-taste-identity'], keywords: ['taste', 'identity', 'preferences', 'aesthetic'] },
{ id: 'nav.insights.cross-domain', path: '/insights/cross-domain', label: 'Cross-Domain Patterns', section: 'Identity', tabGroup: 'insights', tabId: 'cross-domain', aliases: ['cross-domain', 'insights-cross-domain', 'cross-domain-patterns'], keywords: ['cross domain', 'patterns', 'correlations', 'connections'] },
{ id: 'nav.insights.goal-scorecard', path: '/insights/goal-scorecard', label: 'Goal Scorecard', section: 'Identity', tabGroup: 'insights', tabId: 'goal-scorecard', aliases: ['goal-scorecard', 'insights-goal-scorecard', 'scorecard'], keywords: ['goal', 'scorecard', 'time allocation', 'effectiveness', 'goal alignment', 'time vs goals'] },
- { id: 'nav.twin.interview', path: '/digital-twin/interview', label: 'Interview', section: 'Identity', aliases: ['twin-interview'], keywords: ['sources'] },
- { id: 'nav.twin.personality', path: '/digital-twin/personality', label: 'Personality', section: 'Identity', aliases: ['twin-personality', 'personality', 'model-personality'], keywords: ['assessment', 'llm', 'model', 'traits', 'radar', 'alignment', 'self-profile', 'compare', 'sycophancy'] },
- { id: 'nav.twin.personas', path: '/digital-twin/personas', label: 'Personas', section: 'Identity', aliases: ['twin-personas', 'personas', 'persona'], keywords: ['profile', 'context', 'professional', 'casual', 'voice', 'mode'] },
- { id: 'nav.twin.taste', path: '/digital-twin/taste', label: 'Taste', section: 'Identity', aliases: ['twin-taste'], keywords: ['profile'] },
- { id: 'nav.twin.test', path: '/digital-twin/test', label: 'Test', section: 'Identity', aliases: ['twin-assessment', 'twin-test'], keywords: ['assessment'] },
- { id: 'nav.twin.time-capsule', path: '/digital-twin/time-capsule', label: 'Time Capsule', section: 'Identity', aliases: ['time-capsule', 'twin-time-capsule', 'capsule'], keywords: ['legacy', 'archive', 'snapshot'] },
- { id: 'nav.twin.voice', path: '/digital-twin/voice', label: 'Voice', section: 'Identity', aliases: ['twin-presence', 'twin-voice', 'voice-style', 'spoken-written'], keywords: ['presence', 'speech', 'spoken', 'written', 'transcript', 'style', 'comparison', 'communication'] },
{ id: 'nav.identity.privacy-overview', path: '/privacy/overview', label: 'Privacy', section: 'Identity', tabGroup: 'privacy', tabId: 'overview', tabLabel: 'Overview', aliases: ['privacy', 'privacy-center', 'my-data'], keywords: ['pii', 'privacy', 'personal data', 'identity facts', 'who has my data'] },
{ id: 'nav.identity.privacy-vault', path: '/privacy/vault', label: 'Vault', section: 'Identity', tabGroup: 'privacy', tabId: 'vault', aliases: ['vault', 'pii-vault', 'privacy-vault'], keywords: ['pii', 'vault', 'encrypted', 'ssn', 'address', 'passport', 'identity'] },
{ id: 'nav.identity.privacy-organizations', path: '/privacy/organizations', label: 'Organizations', section: 'Identity', tabGroup: 'privacy', tabId: 'organizations', aliases: ['organizations', 'orgs', 'trusted-orgs'], keywords: ['organizations', 'banks', 'utilities', 'who holds my data', 'registry', 'holdings'] },
{ id: 'nav.identity.privacy-changes', path: '/privacy/changes', label: 'Changes', section: 'Identity', tabGroup: 'privacy', tabId: 'changes', aliases: ['changes', 'change-of-address', 'address-change', 'privacy-changes'], keywords: ['change of address', 'moved', 'update address', 'inventory', 'who needs updating', 'new phone', 'new email'] },
{ id: 'nav.identity.privacy-brokers', path: '/privacy/brokers', label: 'Brokers', section: 'Identity', tabGroup: 'privacy', tabId: 'brokers', aliases: ['brokers', 'data brokers', 'opt out', 'remove my data', 'privacy-brokers'], keywords: ['data brokers', 'opt out', 'remove my data', 'people search', 'exposure', 'spokeo', 'whitepages', 'ccpa', 'delete my data'] },
- { id: 'nav.meatspace.overview', path: '/meatspace/overview', label: 'Overview', section: 'Health', aliases: ['meatspace'] },
- { id: 'nav.meatspace.health', path: '/meatspace/health', label: 'Body Health', section: 'Health', aliases: ['meatspace-health', 'body-health'], keywords: ['health', 'vitals', 'wellbeing', 'biometrics'] },
- { id: 'nav.meatspace.body', path: '/meatspace/body', label: 'Body', section: 'Health', aliases: ['meatspace-body', 'body'] },
- { id: 'nav.meatspace.alcohol', path: '/meatspace/alcohol', label: 'Alcohol', section: 'Health', aliases: ['meatspace-alcohol', 'alcohol'] },
- { id: 'nav.meatspace.nicotine', path: '/meatspace/nicotine', label: 'Nicotine', section: 'Health', aliases: ['meatspace-nicotine', 'nicotine'] },
- { id: 'nav.meatspace.age', path: '/meatspace/age', label: 'Age', section: 'Health', aliases: ['meatspace-age'] },
- { id: 'nav.meatspace.blood', path: '/meatspace/blood', label: 'Blood', section: 'Health', aliases: ['meatspace-blood', 'blood'] },
- { id: 'nav.meatspace.export', path: '/meatspace/export', label: 'Export', section: 'Health', aliases: ['meatspace-export', 'clinician-export', 'health-export'], keywords: ['clinician', 'doctor', 'print', 'pdf', 'summary', 'report', 'blood', 'lifestyle'] },
- { id: 'nav.meatspace.genome', path: '/meatspace/genome', label: 'Genome', section: 'Health', aliases: ['meatspace-genome', 'genome'] },
- { id: 'nav.meatspace.lifestyle', path: '/meatspace/lifestyle', label: 'Lifestyle', section: 'Health', aliases: ['meatspace-lifestyle', 'lifestyle'] },
- { id: 'nav.meatspace.settings', path: '/meatspace/settings', label: 'Settings', section: 'Health', aliases: ['meatspace-settings'] },
+ { id: 'nav.meatspace.overview', path: '/meatspace/overview', label: 'Overview', section: 'Health', tabGroup: 'meatspace', tabId: 'overview', aliases: ['meatspace'] },
+ { id: 'nav.meatspace.age', path: '/meatspace/age', label: 'Age', section: 'Health', tabGroup: 'meatspace', tabId: 'age', aliases: ['meatspace-age'] },
+ { id: 'nav.meatspace.alcohol', path: '/meatspace/alcohol', label: 'Alcohol', section: 'Health', tabGroup: 'meatspace', tabId: 'alcohol', aliases: ['meatspace-alcohol', 'alcohol'] },
+ { id: 'nav.meatspace.blood', path: '/meatspace/blood', label: 'Blood', section: 'Health', tabGroup: 'meatspace', tabId: 'blood', aliases: ['meatspace-blood', 'blood'] },
+ { id: 'nav.meatspace.body', path: '/meatspace/body', label: 'Body', section: 'Health', tabGroup: 'meatspace', tabId: 'body', aliases: ['meatspace-body', 'body'] },
+ { id: 'nav.meatspace.export', path: '/meatspace/export', label: 'Export', section: 'Health', tabGroup: 'meatspace', tabId: 'export', aliases: ['meatspace-export', 'clinician-export', 'health-export'], keywords: ['clinician', 'doctor', 'print', 'pdf', 'summary', 'report', 'blood', 'lifestyle'] },
+ { id: 'nav.meatspace.genome', path: '/meatspace/genome', label: 'Genome', section: 'Health', tabGroup: 'meatspace', tabId: 'genome', aliases: ['meatspace-genome', 'genome'] },
+ { id: 'nav.meatspace.health', path: '/meatspace/health', label: 'Body Health', section: 'Health', tabGroup: 'meatspace', tabId: 'health', tabLabel: 'Health', aliases: ['meatspace-health', 'body-health'], keywords: ['health', 'vitals', 'wellbeing', 'biometrics'] },
+ { id: 'nav.meatspace.settings', path: '/meatspace/settings', label: 'Settings', section: 'Health', tabGroup: 'meatspace', tabId: 'settings', aliases: ['meatspace-settings'] },
+ { id: 'nav.meatspace.lifestyle', path: '/meatspace/lifestyle', label: 'Lifestyle', section: 'Health', tabGroup: 'meatspace', tabId: 'lifestyle', aliases: ['meatspace-lifestyle', 'lifestyle'] },
+ { id: 'nav.meatspace.nicotine', path: '/meatspace/nicotine', label: 'Nicotine', section: 'Health', tabGroup: 'meatspace', tabId: 'nicotine', aliases: ['meatspace-nicotine', 'nicotine'] },
{ id: 'nav.post.launcher', path: '/post/launcher', label: 'Launcher', section: 'POST', aliases: ['post', 'post-launcher'] },
{ id: 'nav.post.config', path: '/post/config', label: 'Config', section: 'POST', aliases: ['post-config'] },
@@ -311,10 +315,9 @@ const RAW_NAV_COMMANDS = [
{ id: 'nav.devtools.processes', path: '/devtools/processes', label: 'Processes', section: 'Dev Tools', aliases: ['devtools-processes', 'processes'] },
{ id: 'nav.security', path: '/security', label: 'Security', section: 'Dev Tools', aliases: ['security'] },
{ id: 'nav.system-resources', path: '/system-resources', label: 'System Resources', section: 'Dev Tools' },
- { id: 'nav.system-health', path: '/system-resources/overview', label: 'System Resources Overview', section: 'Dev Tools', previousPaths: ['/system-health'], aliases: ['system-resources', 'system-health', 'system-status', 'memory-usage', 'cpu-usage'], keywords: ['health', 'memory', 'cpu', 'disk', 'thresholds', 'top processes', 'resource usage', 'build', 'commit', 'running build', 'stale build', 'which code is running'] },
- { id: 'nav.system-resources.storage', path: '/system-resources/storage', label: 'Storage Report', section: 'Dev Tools', aliases: ['disk-usage', 'storage-report', 'disk-cleanup'], keywords: ['disk', 'storage', 'space', 'cleanup', 'cache', 'data usage', 'ai triage'] },
- { id: 'nav.system-resources.queues', path: '/system-resources/queues', label: 'Active Queues', section: 'Dev Tools', aliases: ['active-queues', 'job-queues', 'pending-jobs', 'render-queue'], keywords: ['media jobs', 'agent tasks', 'pending', 'running', 'cancel', 'run now'] },
- { id: 'nav.cos.jobs', path: '/cos/jobs', label: 'System Tasks', section: 'Chief of Staff', aliases: ['cos-jobs', 'system-tasks'] },
+ { id: 'nav.system-health', path: '/system-resources/overview', label: 'System Resources Overview', section: 'Dev Tools', tabGroup: 'system-resources', tabId: 'overview', tabLabel: 'Overview', previousPaths: ['/system-health'], aliases: ['system-resources', 'system-health', 'system-status', 'memory-usage', 'cpu-usage'], keywords: ['health', 'memory', 'cpu', 'disk', 'thresholds', 'top processes', 'resource usage', 'build', 'commit', 'running build', 'stale build', 'which code is running'] },
+ { id: 'nav.system-resources.storage', path: '/system-resources/storage', label: 'Storage Report', section: 'Dev Tools', tabGroup: 'system-resources', tabId: 'storage', tabLabel: 'Storage', aliases: ['disk-usage', 'storage-report', 'disk-cleanup'], keywords: ['disk', 'storage', 'space', 'cleanup', 'cache', 'data usage', 'ai triage'] },
+ { id: 'nav.system-resources.queues', path: '/system-resources/queues', label: 'Active Queues', section: 'Dev Tools', tabGroup: 'system-resources', tabId: 'queues', tabLabel: 'Queues', aliases: ['active-queues', 'job-queues', 'pending-jobs', 'render-queue'], keywords: ['media jobs', 'agent tasks', 'pending', 'running', 'cancel', 'run now'] },
{ id: 'nav.uploads', path: '/uploads', label: 'Uploads', section: 'Dev Tools', aliases: ['uploads'] },
{ id: 'nav.wiki.overview', path: '/wiki/overview', label: 'Wiki', section: 'Brain', tabGroup: 'wiki', tabId: 'overview', tabLabel: 'Overview', aliases: ['wiki'] },
@@ -358,7 +361,8 @@ export const getSectionNavTabs = (section) => NAV_COMMANDS
}));
// `tabGroup` marks the destinations that make up ONE page's own local tab bar
-// (Calendar, Goals, Insights, Privacy, Messages, Wiki, …) — a different axis
+// (Brain, Calendar, CoS, Digital Twin, Goals, Insights, Media Gen, MeatSpace,
+// Messages, Music, Privacy, Sharing, System Resources, Wiki) — a different axis
// from `tabId`'s section-level child nav above. A page can sit in any sidebar
// section (Insights and Privacy both live under "Identity") without its tab
// ids colliding with a sibling page's, because uniqueness below is scoped to
@@ -366,8 +370,8 @@ export const getSectionNavTabs = (section) => NAV_COMMANDS
// pages order their own tabs deliberately (e.g. Overview first, Settings
// last), unlike the alphabetical section headers `getSectionNavTabs` builds.
// The page pairs this with a local presentation map (icon, component, …)
-// keyed by `id`, and should throw at module load if a returned tab has no
-// matching presentation entry — see client/src/pages/Wiki.jsx for the pattern.
+// keyed by `id` via `buildPageNavTabs` (client/src/lib/pageNavTabs.js), which
+// throws at module load if a returned tab has no matching presentation entry.
export const getPageNavTabs = (group) => NAV_COMMANDS
.filter((command) => command.tabGroup === group)
.map(({ tabId, label, tabLabel, path, feature }) => ({
diff --git a/server/lib/navManifest.test.js b/server/lib/navManifest.test.js
index 47cf645f4f..a9c5cd6b3a 100644
--- a/server/lib/navManifest.test.js
+++ b/server/lib/navManifest.test.js
@@ -20,13 +20,7 @@ const SETTINGS_PAGE = path.join(REPO_ROOT, 'client/src/pages/Settings.jsx');
// Maps URL prefix → how to extract the page's own tab set from its source. Each
// page validates the :tab/:section param against this list, so the nav manifest
-// must agree. Three source shapes are supported:
-// kind 'ids' — `export const <constName> = [{ id: '<slug>', … }]`, where each
-// tab lives at `<prefix>/<slug>` (Brain/CoS/Calendar/Goals/…).
-// kind 'links' — `export const <constName> = [{ to|path: '<abs path>', … }]`,
-// where the page's own tabs are the entries whose path is exactly
-// `<prefix>` or under `<prefix>/`; entries pointing elsewhere
-// (e.g. Settings' "Prompts" → /prompts) are cross-links, not tabs.
+// must agree. Two source shapes are left:
// kind 'section' — the header exports a generated `TABS` list sourced from
// the nav manifest; `section` identifies the manifest group.
// kind 'switch' — the page has no tab array; its tabs are a `switch (<switchVar>)`
@@ -34,25 +28,16 @@ const SETTINGS_PAGE = path.join(REPO_ROOT, 'client/src/pages/Settings.jsx');
// default (POST). Reading the switch directly means the guard
// can't drift from a parallel constant; inner subtab branches
// (`if (subtab === 'x')`) aren't cases, so drill-downs are excluded.
+// Every OTHER tabbed page now derives its tab list from `getPageNavTabs(group)`
+// (#6365, #6383), so the manifest is the one registry and there is nothing left
+// to scrape — each page's own test file asserts its presentation map covers
+// every manifest tab in its `tabGroup` instead.
const TABBED_PAGES = [
- { prefix: '/brain', file: 'client/src/components/brain/constants.js', kind: 'ids', constName: 'TABS' },
- { prefix: '/cos', file: 'client/src/components/cos/constants.js', kind: 'ids', constName: 'TABS' },
- { prefix: '/digital-twin', file: 'client/src/components/digital-twin/constants.js', kind: 'ids', constName: 'TABS' },
- { prefix: '/meatspace', file: 'client/src/components/meatspace/constants.js', kind: 'ids', constName: 'TABS' },
- // Calendar, Goals, Insights, Privacy, Messages and Wiki derive their TABS from
- // `getPageNavTabs(group)` (#6365) — the manifest is the one registry for
- // those six now, so they no longer need a source-shape scraper here. Each
- // page's own test file asserts its presentation map covers every manifest
- // tab in its `tabGroup` instead.
{ prefix: '/settings', section: 'Settings', file: 'client/src/components/settings/SettingsTabsHeader.jsx', kind: 'section', constName: 'TABS' },
{ prefix: '/models', section: 'Models', file: 'client/src/components/models/ModelsTabsHeader.jsx', kind: 'section', constName: 'TABS',
nestedIdSources: [
{ parent: 'llms', file: 'client/src/components/settings/LocalLlmTab.jsx', constName: 'LLM_NAV_SUBROUTES' },
] },
- { prefix: '/media', file: 'client/src/pages/MediaGen.jsx', kind: 'ids', constName: 'TABS', allowBasePrefix: true },
- { prefix: '/music', file: 'client/src/pages/Music.jsx', kind: 'ids', constName: 'TABS', allowBasePrefix: true },
- { prefix: '/sharing', file: 'client/src/pages/Sharing.jsx', kind: 'links', constName: 'SECTIONS' },
- { prefix: '/system-resources', file: 'client/src/pages/SystemHealthPage.jsx', kind: 'ids', constName: 'RESOURCE_TABS', allowBasePrefix: true },
// POST's morse tab has routed `:mode` sub-pages (/post/morse/copy|send) and the
// memory tab has the Elements study sub-page (/post/memory/elements) plus its
// own routed practice modes — none are top-level switch cases, so declare their
@@ -72,14 +57,10 @@ const TABBED_PAGES = [
// Pull the inner text of `export const <constName> = [ … ];` (requiring `export`
// also asserts the constant stays importable — a forgotten `export` fails loudly).
-// The terminator is line-anchored, so a nested array literal — OPEN_WORLD_REGIONS'
-// per-region `aliases: [...]`, the first such source here — closes with `],` mid-line
-// and cannot end the block early. Only a `];` at column 0 terminates; a nested literal
-// formatted that way would still truncate the guard, but no source does that today.
+// The terminator is line-anchored (`^];`) so a NESTED array literal can't close the
+// block early and silently truncate the guard to the entries above it; a nested
+// literal formatted with its own `];` at column 0 still would, but no source does.
function extractConstArrayBlock(src, constName) {
- // Terminator is line-anchored (`^];`) so a NESTED array literal — e.g. the per-region
- // `aliases: [...]` in OPEN_WORLD_REGIONS, the first source here to carry one — can't end
- // the block early and silently truncate the guard to the entries above it.
const block = src.match(new RegExp(`export const ${constName}\\s*=\\s*\\[([\\s\\S]*?)^\\];`, 'm'));
if (!block) throw new Error(`No exported ${constName} array found`);
return block[1];
@@ -104,7 +85,7 @@ function extractSwitchTabs(src, switchVar) {
return [def[1], ...extractSwitchCases(src, switchVar)];
}
-// The `id:` values of an exported const array (`kind: 'ids'` shape), used to
+// The `id:` values of an exported `[{ id: '<slug>', … }]` const array, used to
// pull routed sub-page ids (e.g. morse's copy/send MODES) out of another file.
function extractConstIds(filePath, constName) {
const src = fs.readFileSync(filePath, 'utf8');
@@ -113,26 +94,14 @@ function extractConstIds(filePath, constName) {
}
// The set of absolute tab paths a page serves under its own prefix.
-function extractTabPaths(filePath, { kind, constName, switchVar, prefix, section, nestedIdSources, allowBasePrefix }) {
- const src = fs.readFileSync(filePath, 'utf8');
+function extractTabPaths(filePath, { kind, switchVar, prefix, section, nestedIdSources }) {
const nested = (nestedIdSources || []).flatMap(({ parent, file, constName: c }) =>
extractConstIds(path.join(REPO_ROOT, file), c).map((id) => `${prefix}/${parent}/${id}`));
if (kind === 'switch') {
+ const src = fs.readFileSync(filePath, 'utf8');
return [...extractSwitchTabs(src, switchVar).map((id) => `${prefix}/${id}`), ...nested];
}
- if (kind === 'section') return [...getSectionNavTabs(section).map((tab) => tab.to), ...nested];
- const block = extractConstArrayBlock(src, constName);
- if (kind === 'ids') {
- const ids = [...block.matchAll(/id:\s*['"]([^'"]+)['"]/g)].map((m) => `${prefix}/${m[1]}`);
- return [...(allowBasePrefix ? [prefix, ...ids] : ids), ...nested];
- }
- // kind 'links': keep only entries that point at this page, dropping cross-links.
- return [
- ...[...block.matchAll(/(?:to|path):\s*['"]([^'"]+)['"]/g)]
- .map((m) => m[1])
- .filter((p) => p === prefix || p.startsWith(`${prefix}/`)),
- ...nested,
- ];
+ return [...getSectionNavTabs(section).map((tab) => tab.to), ...nested];
}
describe('navManifest — shape invariants', () => {