Commit Graph

67 Commits

Author SHA1 Message Date
admin b6fdc912ae feat(chat): sync multi-role backend APIs 2026-07-20 11:29:54 +08:00
admin 7bd5defa5e refactor(characters): drive shared UI from active character 2026-07-20 10:31:27 +08:00
admin d545c3653f refactor(splash-screen): remove dark variant from AppBottomNav 2026-07-17 16:28:56 +08:00
admin b3ebd5cf3b feat(characters): use local character catalog 2026-07-17 16:03:18 +08:00
admin a210a98d98 refactor(assets): relocate character cover image 2026-07-17 15:04:43 +08:00
admin eac3d8f0a7 refactor(data): merge DTO models into schemas 2026-07-17 12:47:18 +08:00
admin 836ae95940 refactor: canonicalize TypeScript and Tailwind syntax 2026-07-14 19:06:47 +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 8eaea17156 fix(auth): stabilize hydration-dependent UI 2026-07-14 13:27:41 +08:00
admin b6551b6a5a fix(splash): prevent latest message hydration mismatch 2026-07-14 12:34:49 +08:00
admin f9c15bd91f fix(splash): reuse latest chat message preview 2026-07-14 11:28:23 +08:00
admin d8cd05b228 feat(ui): refine home and private room navigation
Replace the floating bottom navigation with a full-width tab bar. Add splash press feedback and a neutral private room background.
2026-07-13 18:16:17 +08:00
admin 34c6f5523c refactor(app): remove unused components 2026-07-13 14:02:27 +08:00
admin b89bde1b55 style(app): normalize tailwind utility syntax 2026-07-13 13:17:16 +08:00
admin 181e0aee19 refactor(app): migrate banner styles to tailwind 2026-07-13 10:28:31 +08:00
admin 965e159a95 refactor(chat): migrate styles to tailwind and update components 2026-07-13 10:09:21 +08:00
admin 04af0e25f1 refactor(splash): migrate simple styles to tailwind 2026-07-11 13:23:11 +08:00
admin 098b675f44 refactor(ui): add shared character avatar 2026-07-10 18:35:17 +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 75aa084095 feat(app-bottom-nav): update styles and add variant support; integrate dark variant in SplashScreen
Docker Image / Build and Push Docker Image (push) Has been cancelled
2026-07-08 17:15:06 +08:00
admin 90ed2e8906 fix(splash): move SplashLatestMessage component for better layout 2026-07-08 17:08:57 +08:00
admin 2704c7f307 feat(splash): add latest message entry 2026-07-08 17:05:36 +08:00
admin 2aaf60a497 fix(auth): defer guest login until chat entry 2026-07-07 14:11:36 +08:00
admin 1fcad49baa feat(sidebar): show free chat allowance 2026-07-03 16:34:38 +08:00
admin b22f23bcc4 refactor(auth): simplify splash guest entry 2026-07-03 15:57:01 +08:00
admin 873a0a8bce refactor(router): centralize app route transitions 2026-07-03 14:15:52 +08:00
admin e5bfb4e373 style(responsive): finish responsive token migration 2026-07-03 11:19:27 +08:00
admin 38d31572dd Refactor chat component styles for responsiveness and consistency
- Updated padding and margin properties across various chat components to utilize responsive design tokens, ensuring better adaptability to different screen sizes.
- Replaced fixed sizes with responsive variables for buttons, avatars, and bubbles to enhance UI flexibility.
- Adjusted font sizes to use responsive tokens, improving text readability on various devices.
- Standardized border-radius and other dimensions using CSS variables for a cohesive design language.
- Enhanced dialog and screen components with safe area insets for better compatibility with modern devices.
2026-07-03 10:07:49 +08:00
admin ba6ce57e62 refactor(app): tighten feature boundaries 2026-06-30 14:50:31 +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 812a3e41b9 refactor(logging): centralize console output 2026-06-18 13:34:19 +08:00
admin f600e11d55 refactor(auth): centralize login status sync 2026-06-18 12:52:49 +08:00
admin 0d0dabaace refactor(utils): add barrel exports 2026-06-18 11:58:50 +08:00
admin 5c26ad9d5b refactor(splash): remove Athelas font references from CSS files 2026-06-17 16:05:20 +08:00
admin 287affa34a refactor(app): move route screens out of components
Exclude test and spec files from generated barrels so page imports do not load test modules at runtime.
2026-06-17 14:13:42 +08:00
admin cda76a1651 fix(splash): keep login button text on one line 2026-06-17 13:06:56 +08:00
admin 10e6c69af8 fix(pwa): prepare beforeinstallprompt listener early to avoid event loss
The previous install flow had a timing race: the
`beforeinstallprompt` event fires at unpredictable times after
page load (often ~30s+ into the session, when Chrome's heuristic
finally decides the user is engaged). If the listener was
attached only inside the dialog's onClick handler, by the time
the user clicked OK the event had already fired into the void
and the deferred prompt was null — so `install()` returned
"unavailable" every time.

The new flow attaches the listener as early as possible:

1. `pwaUtil.prepareInstallPrompt()` — new public method that
   calls the private `attachListener()`. Idempotent (guard via
   `listenersAttached`).

