* 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>
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>
* 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>
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>
#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>
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>
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>
## 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>
- 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>
- 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>
- 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>