Commit Graph

58 Commits

Author SHA1 Message Date
admin c277b3e6ca feat(tip): add selectable coffee gift tiers 2026-07-15 17:00:25 +08:00
admin 836ae95940 refactor: canonicalize TypeScript and Tailwind syntax 2026-07-14 19:06:47 +08:00
admin bb0d9244c0 refactor(rsc): narrow client module boundaries 2026-07-14 18:39:56 +08:00
admin 0033625866 perf(bundle): replace broad storage and utils imports 2026-07-14 18:13:55 +08:00
admin 81d6489978 feat(analytics): add behavior and payment funnel tracking 2026-07-14 16:54:13 +08:00
admin 538af6d45f feat(private-room): migrate to album APIs 2026-07-14 12:30:22 +08:00
admin 3a4f24cb06 feat(payment): implement coffee tip plans and update payment flow 2026-07-14 11:48:46 +08:00
admin f9c15bd91f fix(splash): reuse latest chat message preview 2026-07-14 11:28:23 +08:00
admin 0fe74b5371 feat(tip): support tiered coffee gifts 2026-07-14 10:46:27 +08:00
admin 328c4c8127 fix(splash): select the latest history message 2026-07-13 18:16:25 +08:00
admin fd631168c8 feat(auth): implement Facebook identity binding on external entry 2026-07-13 15:02:01 +08:00
admin 3752b3b729 feat(chat): add promotional external entry flow 2026-07-13 12:43:18 +08:00
admin 53801490e5 feat(auth): add facebook identity psid login 2026-07-10 17:10:55 +08:00
admin e421192560 feat(auth): rename external ids to asid psid 2026-07-10 11:54:10 +08:00
admin dfa5b0c068 refactor(chat): make external browser launch user initiated 2026-07-09 15:18:52 +08:00
admin 9159f5346d feat(navigation): add external entry routing 2026-07-09 14:43:28 +08:00
admin 0106fba877 fix:展示 AI 回复的消息内容 2026-07-09 14:16:07 +08:00
admin fc92c3a5d5 refactor(chat): show images in page overlay 2026-07-09 10:11:25 +08:00
admin cb7791dd8d feat(tip): add coffee tipping page 2026-07-08 19:21:42 +08:00
admin baf0deeb24 feat(splash): load latest chat message
Docker Image / Build and Push Docker Image (push) Has been cancelled
2026-07-08 17:31:58 +08:00
admin b5bf81de59 refactor(api): remove unused network endpoints 2026-07-07 16:29:21 +08:00
admin 27cb2e2c33 fix(pwa): show install prompt only once 2026-07-03 18:29:58 +08:00
admin 8f17ea9c9f fix(auth): return to guest session on logout 2026-07-03 16:14:04 +08:00
admin 91dde42f92 refactor(router): introduce app navigation manager 2026-07-03 14:09:13 +08:00
admin 3592c6bb56 feat(chat): show first recharge offer in header 2026-07-02 18:45:08 +08:00
admin cd25fa35f2 fix(subscription): preselect pay channel before navigation 2026-07-02 11:38:47 +08:00
admin 2b0129679f fix(chat): restore image message scroll anchor 2026-07-02 10:44:43 +08:00
admin c20769b6a3 fix(chat): make cached media load on safari 2026-07-01 20:13:56 +08:00
admin ae6578923b refactor(storage): use unstorage for session state 2026-07-01 18:36:26 +08:00
admin a52e7f15ff refactor(auth): enhance business login session validation and add tests 2026-07-01 15:01:15 +08:00
admin e7a9e7abe5 feat(chat): unlock paid messages before payment 2026-06-30 18:56:17 +08:00
admin e75865865f chore(architecture): enforce app data boundaries 2026-06-30 17:37:53 +08:00
admin 9cff16e2d9 refactor(chat): tighten media cache boundaries 2026-06-30 16:12:02 +08:00
admin ccd2d6bd48 feat(media): implement caching for chat media and update components to use cached media 2026-06-30 15:59:33 +08:00
admin 218df59345 refactor(subscription): tighten payment flow boundaries 2026-06-30 15:36:49 +08:00
admin ba6ce57e62 refactor(app): tighten feature boundaries 2026-06-30 14:50:31 +08:00
admin 1fed21fa2f refactor(chat): clean stale mocks and external browser helpers 2026-06-30 14:32:58 +08:00
admin 6e51cb7d16 Refactor: Remove original Dart references from comments across multiple files
- Updated comments in various components, schemas, and repositories to remove references to original Dart files.
- Ensured consistency in documentation while maintaining the context of the code.
2026-06-29 11:31:21 +08:00
admin a347b39001 feat(payment): connect payment service flow 2026-06-18 15:40:59 +08:00
admin 812a3e41b9 refactor(logging): centralize console output 2026-06-18 13:34:19 +08:00
admin 9ffa30cc03 style: remove markdown bold syntax from code comments
Remove `**...**` emphasis markers from inline comments and JSDoc blocks across
auth and chat components, machine mappers, and quota helpers. These are
plain code comments, not rendered markdown, so the bold syntax was noise.

