Commit Graph

62 Commits

Author SHA1 Message Date
admin 82ac9e86a5 fix(pwa): tighten install support detection 2026-07-04 11:18:01 +08:00
admin f470119a1b feat(sidebar): add conditional pwa install action 2026-07-03 18:39:00 +08:00
admin 186b4d934d fix(sidebar): show remaining free allowance only 2026-07-03 17:09:14 +08:00
admin d17ab6c23d feat(profile): surface daily free quotas 2026-07-03 16:56:06 +08:00
admin 1fcad49baa feat(sidebar): show free chat allowance 2026-07-03 16:34:38 +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 e5bfb4e373 style(responsive): finish responsive token migration 2026-07-03 11:19:27 +08:00
admin bb6ebbae7e style(responsive): migrate fixed UI sizes to tokens 2026-07-03 10:22:37 +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 34c8e2db4e feat: Implement responsive page layout components and CSS variables
- Added PageScaffold component for shared page layout with safe-area padding and scroll management.
- Introduced ResponsiveMobileShell for mobile canvas layout with customizable backgrounds.
- Created ScrollablePage component for scrollable content areas.
- Updated CSS styles for coins rules screen, sidebar components, and subscription sections to use responsive design tokens.
- Added viewport CSS variables provider to synchronize CSS variables with the visual viewport.
- Refactored breakpoints and dimensions for better responsiveness across devices.
2026-07-03 10:06:22 +08:00
admin cd25fa35f2 fix(subscription): preselect pay channel before navigation 2026-07-02 11:38:47 +08:00
admin 8d5ee68e5f Reapply "fix(user): refresh profile on sidebar open"
This reverts commit f4d0f76466.
2026-06-30 17:18:36 +08:00
admin ba6ce57e62 refactor(app): tighten feature boundaries 2026-06-30 14:50:31 +08:00
admin f4d0f76466 Revert "fix(user): refresh profile on sidebar open"
This reverts commit 6e811b0e09.
2026-06-30 13:07:50 +08:00
admin 6e811b0e09 fix(user): refresh profile on sidebar open 2026-06-30 11:36:52 +08:00
admin 4f919d46ad style(ui): use coin icons for wallet actions 2026-06-29 15:13:14 +08:00
admin 069072af17 fix(sidebar): adjust topBar margin for improved layout 2026-06-29 14:57:45 +08:00
admin ef18500de3 feat(back-button): enhance button styles and add variant support; refactor back navigation in sidebar and coins rules screen 2026-06-29 14:54:03 +08:00
admin 096978e703 feat(subscription): split vip and topup flows 2026-06-29 14:45:01 +08:00
admin 72ac923a44 feat(coins-rules): update coin rules text to English for better clarity
style(sidebar): enhance hero section with new padding, border, and background
2026-06-29 14:17:46 +08:00
admin e372d58b4c feat(payment): sync plans and add coins rules 2026-06-29 14:11:50 +08:00
admin 274fe87ced feat(sidebar): add wallet top up card 2026-06-29 13:22:50 +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 e01b0daaf3 fix(user): prefer stored avatar in account surfaces 2026-06-25 17:29:49 +08:00
admin 949b2ef00d fix(chat): restore direct voice unlock subscription 2026-06-25 17:18:41 +08:00
admin 038b207964 feat(ui): add responsive mobile design tokens 2026-06-25 10:50:46 +08:00
admin cc065f7781 fix(sidebar): adjust padding for user slot 2026-06-25 10:21:52 +08:00
admin 2d3cb0538c fix(styles): adjust padding and remove margin for title in voice package card 2026-06-24 18:08:25 +08:00
admin bc2046fcc6 fix(styles): increase font size for used and total numbers for better visibility 2026-06-24 17:57:17 +08:00
admin 7701c5dbca fix(styles): adjust padding and font sizes for improved layout consistency 2026-06-24 17:55:48 +08:00
admin 57e4add7a4 style(sidebar): refine action buttons 2026-06-24 11:35:15 +08:00
admin cb7087f8ad chore(chat): add mock fixtures 2026-06-23 14:54:24 +08:00
admin ec8c559a19 style(sidebar): refine membership cards 2026-06-22 15:46:48 +08:00
admin b105ba3457 style(sidebar): update voice package icon 2026-06-22 14:58:50 +08:00
admin df7f673855 feat(subscription): support voice package mode 2026-06-22 09:53:35 +08:00
admin 52aad5b7f3 style(subscription): refine plan card layout 2026-06-18 19:20:35 +08:00
admin 5bf98e9452 feat(subscription): support Stripe payment element 2026-06-18 18:03:36 +08:00
admin 1fc1635341 chore: wire release hook and service updates 2026-06-18 16:18:52 +08:00
admin f600e11d55 refactor(auth): centralize login status sync 2026-06-18 12:52:49 +08:00
admin f0b5275c55 refactor(sidebar): comment out user info section and membership option 2026-06-17 17:30:16 +08:00
admin bda1605ce7 fix(auth): redirect to splash after logout 2026-06-17 15:07:16 +08:00
admin 0d2a515e51 fix(sidebar): redirect to splash screen after logout 2026-06-17 14:35:28 +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 c3f2f8d954 fix(sidebar): trigger logout from click 2026-06-17 12:59:48 +08:00
admin ee760abdf5 refactor(auth): clean up user logout handling in SidebarScreen 2026-06-17 11:11:25 +08:00
admin e85963e7bf refactor(auth): rename AuthStatusCheckSubmitted → AuthInit (init-only)
The previous event name implied "re-check status", but the actual
semantics is just "read storage on app start and sync loginStatus into
the machine". It was being dispatched from three sites:

