Commit Graph

9 Commits

Author SHA1 Message Date
admin 1db3e3ae31 refactor(chat): align chat header and input bar with Dart source 2026-06-10 11:59:53 +08:00
admin a5d8214650 refactor: migrate state imports from contexts to stores directory 2026-06-09 18:47:04 +08:00
admin 016bc6fd2c fix:修复所有的包导入错误问题 2026-06-09 18:30:49 +08:00
admin 6e64ed35f4 chore(deps): add unstorage and migrate ChatStorage to use SpAsyncUtil 2026-06-09 18:13:55 +08:00
admin 5e645b003e feat: add xstate state management for user state
Introduce xstate v5 and @xstate/react to manage user authentication and profile state. Implement userMachine with actors for initialization, fetching, and logout operations, along with actions for updating user data and clearing state.
2026-06-09 17:26:16 +08:00
admin 8cab34864e feat(ui): migrate Flutter UI library to Next.js 16 (App Router)
Migrate all 87 Dart files from /Users/chase/Documents/cozsweet/lib/ui/
to TypeScript React components, replacing Flutter-native features with
Web equivalents and reimplementing the BLoC pattern with React
Context + useReducer.

Highlights
- 1:1 BLoC -> Context+useReducer+side-effects mapping for auth, chat,
  user, and sidebar features (4 providers wired in root-providers.tsx)
- 500px MobileShell primitive eliminates per-screen layout boilerplate
- Headless Dialog primitive (createPortal + ESC + scroll lock) powers
  quota / pwa-install / username / pronouns / subscription / other-options
  dialogs
- New integrations/: facebook-sdk, google-identity, pwa-install,
  media-recorder (Web Speech API + MediaRecorder), browser-detect,
  chat-websocket (singleton), message-queue (throttled send)
- CSS Modules + existing design tokens (no new styling system);
  extended with breakpoints.css and dimensions.css
- Custom hooks: useBreakpoint (useSyncExternalStore),
  useFullVisibility (IntersectionObserver), usePwaInstall,
  usePullToRefresh
- Vitest + jsdom; 15 unit tests (chat-reducer, auth-validators)
- React 19.2.4, Next.js 16.2.7, Zod 4, lottie-react, classnames

Workarounds
- next.config.ts: experimental.staticGenerationRetryCount = 0 to
  bypass Next.js 16.2.7 /_global-error workStore prerender bug
- src/app/global-error.tsx: required Client Component
- src/types/globals.d.ts: centralized window.google / FB /
  SpeechRecognition declarations

Routes (/, /splash, /auth, /chat, /chat/deviceid/[deviceId],
/sidebar) all build and lint clean.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-09 13:39:49 +08:00
admin 904cb3638a refactor(data): move Result utility to utils and simplify API
Relocate the Result type from `@/data/result` to `@/utils/result` and
replace the discriminated-union API (`kind`/`value`) with a simpler
boolean-based API (`success`/`data`) across all repositories and
storage classes for improved readability and consistency.
2026-06-09 10:34:40 +08:00
admin 67a72783fe feat(styles): migrate design system tokens to CSS variables
Replace minimal background/foreground vars with a comprehensive design
system covering colors (background, text, brand, profile, gifts,
activities, nav), spacing, and border-radius tokens. Mirrors the
original Dart design constants under src/design/*.ts and supports
dark mode.
2026-06-08 18:43:38 +08:00
admin f4e1c30051 feat(api): migrate HTTP layer to ofetch with token interceptor 2026-06-08 15:52:27 +08:00