10 Commits
Author SHA1 Message Date
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
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
Mao NakamotoandClaude Opus 4.8 122f4b6779 chore(deps): upgrade Next.js 15 → 16 + React 18 → 19
Framework major upgrade, stacked on #111 (Next 14 → 15).

Dependencies:
- next 15.5.21 → 16.2.12
- react / react-dom 18 → 19.2.8, @types/react(-dom) → 19
- eslint 8 → 9 (flat config), eslint-config-next → 16, @typescript-eslint 6 → 8
  (also clears the lingering ts-eslint Dependabot alert)

Config migrations required by Next 16:
- `next lint` removed → lint scripts use `eslint .`; migrated .eslintrc.json to
  eslint.config.mjs (flat) composing eslint-config-next 16's native flat configs
  (FlatCompat crashes on the react plugin's circular flat object)
- typedRoutes graduated from `experimental` to a stable top-level option
- tsconfig target es5 → ES2017 (Next 16 drops es5; noEmit, so type-check only)

React 19 type-tightening fixes (behaviour unchanged):
- ImgHTMLAttributes['src'] widened to string | Blob → narrow before string ops
  (MDXComponents, ServerMDXContent)
- ReactElement['props'] is now unknown → annotate read shape (guides pre block)
- useRef<T>(null) returns RefObject<T | null> → widen ChatMessageList prop

Deferred (out of scope for a framework upgrade, tracked as follow-up):
eslint-plugin-react-hooks v6 (bundled with Next 16) adds React-Compiler-era
rules (set-state-in-effect, error-boundaries, immutability) that flag 30
pre-existing intentional patterns; disabled here. no-unused-vars caughtErrors
pinned to 'none' to preserve the pre-upgrade contract (v8 flipped the default).

Verified: tsc --noEmit, next build (Turbopack, all pages), eslint ., jest 227 pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-26 11:45:50 +02:00
g-butandClaude Opus 4.6 c252caad5d refactor(components): split dashboard page and DocumentChatPanel
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>
2026-03-03 10:15:39 +01:00
g-butandClaude Opus 4.6 a1c40907b4 refactor(components): split god components into focused modules
Split 3 god pages (1828 lines total) into thin orchestrators (443 lines)
with 5 extracted components:

documents/page.tsx (685→177): Extract DocumentUploadButton,
DocumentListPanel, DocumentChatPanel into components/documents/

try/page.tsx (586→109): Extract TryDocumentsPanel, TryChatPanel
into components/try/

my-data/page.tsx (557→157): Reuse DocumentUploadButton,
DocumentListPanel, DocumentChatPanel — eliminating duplicated
document management code entirely.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 17:23:15 +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 cc632bb57c feat: add document categories and professional chat API
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>
2026-02-02 11:14:27 +01:00
g-butandClaude Opus 4.5 99b1bed9c2 refactor: migrate remaining files to shared LoadingSpinner
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>
2026-01-23 17:13:30 +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