* 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>
* feat(auth): every way in on AccountKit's own screens
Botsmann signed people in against OrangeCat's GoTrue (auth.users). It now
runs on AccountKit (@bitbaum/accountkit 0.23) with AccountKit's own forms:
/auth/signin offers email and password, an emailed sign-in link, a
passkey, recovery through the mailed link and the second factor;
/auth/signup is sign-up; /account carries the account panel ("Sign-in and
security" in the account menu). "Continue with OrangeCat" and the shared
sign-in show when their clients are set, the link and recovery when mail
is. The GoTrue routes (/api/auth/signin, signup, forgot-password,
resend-verification, profile) and pages (callback, forgot-password,
reset-password, verify-email) and the cookie-session client are gone.
AccountKit's tables live in a host accounts database (drizzle/, loki
accounts-db.conf); the data stays in the botsmann supabase schema, which
every route already read with the service-role client. verifyUser now reads
AccountKit's session; /api/user/profile moves onto it too. New accounts get
uuid ids, and migration 013 drops the person columns' keys to auth.users,
which a new person's id is not in. Nothing is deleted. The profile editor
writes AccountKit's name and image.
Existing people keep their rows: scripts/db/accountkit-people.sql lists
everyone who owns rows with their OrangeCat actor id, and
scripts/db/accountkit-import.sql gives each an account under the same id,
linked to OrangeCat by that actor id, never by address (loki
accountkit-supabase.yml rehearses it rolled back, then imports).
Pages were served with public, max-age=3600 to every browser, account pages
included: after sign-out the browser showed its cached /account. /account
and /auth/* are now private, no-store. The account menu's trigger has a name.
tests/__tests__/accounts runs the ways in and the import on the committed
migration; browser-smoke.yml's account job rehearses the import and runs
the browser journey against the production build with AccountKit's real
mail caught by a sink.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuJhiHPASaR5k8raL9
* fix(auth): send a signed-out visitor to sign in with the router
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuJhiHPASaR5k8raL9
* ci(auth): the shared sign-in's button is matched by how it starts
AccountKit 0.24 names only the providers Morulia publishes, so the label
changes with Morulia.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuJhiHPASaR5k8raL9
* ci(auth): expect the shared sign-in only once Morulia publishes a provider
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuJhiHPASaR5k8raL9
* ci: run the checks on the journey change
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuJhiHPASaR5k8raL9
---------
Co-authored-by: Claude <noreply@anthropic.com>
* fix(nav): every header control is a 44px target
The fleet render sweep (nav contract rule 3) counted 18 sub-44px controls in
the desktop header: text-sm links 20px tall, Get Started 36px, Register 38px,
the Professionals menu button 20px. Fixed in the shared pieces (NavItem,
AuthNav, the hamburger, the mobile drawer) with min-h-11 on the control;
the header stays h-16 and the text size is unchanged.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Cato <41178744+catomean@users.noreply.github.com>
* fix(nav): short header links are 44px wide too
About and Login cleared 44px tall but were 41 and 39px wide.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Cato <41178744+catomean@users.noreply.github.com>
---------
Signed-off-by: Cato <41178744+catomean@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(ai): pick chain vendors by id, and make main green again
main has been red since #203 bumped @bitbaum/ai-kit to 1.10, which put
Gemini second in freeChain('BOTSMANN'). vendorChain() indexed [1] for
OpenRouter, so a BYOK OpenRouter user's key would have been sent down the
Gemini link. Look vendors up by id instead (code and both tests).
Also clears the rest of the red verify from the same bump: prettier 3.x
reformat of six files and the new next lint rule on relative
window.location.href assignments (sign-out keeps its full reload).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Cato <41178744+catomean@users.noreply.github.com>
* fix(ai): context extraction runs only on the user's own key
Every professional-chat turn fired a second, unasked model call
(extractAndSaveContext, fire-and-forget after the answer) on the shared
free-tier Groq key. Standing rule (2026-09-25): free-tier keys are spent
only when a person deliberately asks. Extraction now requires the user's
own key and uses their provider; without one it returns before any call.
Adds tests/__tests__/no-free-background-ai.test.ts: walks the import graph
from the timer route (/api/rebuild, appcron-botsmann-rebuild), /api/warmup
and /api/health and fails if any reaches a model client. Proven by
mutation: importing lib/nlp into /api/rebuild fails it, and dropping the
own-key guard fails the three new extractor cases.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Cato <41178744+catomean@users.noreply.github.com>
---------
Signed-off-by: Cato <41178744+catomean@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 (1M context) <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>
The blog and the Knowledge Center each fetched their markdown from a
SEPARATE GitHub repository at request time (g-but/botsmann-blog-content,
g-but/botsmann-knowledge-content) and rendered it through next-mdx-remote
with a hand-rolled component map per surface. Two maps for one markdown
vocabulary, already drifted: the blog slugged headings with rehype-slug, the
guides with a different inline regex; the guides highlighted code, the blog
did not; each had its own Callout. The content itself lived where nobody
reviewed it, behind a GitHub handle rename that now answers only via a 301.
Both surfaces now read content/*.md from this repo and render through
bip-kit's typed-block parser and reference renderer:
- content/blog/*.md (5 posts) and content/knowledge/**/*.md (10 guides) are
vendered verbatim from the two content repos — word-level parity verified
across all 15 files, zero words lost. Post images moved to public/blog/.
- The three app/blog/<slug>/page.mdx files came along as drafts. They were
never routes: `page.mdx` only serves as a page when pageExtensions includes
mdx, and this app never configured that, so all three were dead files. They
are committed with `published: false` rather than deleted.
- lib/longform/ is the one pipeline both routes call: a fence-aware
normalizer (`# ` → `## `, `*`/`+` bullets → `-`, nested items flattened —
the guides carry 74 indented items and ~130 shell-comment `#` lines inside
fences that a naive normalizer would have corrupted), then parse → blocks +
TOC + reading time.
- setHighlighterLoader(() => import('shiki')) is registered at module scope.
This app builds `output: standalone`, where bip-kit's zero-config shiki
import is invisible to Next's file tracer — without the explicit literal,
production ships unhighlighted while dev looks right.
- The TOC is derived from the same parse that renders the page, so a TOC
anchor can no longer point at a heading id built by a different slug rule.
types/knowledge.ts loses TableOfContentsItem accordingly.
Retired: next-mdx-remote, remark-gfm, rehype-slug, rehype-autolink-headings,
gray-matter (deps), components/blog/{Server,Client}MDXContent + MDXComponents,
components/knowledge/{Callout,CodeBlock,TableOfContents}. next.config drops
the raw.githubusercontent image pattern and the GitHub hosts from CSP
connect-src, and points frame-src at the privacy video players bip-kit uses.
Article typography now flows from the token SSOT: lib/longform/longform.css
maps globals.css onto bip-kit's --bp-* contract, replacing ~40 hardcoded
Tailwind greys. The mapping covers every --bp-* colour and pins the article
light, because Botsmann has no dark theme anywhere (zero `dark:` utilities,
no theme provider, light-only chrome) — letting bip-kit's dark defaults
through would put a dark article inside a white page. When the site grows a
dark tier, this file follows it by changing values in globals.css only.
tests/__tests__/lib/longform-content.test.ts walks every content file through
the real pipeline: committed content is bip-kit's trust boundary and a
malformed chart/stats fence throws at parse time, which without a test would
surface as a 500 on the live page.
Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn
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>
`isActive` already decided the link's colour and set no aria-current, so the
current page existed only for people who can see it. Zero occurrences of
aria-current anywhere in this codebase.
The megamenu trigger is untouched: it is a disclosure button, not a link to a
page, and Popover.Button already announces aria-expanded/aria-haspopup itself.
No visual change.
Found by the fleet nav-contract audit, which flags a repo whose navigation
computes an active state and never announces it anywhere.
Claude-Session: https://claude.ai/code/session_01XeELB8b3N4JrT2asYL9WvE
Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
#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>
#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>
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>
app/projects was 79 files and half of all app code -- an e-government
platform with a whitepaper, open-law, open-vote, open-pay, a transparency
portal and agency/employee directories. app/solutions was another 7 routes.
Nothing linked to either. lib/routes.ts declared PROJECTS: '/projects' and
no file imported it; there were zero inbound hrefs from any nav, footer or
page. But both were statically generated on every build and served publicly,
so they cost a build slot and an audit read each time while no visitor could
reach them.
Also removed, dead once those trees went (verified: no remaining importers):
components/governance/, components/SolutionLayout.tsx,
components/navigation/NextSection.tsx, lib/governance/,
types/governance.ts, data/solutions.json
app/ drops from 26,821 to 13,101 lines. 68 routes remain, all reachable.
Deliberately NOT removed: /personal and its bot templates. That surface is
linked from the homepage and the footer and it works, so removing it is a
product decision rather than cleanup.
Recovering any of this is one command:
git checkout f70fc612 -- app/projects app/solutions components/governance
verify: format, lint, typecheck, 240 tests, build -- all green.
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>
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>
Dashboard (454→54 lines): Extract WelcomeHeader, StatsGrid,
QuickActions, RecentActivity into components/dashboard/.
DocumentChatPanel (302→103 lines): Extract chat state into
hooks/useDocumentChat.ts and message rendering into ChatMessageList.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Standardize signup route to use jsonSuccess/jsonError helpers, extract
connection status config, clean up StatusBadge/ProviderCard inline maps,
add input validation to knowledge route, fix domain validation.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Created lib/hooks/useLocalStorage.ts with SSR-safe boolean persistence.
Updated ChatAuthCTA and OnboardingChecklist to use it instead of raw
localStorage calls.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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>
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>
- 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>
- 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>
Port features from legacy codebase:
- Add DocumentCategory type with 7 categories (legal, health, research, etc.)
- Add PROFESSIONAL_DOCUMENT_ACCESS mapping for category-based access
- Add CategoryBadge and CategorySelector components
- Add professional-chat API with document context integration
- Add ErrorBoundary component for error handling
- Add professionals layout with metadata
- Add useRateLimitCountdown hook
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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>
Reduces files needed to add a new bot from 7-8 to 3-4 by eliminating
hardcoded bot lists in multiple locations:
- Add `display` field to Bot interface for bots list page metadata
- Footer.tsx: Generate AI Assistants links from bots array
- app/bots/page.tsx: Remove 100-line botDetails Record, derive from bot.display
- menuItems.ts: Generate Professionals menu children from bots array
Adding a new bot now automatically updates the footer, navigation menu,
and bots list page without any additional code changes.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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>
- 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>
## 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>
- 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>
- Extended colors.ts with ACCENT_COLOR_OPTIONS and COLOR_CLASSES
- Updated colors from purple/orange/yellow to indigo/amber to match usage
- Added composite color classes for themed UI components
- Removed duplicated color definitions from:
- app/bots/custom/[slug]/page.tsx
- app/bots/custom/[slug]/edit/page.tsx
- components/bot-builder/StepPersonality.tsx
- components/bot-builder/StepReview.tsx
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace inline loading spinners with PageLoading, InlineLoading, and
LoadingSpinner components across 10 more files:
- app/dashboard/page.tsx
- app/documents/page.tsx
- app/bots/mine/page.tsx
- app/bots/custom/[slug]/page.tsx
- app/bots/custom/[slug]/edit/page.tsx
- app/infrastructure/page.tsx
- app/my-data/page.tsx
- app/auth/callback/page.tsx
- components/conversations/ConversationList.tsx
- components/documents/AddToBotModal.tsx
This completes the DRY refactoring for loading spinners. The
LoadingSpinner component is now the SSOT for all loading states.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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>
- 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>
Replace empty stats grid with value-focused onboarding experience:
- Show capabilities (analyze docs, get advice, build bots)
- Include social proof testimonials
- Clear CTAs to upload first document or browse professionals
- Only shows when user has 0 documents, conversations, and bots
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- 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>
- 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>
- 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>