Commit Graph
6 Commits
Author SHA1 Message Date
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 403c9bf5a7 Add Phase 3: Document upload and RAG chat
- Add Transformers.js for local embeddings generation
- Create document upload API with Supabase Storage
- Create document processing pipeline (parse, chunk, embed)
- Create semantic search API using pgvector
- Create RAG chat API combining search + LLM
- Add documents page UI with upload, process, and chat
- Add database migration for document status columns
- Configure Next.js to externalize ONNX packages

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 12:39:43 +01:00
g-butandClaude Opus 4.5 41d002975b refactor: split CitizenProfile into focused sub-components
Reduced CitizenProfile.tsx from 650 to 115 lines by extracting:
- CitizenProfileHeader: avatar and participation score display
- CitizenProfileTabs: tab navigation component
- CitizenOverviewTab: citizen summary and tax distribution cards
- CitizenTaxTab: tax payment history table
- CitizenBenefitsTab: benefits list with eligibility check
- CitizenAdvisoryTab: advisory distribution sliders

Leveraged existing types from types/governance.ts and utilities
from lib/governance/utils.ts for DRY compliance.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 20:23:21 +01:00
g-butandClaude Opus 4.5 0bc5ed26f8 refactor: complete bot page deduplication with BotPageTemplate
Refactored remaining 3 bot pages to use shared BotPageTemplate:
- legal-expert: simplified imports, uses template wrapper
- swiss-german-teacher: enabled hashScrolling and showFooter options
- product-manager: preserved page-specific scrollToTryIt function

All 6 bot pages now use consistent template pattern.
Updated @fix_plan.md to mark P1 as completed.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 20:08:06 +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
g-butandClaude Opus 4.5 2e39380356 feat: add strict ESLint config and fix all lint issues
- Add .eslintrc.json with strict TypeScript and React rules
- Fix all unused imports and variables (prefix with _ or remove)
- Replace all `any` types with `unknown` or specific types
- Fix React hooks rule violations (conditional hooks, deps)
- Change console.log to console.info per project standards
- Add eslint-disable comments for legitimate img element uses
- Fix anonymous default exports
- Update package.json with ESLint 8 and proper lint scripts

Lint: 0 warnings, 0 errors
Build: passes successfully

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