33 Commits
Author SHA1 Message Date
CatoandClaude Opus 5.5 9dde8fbee9 feat(forms): prose fields on chatkit DictationField, with a working microphone (#330)
* wip: prose fields on chatkit DictationField (awaits chatkit 0.45)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuMRAXYWNkfowAXVfi

* feat(forms): prose fields on chatkit DictationField, with a working microphone

- Bump @bitbaum/chatkit to ^0.45.0.
- One app wrapper, components/forms/TextBox, around DictationField. Used by
  the bot builder (name, description, knowledge topic and content, system
  prompt), the custom-bot edit page (name, description, system prompt,
  greeting), the contact message, the demo intake questions, quick-create
  (name, relationship, memories) and the consultation form's
  react-hook-form message field ({...register('message')}).
- app/api/transcribe: dictation server leg on ai-kit's speechChain and
  transcribe(), rate limited, recordings and transcripts neither stored nor
  logged. Every field and every in-page chat points voice at it, so the
  microphone works where the browser has no recogniser of its own.
- Permissions-Policy allowed no microphone at all (microphone=()), which
  blocked every mic on the site; it now allows the site itself.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuMRAXYWNkfowAXVfi

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-19 14:23:42 +01:00
CatoandClaude 9d5c25a26f feat(chat): run every in-page chat on chatkit's thread and composer (#328)
Seven hand-built chats (/demo, the professional demos, quick-create, /try,
/my-data documents, custom bots and the guided demo) now share one
EmbeddedChat panel: chatkit's ChatThread and Composer with the microphone,
Copy/Listen, Stop, Retry on a failed turn, starters and suggested replies.
Each surface keeps its own prompt, route and persistence through a small
useChatTurns hook.

Also fixes /demo and the /my-data document chat reading the answer from the
wrong level of the jsonSuccess envelope, which showed empty answers.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-15 18:48:44 +01:00
Cato f0903ed178 feat: adopt shared visual AI answers (#235) 2026-10-21 12:59:28 +02:00
CatoandClaude Opus 5 376b94f89d refactor: one rate limiter, one auth shell, one create flow, one icon frame (#198)
* refactor(rate-limit): one limiter from limitkit, keyed on the proxy's hop

Two hand-rolled limiters lived side by side — lib/rate-limit.ts and
lib/middleware/rate-limit.ts — each with its own window maths, its own
header names and its own idea of who the caller is. Both are gone; the
decision now comes from limitkit (fleet/SHARED.md), and what stays here
is the one table of app budgets in lib/rate-limit.ts. A route names a
bucket; it does not get to invent a number.

The reason this matters beyond tidiness: both copies keyed the limit on
the FIRST hop of X-Forwarded-For. That hop is written by the client, so
any caller could mint a fresh budget per request by adding a header —
the limiter looked like it worked and enforced nothing. limitkit counts
from the right, i.e. the hop our own proxy wrote. A test now pins it:
a forged first hop must not mint a fresh bucket.

Also removed the Supabase check_rate_limit RPC path, which failed OPEN
on every error — the limiter switched itself off whenever the database
hiccupped. And 429s now carry Retry-After and X-RateLimit-* headers plus
a retryAfter field, which is what the auth forms count down.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012KAn51JHFcTrPeCjZDGXM8

* refactor(icons): each icon body written once

Icons.tsx repeated the same 24-box outline SVG wrapper for every icon —
a 121-line self-clone. One `Outline` frame and one `icon(paths, ...)`
builder replace it; an icon is now its path data and nothing else.

Every export and every path string is byte-identical to before, so the
rendered output does not move.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012KAn51JHFcTrPeCjZDGXM8

* refactor(create): one QuickCreateFlow behind /create and /personal

The two pages held the same three-step flow twice — 192 cloned lines of
state machine, header, progress indicator and step switch. They differ
only in the copy around the template picker, so that is what the pages
now pass in: /personal supplies its title block and its link out to the
professionals, /create supplies neither.

Both renders are unchanged, including that /personal's intro and outro
only appear on the picker step.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012KAn51JHFcTrPeCjZDGXM8

* refactor(auth): one shell, one field, one submit button for the auth screens

signup, signin, forgot-password and verify-email each carried their own
copy of the page frame, the error line, the labelled input and the
submit button — six clone pairs with signup in every one. They now share
AuthShell / AuthAlert / AuthField / AuthSubmitButton, and the per-form
error-plus-countdown state lives once in useAuthError.

One real fix falls out of it: isRateLimitError compared the error code
against 'RATE_LIMITED', but the API has always sent 'RATE_LIMIT'. The
rate-limit countdown therefore never showed. It does now.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012KAn51JHFcTrPeCjZDGXM8

* chore(lint): console.info is not logging, and every disable says why

`no-console` allowed `info`, so debug lines shipped as operator output:
the blog route narrated every render to the server log at info level.
Those lines now go through lib/logger (the single logger) at the level
they actually are, and the allowance is gone — warn and error only. The
21 remaining console.log calls are all in scripts/test-db-connection.ts,
where printing to the terminal is the point.

The eslint-disable count drops 16 -> 13. Comments.tsx no longer needs one
(useSyncExternalStore is the supported way to ask "are we on the client"),
and lib/supabase.ts no longer needs its `any` — the SSG mock casts once at
the return instead. The 13 that remain each name their reason: external
avatar URLs that next/image would need a host allowlist for, and effects
that seed state from an external store.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012KAn51JHFcTrPeCjZDGXM8

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-15 01:24:12 -07:00
8582b92f90 refactor(deps): Tailwind 4 (CSS-first) + Zod 4 + ESLint 10 + types/node 26 + ai-kit 0.6.2 (#168)
Tailwind 3.4 -> 4.3:
- tailwind.config.js DELETED; tokens now live in an @theme inline block in
  app/globals.css (semantic names unchanged: action, paper, edge, ink...)
- postcss.config.js -> @tailwindcss/postcss; autoprefixer dropped (built in)
- @tailwind directives -> @import 'tailwindcss'; forms/typography via @plugin
- daisyui removed (no daisyui class used anywhere)
- next/font vars renamed --font-inter/--font-fraunces to break the circular
  var() the old --font-sans binding would create inside @theme
- v4 deleted *-opacity-* utilities: every bg/text/ring-opacity-N rewritten to
  slash syntax (bg-action/90, ring-black/5, ...); dynamic accent tint gets a
  literal class map in lib/config/colors.ts so the scanner sees each class
- dead v3-era aspect-w/h custom utilities removed (unused; v4 has aspect-*)

Zod 3.24 -> 4.5:
- .errors -> .issues everywhere
- z.string().uuid( -> .guid( (v4 uuid() is RFC-variant-strict; DB ids aren't)
- z.record(z.unknown()) -> z.record(z.string(), z.unknown())
- object .default({}) -> .prefault({}) (v4 default takes the full output value)

ESLint 9 -> 10: eslint-plugin-react's version:'detect' calls the removed
context.getFilename; pin settings.react.version='19' AFTER the next configs.

Verify (format+lint+typecheck+selfhost+test+build) green: 272 tests pass.


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

Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-31 12:45:49 +00:00
346a3ff744 refactor(design): the bot demo was the sixth colour system (#150)
#144 branded the bot page sections. It did not reach the demo underneath
them, so every first-party bot still ran the per-colour palette in its
interactive step -- the buttons, focus rings, progress dots, message bubbles,
dropzone and context panel -- plus the bot switcher in the nav.

The colour came from lib/demo/botDemoConfigs.ts, which carried its own
accentColor per bot (blue, green, red, indigo, amber). That is the sixth
place a colour was chosen, after: globals.css, lib/config/colors.ts,
lib/hooks/navigationConfig.ts, ACCENT_HERO_CLASSES, and data/professionals.ts.

DemoSection and BotSwitcher are used ONLY by the first-party bot pages
(verified: no custom-bot page imports either), so both are now brand:
BRAND_BUTTON, BRAND_FOCUS_RING, BRAND_STARTER, BRAND_CHECKBOX, BRAND_PROGRESS,
BRAND_MESSAGE, BRAND_DROPZONE, BRAND_CONTEXT_PANEL, BRAND_SWITCHER.

accentColor is gone from the demo config, its type, and the whole prop chain.

What still emits raw palette, correctly:
  VISION_STATUS_CONFIG   roadmap status -- completed green, in-progress blue,
                         planned amber, vision purple. Four states that have to
                         stay tellable apart; collapsing them to ochre would
                         destroy the information.
  the /personal templates per-template identity in the memorial/legends
                         product, chosen from an allowlisted surface.

Both live behind lib/config/colors.ts, which the guard already documents as an
exception -- so the guard passing while those classes ship is correct, not a
blind spot. The blind spot was data/professionals.ts, fixed in #149.

verify: format, lint, typecheck, 256 tests, build -- all green. Bot demo
confirmed ochre end to end against a local production build.


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:21:48 +00:00
f04d13bf39 refactor(design): finish the colour sweep, and make it enforceable (#148)
#144 put the bot pages on the brand. This does the other 60 files, so the
whole product reads as one thing, and adds the guard that keeps it that way.

~410 raw palette classes became semantic tokens across the public marketing
surface (/try, /enterprise, /about, /knowledge, /personal, /professionals,
/bots, blog, navigation) and the app internals (dashboard, documents, chat,
conversations, onboarding, auth, settings, profile).

Gradient text is gone. Fifteen headings were
`bg-gradient-to-r from-X to-Y bg-clip-text text-transparent`; they are now
solid text-ink or text-action. globals.css says the identity is carried by
typography, and a serif display does not need a gradient to do that.

The 'B' mark was still a blue/purple gradient in BotNavigation's MOBILE menu.
#144 only fixed the desktop header. Both now render the shared <Logo>.

Three defects introduced mid-sweep and corrected, all caught by reading the
diff rather than trusting the regex:
  - degenerate gradients (`from-action-tint to-action-tint`) collapsed to solid
  - dead hovers (tint on tint) rebased to bg-surface + hover:bg-action-tint
  - `to-action\b` matched the prefix of `to-action-hover`, so a collapse left a
    stray `bg-action-hover` as a BASE background in 11 places -- those are the
    primary, not the hover shade

Deliberately NOT changed:
  - components/knowledge/Callout.tsx -- its blue is the `info` half of an
    info/warning/error triad. Semantic status colour is a separate scale from
    the brand accent, and warning is amber, so ochre-ing info would make the
    two nearly indistinguishable.
  - the custom-bot surfaces -- custom_bots.accent_color is a real column with
    a CHECK constraint and the owner picks it. User data, not a design token.

Never-twice: tests/__tests__/lib/design-tokens.test.ts refuses any raw
brand-palette class, and any bg-clip-text, outside those two documented
exceptions. Mutation-verified -- swap one token back to bg-blue-600 and it
fails and names the file. No allowlist debt: every other file was swept rather
than excused.

verify: format, lint, typecheck, 256 tests, build -- all green. Twelve pages
smoke-tested and checked visually against a local production build.


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 09:53:41 +00:00
bb9d9490d0 refactor(design): one colour system on the bot pages (#144)
app/globals.css defines the identity -- editorial ink, one ochre accent --
and says so in a comment: "No generic AI gradient blue/purple." The bot
pages ignored it and ran a parallel palette, so a single viewport of
/bots/legal-expert showed a blue logo, a blue nav button and an ochre CTA
at the same time.

There were four colour sources, not two:
  lib/config/colors.ts        16-colour accent sets
  lib/hooks/navigationConfig  its own 5-colour NAV_COLOR_CLASSES
  ACCENT_HERO_CLASSES         a fifth set (whose green and indigo entries
                              both set chatBg to 'bg-blue-50' -- it was not
                              even self-consistent)
  raw Tailwind greys          text-gray-900 / bg-white / border-gray-200

The six professional bots are Botsmann, so they now wear the brand:
BRAND_ACCENT and BRAND_HERO, plus a single NAV_COLORS scheme. 113 raw
grey/white classes became semantic tokens (text-ink, text-ink-muted,
bg-surface, bg-paper, border-edge). The page ground is bg-paper, matching
the homepage instead of flat white.

The 'B' mark in BotNavigation was literally
`bg-gradient-to-r from-blue-600 to-purple-600` -- the exact thing globals.css
forbids by name. It now renders the shared <Logo>, so it cannot drift again.

Per-bot accentColor is gone from the first-party config and its plumbing.
The per-colour sets STAY for user-created bots: custom_bots.accent_color is
a real column with a CHECK constraint and the owner picks it. That is user
data, not a design token.

Also deleted components/shared/BotPageTemplate.tsx -- nothing imported it.

Not in this change: /try, /enterprise, /bots and /knowledge still carry
blue/purple gradients (72 files match the raw palette). Same class, separate
pass, so this one stays reviewable.

verify: format, lint, typecheck, 240 tests, build -- all green. Verified
visually against a local production build.


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 08:16:47 +00:00
Mao NakamotoandClaude Opus 4.8 542d558f1f refactor(hooks): adopt eslint-plugin-react-hooks v6 rules (Next 16)
Re-enables the three React-Compiler-era rules deferred in #114
(set-state-in-effect, error-boundaries, immutability) — all now ON — and
resolves every violation with a real fix or a justified, documented exception.

error-boundaries (12 → 0, real fix):
- app/blog/[slug]/page.tsx wrapped its whole render in try/catch that only
  re-threw. Removed it: notFound()/render errors now propagate to Next's
  not-found.tsx / error.tsx as intended (the catch also mislogged notFound()).

immutability (5 → 0, real fix):
- The auth pages assigned window.location.href during render. Moved each
  redirect into a useEffect (above the early returns for rules-of-hooks),
  preserving the full-page navigation while keeping render pure.
  signin, signup, forgot-password, verify-email (×2).

set-state-in-effect (13 → 0, justified inline disables):
- Every case is a legitimate effect use — external-system sync (Supabase auth,
  API loads), browser-only hydration (localStorage, client-mount), or seeding
  editable state from async-loaded data. Forcing them off-effect would add
  complexity or risk behaviour changes to auth/data code, so each carries an
  eslint-disable-next-line with a specific reason. The rule stays ON to catch
  genuinely-avoidable derived-state-in-effect in future code.

Verified: eslint . (0 problems), prettier, tsc --noEmit, next build, jest 227 pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-26 12:24:46 +02:00
GandClaude Opus 4.8 3e6ba50d6c design(landing): identity-first reskin — token SSOT, serif voice, monogram avatars (#107)
Botsmann had no identity of its own: a generic 2021-era AI-SaaS skin with the
brand fragmented across three disagreeing sources (config OpenAI-green,
globals.css black/white, page blue/purple/cyan gradients). Derive Botsmann's
OWN voice — serious, credible counsel: warm editorial ink + a single
authoritative ochre accent, carried by a serif display face, not gradient tricks.

- globals.css is now the single SSOT for design tokens (semantic colors for
  brand/action/surface/text + radii + shadows, two-tier primitive→semantic).
- tailwind.config wired to the CSS vars; literal colors removed. Ripped out the
  OpenAI-borrowed tokens (openai-green #10a37f / openai-gray) and migrated every
  consumer to the semantic `action` / `brand` tokens.
- Killed the generic "AI gradient" skin: removed the blue→purple→cyan gradient
  wordmark, the blurred gradient hero blobs, gradient buttons, and glassmorphism.
  Replaced with one confident ochre accent + ink, hairline editorial surfaces.
- Real typeface via next/font: Fraunces (serif display, headings + wordmark) +
  Inter (UI/body), bound to --font-serif / --font-sans. Retires system-ui.
- Replaced emoji professional avatars (⚖️🩺🔬🇨🇭🎨♛) with a ProfessionalAvatar
  monogram badge built on the existing accentColor SSOT.
- One headline value prop: tab title, hero H1 and footer now all agree on
  "Your Private AI Professionals" (was a split tagline vs H1).

Design only — all content and functionality preserved. Lint clean; no new tsc
errors (the pre-existing embeddings.test.ts error is unchanged from main);
production CSS resolves the full token chain.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 19:44:28 +02:00
g-butandClaude Sonnet 4.6 aa515d3d89 chore: fix prettier formatting across 28 files
CI format:check was failing. Auto-formatted all files to match
Prettier config.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-03 09:45:47 +01:00
g-butandClaude Opus 4.6 7186bdd049 refactor(config): move welcome messages from switch to data config
Added welcomeMessage field to Professional interface and each professional
entry in data/professionals.ts. Removed 6-case switch in ProfessionalDemo.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 17:23:12 +01:00
g-butandClaude Opus 4.6 57083ad34f refactor(colors): centralize 8 duplicated color mappings into SSOT
Added 9 new mapping exports to lib/config/colors.ts (button, focus-ring,
checkbox, starter, message, dropzone, progress, context-panel, hero,
template-hover). Removed local accentColorClasses definitions from all
8 consumer components.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 17:23:12 +01:00
g-butandClaude Opus 4.6 d21cc37bad fix: replace remaining dynamic Tailwind class interpolations
- APIKeyInput: add focusRing field to ProviderColorClasses, replace
  focus:${colors.ring} with static ${colors.focusRing} lookup
- ProfessionalCard: add groupHoverText field to accent color classes,
  replace group-hover:${colors.text} with static ${colors.groupHoverText}
- Zero dynamic Tailwind interpolations remain in the codebase

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 05:39:06 +01:00
g-butandClaude Opus 4.6 be1f76ea9e refactor: fix DRY/SSOT violations and Tailwind build bug
- Fix dynamic Tailwind classes in ProfessionalDemo.tsx that were purged
  at build time by replacing string interpolation with static lookups
- Deduplicate LLM config by importing GROQ/OpenRouter constants from
  API_CONFIG instead of defining them locally in llm-client.ts
- Remove duplicate input type interfaces from types/ that duplicated
  Zod-inferred types in lib/validations/, re-export from SSOT
- Extract shared navigation config (AUTH_NAV_ITEMS) and icon components
  used by both AuthNav and MobileNav into lib/config/navigation.ts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 23:15:08 +01:00
g-butandClaude Opus 4.5 59f1f0512e fix(deps): patch fast-xml-parser vulnerability and improve Link usage
Security fixes:
- Add npm override for fast-xml-parser@^5.3.4 to fix RangeError DoS
- Update @aws-sdk/client-ses to 3.980.0
- Reduces vulnerabilities from 25 to 8 (fixed 17 high severity)

Code improvements (prep for future Next.js 15):
- Replace <a> tags with <Link> components for internal navigation
- Create ConsultationFormLoader client wrapper for dynamic imports
- Use direct Analytics import instead of dynamic with ssr:false
- Add eslint-disable for global-error.tsx (intentional <a> usage)

Remaining vulnerabilities (require breaking changes):
- 7 moderate: eslint circular reference stack overflow
- 1 high: Next.js DoS (specific conditions, low practical risk)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 12:53:40 +01:00
g-butandClaude Opus 4.5 50a04ec062 feat(chat): add model indicator, selector, privacy tiers & auth CTA
Add model visibility and switching UI for AI professionals:
- ModelIndicator: shows current model with icon in chat header
- ModelSelector: dropdown to switch models (auth-gated for guests)
- PrivacyTierInfo: expandable Cloud vs Self-Hosted comparison
- ChatAuthCTA: dismissible guest conversion banner

Config files (SSOT):
- privacy-tiers.ts: tier definitions, model display config
- auth-cta.ts: CTA content for guest/authenticated users

Also increases quick-chat maxTokens from 256 to 1024 to prevent
response cutoff.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 10:40:12 +01:00
g-butandClaude Opus 4.5 4600019eb3 refactor(bots): config-driven bot pages architecture
Replace individual static bot pages with a single dynamic [slug]/page.tsx
that renders from centralized configuration. This makes adding new bots
a matter of editing config files only - no new page files needed.

Architecture changes:
- Add lib/config/bot-pages.ts as SSOT for all bot page content
- Add components/shared/sections/ with generic section components
- Add app/bots/[slug]/page.tsx as single dynamic page
- Remove 100+ files from individual bot directories

New section components:
- DisclaimerSection, FeaturesSection, HowItWorksSection
- BenefitsSection, TestimonialsSection, VisionSection
- TechnologySection, CTASection, DemoSectionWrapper

To add a new bot now:
1. Add entry to lib/config/bot-pages.ts (sections + content)
2. Add hero config to data/botHeroConfigs.ts
3. Add demo config to lib/demo/botDemoConfigs.ts
4. Add basic info to data/bots.ts
Done - no new page.tsx files needed!

Files deleted: ~100+ (bot-specific pages/components)
Files added: 11 (config + generic sections)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 18:57:33 +01:00
g-butandClaude Opus 4.5 425b3880be refactor: consolidate formatFileSize duplicates to shared formatBytes
- Update app/documents/page.tsx to use formatBytes from lib/format
- Update app/my-data/page.tsx to use formatBytes from lib/format
- Update components/shared/demo/DemoFileUpload.tsx to use formatBytes
- Update workspaceUtils.ts to re-export formatBytes as formatFileSize

DRY: 4 duplicate formatFileSize implementations → 1 SSOT (lib/format.ts)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 11:37:25 +01:00
g-butandClaude Opus 4.5 6c25dc8dfe refactor: comprehensive code quality improvements (DRY, SSOT, SoC)
## Broken Links Fixed
- Fix /projects/governance/build link to /contact in HeroSection.tsx

## Console Statements Removed (production code)
- Remove console.log/error from client components
- Replace with silent error handling or UI feedback
- Files: documents/page.tsx, try/page.tsx, settings/page.tsx,
  ConversationList.tsx, ProfessionalDemo.tsx, and more

## Inline Styles Converted to Tailwind
- Replace animation-delay inline styles with Tailwind arbitrary values
- Files: DemoMessage.tsx, DemoChat.tsx, ProfessionalDemo.tsx,
  QuickChat.tsx, demo/page.tsx, HeroSection.tsx

## Governance Types Consolidated (SSOT)
- Create app/projects/governance/types.ts as single source of truth
- Create app/projects/governance/utils.ts for formatting functions
- Remove duplicate EnhancedTransaction from TransactionWithTraceability.tsx
- Update component type files to re-export from SSOT

## Colors Config Extended
- Extend COLOR_CLASSES to support all 16 accent colors
- Fix type mismatch in custom bot pages

## Magic Numbers Extracted
- Add formatBytes utility to lib/format.ts (DRY)
- Add DEMO_MAX_FILE_SIZE to VALIDATION constants
- Update try/page.tsx to use centralized constants

## Minor Fixes
- Fix unused variable warning in CollaborationForm.tsx

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 00:24:27 +01:00
g-butandClaude Opus 4.5 b15cdcd432 refactor: consolidate accent colors into SSOT config
- Create lib/config/colors.ts as single source of truth for all colors
- AccentColor (16 colors) for bot templates
- CustomBotAccentColor (5 colors) for custom bots (matches DB constraint)
- Remove hardcoded color maps from QuickChat.tsx
- Derive types from Zod schemas instead of separate definitions
- Add justification comment for any type in supabase mock
- Remove console.error from production code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 23:23:04 +01:00
g-butandClaude Opus 4.5 6da1c37668 refactor: extract document status to constants and shared component (SSOT)
- Added DOCUMENT_STATUS constant to lib/constants.ts
- Added DocumentStatusType derived from constant
- Added DOCUMENT_STATUS_CONFIG for display (labels, colors)
- Created DocumentStatusBadge shared component
- Updated types/document.ts to use DocumentStatusType
- Updated app/documents/page.tsx to use shared component and constants

Changes to add a new status now require only 1 file (lib/constants.ts).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 18:45:37 +01:00
g-butandClaude Opus 4.5 5906f625cd refactor: extract shared components for CLAUDE.md compliance
DRY improvements:
- Add LoadingSpinner component (PageLoading, InlineLoading variants)
- Add centralized color config (ACCENT_BORDER_CLASSES, helpers)
- Add shared icons (CheckIcon, ClockIcon, EditIcon, etc.)

Updated files to use shared components:
- All auth pages now use PageLoading instead of inline spinners
- Profile page uses InlineLoading and centralized accent colors
- Settings page uses shared icons (CheckIcon, ChevronRightIcon)

This reduces code duplication across 17+ files for spinners
and 15+ files for accent color mappings.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 17:03:46 +01:00
g-butandClaude Opus 4.5 1c7abeebac docs(claude): add global standards reference and update date
- Add @~/.claude/CLAUDE.md import for global engineering standards
- Update Last Updated date to 2026-01-23

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 15:22:36 +01:00
g-butandClaude Opus 4.5 1f66587422 refactor: create shared BotHeroSection component (DRY principle)
- Create reusable BotHeroSection, BotFeatureCard, BotStepsSection components
- Add centralized botHeroConfigs.ts for hero section data (SSOT)
- Update all 5 bot pages to use shared BotHeroSection
- Delete duplicated HeroSection files from individual bot directories

This eliminates ~650 lines of duplicated code across bot pages while
maintaining flexibility through configuration-driven rendering.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 00:28:58 +01:00
g-butandClaude Opus 4.5 a93e462e4f feat: improve UX with skip option, PDF support, and better CTAs
- Add "Skip and chat directly" button in DemoIntake to reduce friction
- Create /api/demo/parse-pdf endpoint for unauthenticated PDF parsing
- Add PDF upload support to /try page
- Change homepage CTA from "Meet Your Professionals" to "Try Now - Free"
- Add typing indicator with animated bouncing dots in DemoChat
- Fix pdf-parse v2 import (use named export and class API)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 23:41:39 +01:00
g-butandClaude Opus 4.5 84298dce51 feat: add missing platform pages and demo components
- Add /api/quick-chat endpoint for professional chat demos
- Add /create page for building custom bots
- Add /enterprise page for B2B landing
- Add /my-data page for user document management
- Add /personal page for memorial/companion bots
- Add demo components (DemoSection, DemoChat, DemoIntake, etc.)
- Add shared components (HowItWorks, PrivacySection, EnterpriseSection)
- Add bot templates and demo configurations

These files enable the professional demo chats and the
full platform experience with custom bot creation.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 14:35:25 +01:00
g-butandClaude Opus 4.5 80bee0742a feat(professionals): add minimal professional pages with chat demos and scroll fixes
- Add /professionals/[slug] pages as minimal entry points with interactive chat demos
- Add "Learn More" links to connect to detailed /bots/* pages for deeper exploration
- Fix scroll behavior: use preventScroll on focus() calls and scrollTo on container
- Add professionals data with botSlug field for SSOT linking between pages
- Update Footer with correct bot names and links following SSOT principles

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 12:22:03 +01:00
g-butandClaude Opus 4.5 7c5640ed34 feat(auth): add rate limiting, email verification, password reset, and user profile
- Add rate limiting middleware with configurable limits per route type
- Create rate-limited API routes for signin, signup, forgot-password, resend-verification
- Implement password reset flow with forgot-password and reset-password pages
- Add email verification with callback handler and verify-email page
- Create EmailVerificationBanner component for unverified users
- Add user profile editing (display name, avatar URL) to settings page
- Update auth context with profile functions and rate limit error helpers
- Enhance UserAvatar component to support avatar URLs
- Update AuthNav to show display name and avatar
- Add Zod schemas for all auth forms (SSOT for validation)
- Fix duplicate 'dynamic' variable conflict in app/page.tsx

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 22:10:26 +01:00
g-butandClaude Sonnet 4.5 9aa417e273 refactor: clean up API routes and components, add shared utilities
Refactored multiple API routes and components to improve code organization and reduce duplication:
- Simplified API route implementations across chat, documents, consultations, and other endpoints
- Reorganized navigation components for better maintainability
- Added shared utility functions and hooks
- Created reusable Avatar and Logo components
- Added validation schemas and API utilities
- Improved type definitions and constants management

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-16 11:04:19 +01:00
g-butandClaude Opus 4.5 ddec243147 feat: add Swiss German RAG demo with keyword-based search
- Add RAG search module with TF-IDF-like scoring (lib/rag/)
- Create Swiss German knowledge base with 10+ chunks
- Build demo chat UI with suggested questions and source citations
- Add /api/demo/chat endpoint with Zod validation
- Update homepage with "Try the Demo" CTA and honest messaging
- Add /api/contact endpoint for consultation form
- Fix ConsultationForm to use real API endpoint
- Update bot cards to show accurate live/coming-soon status
- Remove legacy api/consultations.js (caused Vercel conflicts)
- Add nodemailer dependency for email functionality

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 08:38:43 +01:00
g-butandClaude Opus 4.5 c10748ceff refactor: add BotPageTemplate and fix MDX sanitization
- Add sanitizeMdxContent() in lib/knowledge.ts to escape < followed by
  numbers (fixes MDX compilation error in production-deployment guide)
- Create BotPageTemplate component for bot page deduplication
- Refactor medical-expert, research-assistant, artistic-advisor pages
  to use new template pattern
- Template handles: bot lookup, fallback, navigation, layout

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 19:49:20 +01:00
g-butandClaude Opus 4.5 a192ca24a0 refactor: centralize bot page configuration and add shared components
- Add BotSection and BotNotFoundFallback shared components
- Centralize menuItems and navigation config in data/bots.ts
- Add getBotBySlug and getBotTryLink helper functions
- Add BotMenuItem, BotAccentColor, and BotNavConfig types
- Refactor all 6 bot pages to use centralized configuration
- Remove ~180 lines of duplicated code across bot pages
- Improve consistency in error handling and section spacing

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 21:24:47 +01:00