1. AuthStatusChecker mount useEffect (the legit one-time init)
2. AuthStatusChecker loginStatus-watching useEffect (dead code — the
   machine's onDone already writes loginStatus, re-reading storage
   just returns the same value as a no-op)
3. Sidebar post-logout effect (also dead code — AuthReset directly
   sets loginStatus to initialState's "notLoggedIn", and
   userLogoutActor already cleared storage, so the values are
   already aligned)

This commit:

- Renames event AuthStatusCheckSubmitted → AuthInit in:
  * auth-events.ts (type union)
  * auth-machine.ts (handler + transition target: checkingAuthStatus →
    initializing, mirroring UserInit / initializing in user-machine)
  * auth-status-checker.tsx (single dispatch site)
  * root-providers.tsx (one comment)

- Simplifies auth-status-checker.tsx from 74 → ~40 lines:
  * Removes useEffect ② (loginStatus-watching re-check)
  * Removes prevLoginStatusRef + skipNextChangeRef + useAuthState
    (dead loop-guard machinery no longer needed)

- Removes the post-logout re-check dispatch from sidebar-screen.tsx:
  * AuthReset alone is sufficient — userLogoutActor cleared storage
    and AuthReset writes back initialState, so they match by
    construction. No re-verification needed.

Net: -44 lines, no behavior change for the happy paths (startup,
login, logout), one fewer source of false re-checks.
2026-06-17 09:52:45 +08:00
admin 0a9abc2502 fix(auth): stop parsing logout response body (avoids ZodError on null data)
Root cause: backend `/auth/logout` returns `{ success: true, data: null }`
(no business payload for a fire-and-forget endpoint). The previous
`AuthApi.logout` ran `unwrap(env)` (which passes null through, since
null is defined) and then `LogoutResponse.fromJson(null)`, which
Zod-parses as `z.object(...)` and throws "Invalid input: expected
object, received null".

The error was caught in `AuthRepository.logout` with
`console.warn(... clearing local anyway)` — logout actually still
worked (local clear ran), but a noisy red ZodError hit the console on
every logout click.

Fix: align `AuthApi.logout` with the existing fire-and-forget pattern
used by `register` and `sendCode` — call `httpClient` and ignore the
response body. Drop the now-unused `LogoutResponse` import.

`AuthRepository.logout` already discards the return value, so the
`Promise<LogoutResponse> → Promise<void>` signature change is safe.

Bundled in this commit (unrelated):
- chat-machine.actors.ts / user-machine.ts: removed stale design-doc
  comment blocks (IDE/linter cleanup)
- user-machine.actors.ts: removed redundant `userStorage.clearUserData()`
  from `userLogoutActor` — `authRepo.logout` already clears local
  user data, so this was a no-op duplicate.
- sidebar-screen.tsx: removed one stale comment line.
2026-06-16 18:34:55 +08:00
admin 39e7d61c8a fix(auth): re-check auth status after logout; clear NextAuth session after sync
1) Sidebar logout flow:
   - After AuthReset, also dispatch AuthStatusCheckSubmitted so the auth
     machine re-verifies storage (not just resets to initialState). This
     makes sure the redirect to /chat reflects the actual storage state,
     not just the forcibly-cleared context.

2) OAuthSessionSync:
   - After dispatching AuthGoogleSyncSubmitted / AuthFacebookSyncSubmitted,
     call signOut({ redirect: false }) to drop the NextAuth session.
     The OAuth idToken / accessToken has already been handed to the
     backend; clearing the browser-side session prevents lingering OAuth
     credential exposure. Fire-and-forget — once status flips to
     "unauthenticated", the useEffect early-returns so no re-entry.

Note: auth-machine.ts lost a 3-line stale comment block about XState v5
type inference for inline assign; bundled with this commit.
2026-06-16 18:24:23 +08:00
admin e44cc7e2f3 feat(sidebar): redesign sidebar UI with three user states (light theme)
Replace the dark sidebar theme with a light-themed three-state UI
matching the design references:

- guest  : pink "login" pill in user row, no status pill on VIP card,
           "Activate VIP Membership" button shown
- member : "VIP membership not activated" subtitle, no status pill,
           "Activate VIP Membership" button shown
- vip    : pink "VIP Member" pill with diamond icon, "Activated" pill
           in VIP card header, no Activate button

Decompose into BackBar, UserHeader, VipBenefitsCard, and VoicePackageCard
under src/app/sidebar/components/. Delete obsolete GuestPanel,
UserInfoCard, and VipCta.

Lift VIP_BENEFITS to a shared src/data/constants/vip-benefits.ts so the
sidebar and subscription page render identical benefit copy.

Add five sidebar tokens (--color-card-surface, --color-voice-gradient-*
--border-card, --shadow-card, --color-pill-bg) to src/tokens/colors.css.

Includes barrelsby regeneration for src/app/sidebar/components and
side-effect barrel updates under src/stores/{auth,chat,sidebar,user},
plus package-lock.json from npm install (required for lint/typecheck).

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-16 10:30:21 +08:00