Files
393a7e2b02 fix(design): the homepage had a fifth colour system, and the guard missed it (#149)
#148 shipped with the guard passing and the homepage still emitting
bg-blue-100, text-indigo-600, bg-purple-100. Both were true, because the
guard only walked app/ and components/.

The palette was in data/professionals.ts -- its own getAccentColorClasses,
giving each of the six first-party professionals a colour (blue, green,
indigo, red, amber, purple). Same mistake as the bots in #144, in the one
directory the scanner did not read. That is the whole lesson: a source
scanner is blind in exactly the shapes you forget to look at, so its first
clean run proves nothing.

  - the six professionals now use the brand, like the six bots
  - the guard walks data/ and lib/ too
  - data/menuItems.ts lost a blue/purple gradient

Two files are now DOCUMENTED exceptions rather than debt, because their
colour is categorical and has to stay mutually distinguishable:

  lib/constants.ts                    document status -- pending yellow,
                                      processing blue, ready green, error red.
                                      Recolouring "processing" to ochre would
                                      make state read as brand chrome.
  lib/infrastructure/providers.ts     per-provider identity, so Ollama and
                                      OpenAI are tellable apart at a glance.

Both sit alongside Callout.tsx's info/warning/error triad, each with its
reason written next to it.

verify: format, lint, typecheck, 256 tests, build -- all green. Homepage
confirmed to emit no raw palette class at all.


Claude-Session: https://claude.ai/code/session_01HVwg8DKHQktxJuHeLM3xpG

Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-28 10:04:44 +00:00

95 lines
2.5 KiB
TypeScript

import type { MenuItem, MenuChildItem } from '@/types/navigation';
import type { Route } from 'next';
import bots from '@/data/bots';
/**
* Map bot slug to professional category path
* This mapping allows bots to link to their corresponding professional page
*/
const BOT_TO_PROFESSIONAL_PATH: Record<string, string> = {
'legal-expert': 'legal',
'medical-expert': 'health',
'research-assistant': 'research',
'swiss-german-teacher': 'language',
'artistic-advisor': 'creative',
'product-manager': 'business',
};
/**
* Generate professional menu children from bots.ts
* SSOT: Bot data drives navigation
*/
const generateProfessionalChildren = (): MenuChildItem[] => {
const allProfessionals: MenuChildItem = {
label: 'All Professionals',
path: '/professionals' as Route,
description: 'Browse all AI professionals.',
icon: '👥',
};
const botItems: MenuChildItem[] = bots
.filter((b) => b.nav)
.map((bot) => {
const professionalPath = BOT_TO_PROFESSIONAL_PATH[bot.slug] || bot.slug;
// Extract short category from navDescription (e.g., "AI Legal Assistant" -> "Legal")
const category =
bot.nav!.navDescription?.replace(/^AI\s+/, '').replace(/\s+Assistant$/, '') || 'Assistant';
return {
label: `${bot.nav!.navTitle} (${category})`,
path: `/professionals/${professionalPath}` as Route,
description: bot.description,
icon: bot.nav!.emoji,
};
});
return [allProfessionals, ...botItems];
};
/**
* Main site navigation menu items
* SSOT for navigation structure across desktop and mobile
*
* Botsmann: Your Private AI Professionals
* - AI Professionals (specialized advisors)
* - Enterprise (for businesses)
* - About
*/
export const menuItems: MenuItem[] = [
{
label: 'Professionals',
path: '/professionals' as Route,
children: generateProfessionalChildren(),
megaMenu: {
columns: 2,
header: {
title: 'AI Professionals',
subtitle: 'Expert advisors for every need',
gradient: 'bg-action-tint',
},
},
},
{
label: 'Enterprise',
path: '/enterprise' as Route,
},
{
label: 'About',
path: '/about' as Route,
},
{
label: 'Get Started',
path: '/professionals' as Route,
isButton: true,
},
];
/**
* Get menu items without button items (for desktop nav)
*/
export const getNavItems = () => menuItems.filter((item) => !item.isButton);
/**
* Get button items only (for CTA section)
*/
export const getButtonItems = () => menuItems.filter((item) => item.isButton);