2. `pwaUtil.canPromptInstall()` — companion getter that returns
   whether a deferred event is currently cached. Useful for UI
   to decide whether to even show the install CTA.

3. `pwa-install-overlay.tsx` — calls `prepareInstallPrompt()`
   right after the isSupported / isInstalled guards. The overlay
   mounts when the user enters /chat, so this is the earliest
   practical point in the user flow.

4. `pwa-screen.tsx` — calls `prepareInstallPrompt()` BOTH at
   module load (synchronous, so the listener is attached before
   the splash screen's useEffects run) AND in a useEffect for
   robustness. The splash screen is the very first screen the
   user sees, so attaching here is the earliest possible.

5. `pwa-install-dialog.tsx` — `handleInstall` is now async,
   and `onInstall` accepts `() => void | Promise<void>`. The
   overlay calls `await pwaUtil.install()` so the deferred
   prompt flow can complete before the dialog unmounts.

Together: the listener is now attached from the moment the
splash screen module loads, the deferred prompt is captured
whenever Chrome decides to fire the event, and the dialog's
install button can reliably `prompt()` against the cached
deferred. The full install flow now works end-to-end.
2026-06-17 12:00:24 +08:00
admin c07a10ee80 refactor(splash): handle Skip redirect in splash screen, decouple SplashButton
Previously, the Skip button (guest login entry) relied on the auth
state machine's `pendingRedirect` flag to trigger the navigation
to /chat after guest login completed. That introduced a
non-obvious coupling: the button dispatched an event, the machine
ran an actor, the auth screen (or splash useEffect) saw the flag
and redirected.

This refactor moves the redirect into the splash screen itself:

- `SplashButton` now takes an `onSkip` prop and no longer knows
  about auth dispatch. Pure presentation component.
- `SplashScreen` provides `handleSkip` that dispatches the
  `AuthGuestLoginSubmitted` event AND immediately calls
  `router.replace(/chat)` for snappier perceived navigation.
- `auth-machine.ts`: `loadingGuestLogin.onDone` no longer sets
  `pendingRedirect: true` (splash already navigated). Sets
  it to `false` explicitly so other screens (auth, sidebar) that
  also react to `pendingRedirect` don't double-navigate if the
  user triggers guest login from a non-splash surface in the future.

No behavior change for the happy path: Skip → /chat works the same.
The refactor is purely about responsibility allocation and
component decoupling.
2026-06-17 11:51:35 +08:00
admin 5764b3c433 feat(ui): replace emoji icons with lucide-react icon components 2026-06-16 16:23:36 +08:00
admin 02b1b713a5 style(splash): set Athelas as primary font and italicize button text
- Prioritize Athelas in --font-system font stack with system fonts as fallback
- Apply italic style to splash button heading and label for typography emphasis
2026-06-16 15:30:23 +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 cba52884a3 chore: clean up migration comments and unused params
Remove obsolete Dart migration notes and route handling comments from splash-button.tsx and auth-machine.ts, and drop the unused `self` parameter from `chatWebSocketActor` callback signature.
2026-06-16 12:01:42 +08:00
admin 29776272ad fix(auth): handle null backend values and surface login errors on splash
Two related fixes for OAuth login failures:

- `UserSchema`: backend (Facebook/Apple) returns `null` for fields like
  `email`; Zod's `.default("")` rejects `null`, causing silent login
  failures. Introduce `stringOrEmpty` / `numberOrZero` / `booleanOrFalse`
  helpers (`nullable().transform(v => v ?? x).default(x)`) and apply
  across the schema so input accepts `string | null | undefined` while
  output stays the typed primitive.

- `SplashScreen`: render `state.errorMessage` (set by auth state machine
  `onError`, e.g. Facebook sync / schema mismatch) so users no longer
  get stuck on splash without feedback.
2026-06-16 11:10:21 +08:00
admin ed4ccddae3 refactor(chat): decouple chat state from auth and gate quota alerts to guests
- Remove ChatAuthStatusChanged dispatch from auth login flow; chat screen now subscribes directly to auth state machine (loginStatus) to derive isGuest and drive WS lifecycle
- Gate quota-exceeded and warning dialogs to guests only (non-guests have no message limit)
- Dispatch ChatLoadMoreHistory for non-guest initial load vs ChatInit for guests
- Fix AppConstants import path from @/core/constants/app_constants to @/core/app_constants
- Add defensive isGuest checks in quota effects to prevent non-guest quota triggers
2026-06-11 18:31:08 +08:00
Claude d205025a11 fix(splash): left-align bottom text on splash screen 2026-06-11 17:06:47 +08:00
admin 1151a9a61b fix:splash 界面重定向界面问题 2026-06-11 17:00:04 +08:00
admin e3d549d660 fix:splash 界面重定向界面问题 2026-06-11 16:06:36 +08:00
admin a6bc6941d4 refactor(splash): convert Skip to explicit guest login flow
- Splash Skip button now dispatches `AuthGuestLoginSubmitted` instead of
  direct routing, keeping guest auth under the state machine
- Update PWA install dialog copy ("Add to Home Screen") and drop favicon
  entry from manifest icons
- Add debug logging and routing sequence docs to splash-button
2026-06-11 15:58:48 +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