Commit Graph

186 Commits

Author SHA1 Message Date
admin fe85af0cd7 fix(chat): queue outgoing messages 2026-06-26 11:11:43 +08:00
admin 949b2ef00d fix(chat): restore direct voice unlock subscription 2026-06-25 17:18:41 +08:00
admin ffc3db9a91 fix(chat): add voice unlock payment choices 2026-06-25 14:41:21 +08:00
admin 8d956bc95d fix(chat): render locked voice messages correctly 2026-06-25 12:04:38 +08:00
admin f83e04ed6f fix(chat): hide voice message transcript 2026-06-25 11:26:32 +08:00
admin cd836cda43 feat(chat): add voice message bubbles 2026-06-25 11:13:25 +08:00
admin c8f0827e40 fix(subscription): return chat paywalls after payment 2026-06-25 10:20:13 +08:00
admin 583215a99d fix(chat): route private unlocks to subscription 2026-06-24 19:27:49 +08:00
admin a987da9bfe fix(chat): redirect guests before quota upgrade 2026-06-24 18:47:10 +08:00
admin 5aa32a4256 fix(chat): redirect guests to auth before image paywall 2026-06-24 18:41:59 +08:00
admin c288148c12 fix(chat): remove dynamic upgradeHint for daily limit message 2026-06-24 18:18:21 +08:00
admin 08c954903f fix(chat): improve in-app keyboard avoidance 2026-06-24 15:13:11 +08:00
admin 853ae776f9 fix(chat): adapt input bar to soft keyboard in FB in-app browser
FB IAB on Xiaomi (and similar WebViews that don't shrink 100dvh) keeps
the chat input covered by the soft keyboard. Fix by writing the
visualViewport-derived keyboard height to a CSS variable on <html> and
consuming it as padding-bottom on the chat input bar.

- Add useKeyboardHeight hook (visualViewport + rAF batching, no re-renders)
- Apply --keyboard-height + env(safe-area-inset-bottom) to .bar padding
- Add scrollIntoView on textarea focus so the input stays visible
- Add viewportFit: cover so safe-area-inset-bottom is reported
2026-06-24 14:13:18 +08:00
admin 42c03f8901 feat(chat): migrate chat protocol to lock detail 2026-06-24 14:06:30 +08:00
admin 6180a8a515 feat(chat): blur locked image previews 2026-06-24 11:53:20 +08:00
admin 3e766a0ecd fix(chat): preserve private send response fields 2026-06-24 11:02:15 +08:00
admin f80b5215a9 feat(chat): log websocket traffic 2026-06-24 10:48:36 +08:00
admin bfbf7ee91a feat(app): improve payment and paywall UX 2026-06-24 10:02:22 +08:00
admin a47038c46f fix(payment): guard ezpay redirect persistence 2026-06-23 17:59:16 +08:00
admin 05821d9a29 fix(chat): prompt guests to log in at quota limit 2026-06-23 17:41:07 +08:00
admin f14b8a48d2 fix(chat): handle guest total limit 2026-06-23 15:14:17 +08:00
admin ebd44c4980 feat(chat): add private message unlock flow 2026-06-23 13:21:57 +08:00
admin 6bcc070ba1 refactor(chat): rely on server message limits 2026-06-23 11:20:48 +08:00
admin d81abd6efd feat(chat): support ai photo viewing 2026-06-23 10:34:02 +08:00
admin cebc8f7443 feat(chat): expand empty input actions 2026-06-22 19:14:27 +08:00
admin 9a65f2f9ad feat(chat): toggle send button icon by input content 2026-06-22 18:58:57 +08:00
admin 41b9a49c74 copy(chat): update input placeholder 2026-06-22 18:48:36 +08:00
admin 61fd4ca916 feat(chat): handle daily message paywall 2026-06-22 10:46:17 +08:00
admin 5bf98e9452 feat(subscription): support Stripe payment element 2026-06-18 18:03:36 +08:00
admin 7354afe93d refactor(ui): extract auth and avatar components 2026-06-18 17:14:02 +08:00
admin e2a89ef063 style(chat): align external browser dialog 2026-06-18 14:30:59 +08:00
admin cf54bc742d fix(chat): limit external browser prompt daily 2026-06-18 14:23:31 +08:00
admin d190de4dda refactor(api): use dto barrel imports 2026-06-18 14:16:00 +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 b09795a7b8 fix(deploy): force stop existing next service 2026-06-18 11:35:26 +08:00
admin 172ef28060 feat(chat): prompt facebook users to open external browser 2026-06-18 10:59:13 +08:00
admin e4b1690b45 fix(chat): redirect unauthenticated users from chat 2026-06-17 19:44:22 +08:00
admin bded7497d2 fix(chat): show browser hint in development 2026-06-17 18:03:25 +08:00
admin 5d66cef85c refactor(dto): move app models into dto layer 2026-06-17 17:34:55 +08:00
admin afba85e809 fix(auth): update routing for subscription access 2026-06-17 17:11:34 +08:00
admin f39e7e0672 fix(pwa): suppress install dialog in in-app browsers 2026-06-17 16:19:21 +08:00
admin f7201fa654 fix(chat): make send button circular 2026-06-17 15:54:05 +08:00
admin 977c0905bd refactor(chat): remove redundant auth state management from ChatScreen documentation
refactor(chat): update guest chat quota logic to use isProduction utility
fix(user): add TODO for user initialization event on login status change
2026-06-17 15:30:36 +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 d41b3c4473 refactor(schemas): extract nullable-default helpers to shared file
The three defensive Zod helpers (stringOrEmpty, numberOrZero,
booleanOrFalse) used by user.ts are general-purpose Zod utilities
that any schema may need — they're not user-specific. The original
inline declaration in user.ts had two downsides:

1. Any new schema (chat, auth, metrics, etc.) that needs the same
   'null | undefined → default scalar' pattern would have to
   duplicate the helper.

2. The long defensive-parse comment block (11 lines) lived inside
   user.ts and didn't explain the helpers' general purpose.

Move them to src/data/schemas/nullable-defaults.ts (top-level
sibling of auth/, chat/, metrics/, user/ subdirs) so any schema
can import them. Keep the original explanation verbatim at the
top of the new file.

Bundled in this commit:
- user.ts imports the helpers from the new file (drops 11 lines
  of comment + 3 const declarations)
- 3 auto-generated barrel index files regenerated by barrelsby
  to pick up the new exports (chat/, subscription/, stores/user/)
2026-06-17 12:05:09 +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 d6f2cb7c56 fix(pwa): enhance PWA install overlay logic for daily display limits and environment handling 2026-06-16 19:05:50 +08:00
admin 5be40949a1 feat(pwa): implement PwaUtil class for PWA support and installation checks 2026-06-16 18:59:17 +08:00