Commit Graph

37 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 eac3d8f0a7 refactor(data): merge DTO models into schemas 2026-07-17 12:47:18 +08:00
admin 2796010971 feat(characters): support character-scoped conversations 2026-07-17 11:42:31 +08:00
admin acabf165cd refactor(chat): consolidate unlock state 2026-07-16 19:49:08 +08:00
admin cf239a51de fix(chat): keep sent messages in view 2026-07-15 19:14:36 +08:00
admin c37a2f9040 feat(chat): implement pull-to-refresh functionality and pagination for chat history 2026-07-15 18:19:35 +08:00
admin ed3e800245 refactor(chat): reorganize helper functions and update imports 2026-07-15 10:59:23 +08:00
admin cd0351b923 refactor(chat): remove pagination-related state and logic from chat components 2026-07-13 17:06:12 +08:00
admin 4682b4bf3f refactor(chat): simplify paid message lock state 2026-07-13 15:20:07 +08:00
admin 3752b3b729 feat(chat): add promotional external entry flow 2026-07-13 12:43:18 +08:00
admin 5821a4d062 fix(chat): render cached history before network sync 2026-07-02 11:51:20 +08:00
admin f6e7adbe96 refactor(chat): remove weekly limit flow 2026-07-01 13:12:14 +08:00
admin e7a9e7abe5 feat(chat): unlock paid messages before payment 2026-06-30 18:56:17 +08:00
admin 958a0f8ffd feat(chat): handle credit-gated send responses 2026-06-30 14:17:14 +08:00
admin cee63e8658 fix(chat): use weekly limit for message quota 2026-06-29 18:40:44 +08:00
admin 80d6563ffb refactor(chat): remove unused upgrade state fields 2026-06-29 16:32:11 +08:00
admin b7779878cf feat(chat): unlock history after payment 2026-06-29 10:53:52 +08:00
admin 1b73c3ac10 refactor(chat): remove private unlock machine flow 2026-06-26 19:17:29 +08:00
admin e9fc001a6f refactor(chat): remove vip websocket session flow 2026-06-26 18:35:26 +08:00
admin fe85af0cd7 fix(chat): queue outgoing messages 2026-06-26 11:11:43 +08:00
admin 0bff65dd32 feat(docs): add simplified API documentation for chat messages 2026-06-25 12:06:49 +08:00
admin 42c03f8901 feat(chat): migrate chat protocol to lock detail 2026-06-24 14:06:30 +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 6ff1accad5 refactor(chat): split sessions by vip status 2026-06-22 15:11:57 +08:00
admin 61fd4ca916 feat(chat): handle daily message paywall 2026-06-22 10:46:17 +08:00
admin 5d66cef85c refactor(dto): move app models into dto layer 2026-06-17 17:34:55 +08:00
admin dcb6312fa3 feat(chat): add quota-exhausted banner for guest users
Introduce ChatQuotaExhaustedBanner component that displays a pink gradient
banner with an "Unlock your membership to continue" CTA when a guest user's
free chat quota has been exhausted. The banner is shown in ChatScreen when
isGuest is true, quota has loaded, and the chat state machine's
quotaExceededTrigger has been incremented by a quota guard. Default click
navigates to /subscription, with an optional onUnlock callback for
overrides/tests. Styles align with the existing splash and sidebar VIP
card visual language.
2026-06-16 15:18:11 +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 31f2433c4b refactor: auto-init guest chat quota on first read, clean up logs
- Remove unused `quotaWarningThreshold` and `warningThreshold` getter from `GuestChatQuota` DTO
- Apply get-or-init pattern in `ChatStorage.getGuestDailyChatQuota` and `getGuestTotalQuota`: when no existing value, initialize with DTO defaults (`threshold` = max per day, `totalQuotaDefault`) and return the seeded data
- Fall back to original `null` result if initialization write fails
- Consolidate logging strategy: drop per-actor trace logs in `chat-machine.ts`, keep business-decision logs in 3 assign actions, move all actor ENTRY/API/DONE chains to `chat-machine.actors.ts` and helper load logs to `chat-machine.helpers.ts`
2026-06-15 17:39:50 +08:00
admin 1f3980d461 chore(chat): refactor chat init into separate quota and history actors
Split `chatInitActor` into `loadQuotaActor` (guest quota fetch) and `loadHistoryActor` (local → network → save sync), and add `quotaLoaded` / `historyLoaded` state flags so the UI can display loading status during the new local-first history hydration flow. Also drop the now-unused `ChatInit` event and pipe Next.js stdout/stderr to a persistent log file in the post-receive hook for easier troubleshooting.
2026-06-15 16:21:40 +08:00
admin 38f060bbd8 refactor(chat): extract XState actors into chat-machine.actors.ts
- Split chat state machine actors (chatInit, sendMessageHttp, loadMoreHistory, chatWebSocket) into a dedicated module
- Add comprehensive console logging across the chat state machine for full trace debugging
- Comment out margin on text bubble CSS for layout adjustment
- Add debug logging to chat input bar send handler
- Clean up redundant comments in auth-screen component
2026-06-12 11:20:19 +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
admin 2bc2e1b691 refactor: migrate img tags to next/image and fix hook usage 2026-06-10 19:16:41 +08:00