Files touched:
- src/app/auth/components/auth-screen.tsx
- src/app/chat/components/chat-header.tsx
- src/app/chat/components/chat-screen.tsx
- chat machine mapper / quota helpers

No functional or behavioral changes.
2026-06-16 14:06:31 +08:00
admin 0548a08cbb feat: integrate Stripe payment with subscription plans
Add Stripe payment integration across the project:

- Add @stripe/stripe-js dependency
- Configure Stripe environment variables (secret key, publishable key, webhook secret) for dev, local, and production environments
- Add Product/Price IDs for monthly, quarterly, and annual subscription tiers
- Extend subscription plan data with voiceMinutesPerDay quotas (30/45/60 minutes per tier)
- Update .gitignore to exclude implementation_plan.md
2026-06-16 10:21:02 +08:00
admin c7b02ecfb6 refactor(auth): extract NextAuth config to shared lib module
Move the NextAuth v4 configuration from the route handler
(src/app/api/auth/[...nextauth]/route.ts) into a dedicated module
(src/lib/auth/auth.ts) to establish a single source of truth. The
route file now simply re-exports the handler from the shared
module, keeping provider setup, JWT/session callbacks, and
environment variable references in one reusable location.
2026-06-12 17:56:01 +08:00
admin dbc9a0cd13 refactor(auth): inline NextAuth v4 config and simplify AuthPlatform API
- Inline NextAuth v4 handler directly in `[...nextauth]/route.ts`, removing
  the `@/lib/auth/nextauth` abstraction layer
- Add Google/Facebook providers with JWT/session callbacks that expose
  `idToken` and `accessToken` on the session for backend exchange
- Refactor `AuthPlatform` from constructor-based to static methods
  (`googleSignIn()` / `facebookSignIn()`)
- Update `auth-machine.ts` and layout comment reference to match new structure
- Align with original Dart `nextauth-helpers.{googleLogin, facebookLogin}()`
  naming and keep persistence concerns (unstorage, backend, custom cookies)
  out of scope for this iteration
2026-06-12 17:20:56 +08:00
admin ea339bf621 fix:删除错误配置的代码 2026-06-12 16:43:29 +08:00
admin 0ffc961e00 refactor(core): consolidate core files under src/core directory
Move breakpoints, fonts, and app_constants into the core directory for better organization:
- Move src/lib/breakpoints.ts to src/core/breakpoints.ts
- Move src/lib/fonts.ts to src/core/fonts.ts
- Move src/core/constants/app_constants.ts to src/core/app_constants.ts and clean up outdated comments
2026-06-11 18:16:08 +08:00
admin 0c63b7dee4 feat(auth): sync OAuth provider tokens to backend via NextAuth session
Wire the Google/Facebook OAuth callback flow end-to-end so the provider's id_token (Google) and access_token (Facebook) captured by NextAuth are forwarded to the backend in exchange for business tokens:

- Extend the NextAuth config with jwt/session callbacks that surface `account.id_token` / `account.access_token` to the client during first sign-in
- Add an `OAuthSessionSync` bridge mounted inside `RootProviders` that listens to `useSession()` and dispatches new `AuthGoogleSyncSubmitted` / `AuthFacebookSyncSubmitted` events
- Add corresponding actors in the auth XState machine that call `authRepository.googleLogin` / `facebookLogin`, persisting the backend's `LoginResponse` through the existing repository path

This keeps all authentication orchestrated by the auth state machine while preserving NextAuth's OAuth redirect UX.
2026-06-11 12:59:23 +08:00
admin 72941d9c9f style(pwa-install-dialog): redesign dialog to match Dart spec
Update the PWA install dialog styling and content to align with the
original Dart design, including a white background with large 40px
radius, 86x86 PNG icon, gradient primary button, and dynamic app title
sourced from AppConstants.
2026-06-11 11:29:52 +08:00
admin 47591be41c refactor(auth): unify Facebook and Google login into AuthPlatform class
Replace the separate FacebookLogin and GoogleLogin classes with a single
AuthPlatform class that takes a provider name ("facebook" | "google") as a
constructor argument. This consolidates duplicate OAuth sign-in logic behind
one entry point while preserving the existing NextAuth flow.

- Add new src/lib/auth/auth_platform.ts exporting AuthPlatform and
  AuthProvider type
- Update auth-facebook-panel.tsx and splash-button.tsx to use the new API
- Rename initialContext → initialState in the auth machine for consistency
- Update inline docs and comments to reference AuthPlatform

No behavioral change for end users; both providers still route through
NextAuth's signIn() with the same callbacks and cookies.
2026-06-10 18:58:15 +08:00
admin e0d0e353c0 refactor(auth): remove AuthGate abstraction in favor of useSession
- Drop AuthGate/AuthGateState re-exports from @/lib/auth/nextauth
- Simplify SplashButton by removing skipHref prop and hardcoding ROUTES.chat
- Update comments to reference useSession() (next-auth/react) directly instead of the AuthGate wrapper, since the auth UI gate no longer needs the extra abstraction layer.
2026-06-10 15:48:49 +08:00