Commit Graph

30 Commits

Author SHA1 Message Date
admin 9f176272c1 docs(chat): consolidate multi-role protocol 2026-07-20 19:08:24 +08:00
admin 4d1c85727a refactor(chat): remove guest history synchronization 2026-07-20 14:02:39 +08:00
admin b6fdc912ae feat(chat): sync multi-role backend APIs 2026-07-20 11:29:54 +08:00
admin 8bb1e21886 fix(chat): isolate pending flows and cancel stale requests 2026-07-20 10:31:27 +08:00
admin ae97366a4a refactor(data): replace schema classes with readonly models 2026-07-17 13:21:40 +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 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 b126b83c4c fix(chat): isolate cached data by identity
Scope message and media caches to the active user or guest identity. Preserve identity snapshots across async chat flows and discard legacy unscoped message data during the IndexedDB upgrade.
2026-07-13 16:54:34 +08:00
admin 3752b3b729 feat(chat): add promotional external entry flow 2026-07-13 12:43:18 +08:00
admin 8312d08653 fix(chat): apply unlocked voice audio url 2026-07-10 11:15:59 +08:00
admin 617f1d4777 fix(chat): preserve locked message content on unlock 2026-07-01 10:47:55 +08:00
admin ed109f25a0 refactor(chat): split machine and repository flows 2026-06-30 19:16:33 +08:00
admin 5f94105bc6 fix(chat): update unlock response contract 2026-06-30 18:15:39 +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 0bae53bfba feat: implement lazy singleton pattern for repository instances and update related imports 2026-06-29 17:25:41 +08:00
admin 1ebd29d1ed refactor: remove unused subscription plans and router files 2026-06-29 10:56:08 +08:00
admin 455204e1e4 feat(chat): add history unlock api 2026-06-26 19:27:56 +08:00
admin 42c03f8901 feat(chat): migrate chat protocol to lock detail 2026-06-24 14:06:30 +08:00
admin ebd44c4980 feat(chat): add private message unlock flow 2026-06-23 13:21:57 +08:00
admin d81abd6efd feat(chat): support ai photo viewing 2026-06-23 10:34:02 +08:00
admin 35c30ac31e feat(data): add paywall payment APIs 2026-06-18 14:55:54 +08:00
admin 0d0dabaace refactor(utils): add barrel exports 2026-06-18 11:58:50 +08:00
admin 1152491088 refactor(repositories): use barrel imports 2026-06-17 12:09:40 +08:00
admin 982d9ba790 refactor(data): add I*Repository interfaces and depend on them in stores
为 /src/data/repositories/ 下每个仓库类增加对应的接口契约,
接口文件存放在独立的 interfaces/ 子目录中。

改动:
- 新建 4 个接口文件 (iauth_repository / ichat_repository /
  imetrics_repository / iuser_repository),纯 type-only,方法签名
  与实现类完全一致
- 4 个实现类加 implements I{Name}Repository 子句,编译器自动校验契约
- 3 个 stores 文件 (auth / chat / user state machines) 改为依赖接口
  类型:通过 `const xxxRepo: I{Name}Repository = xxxRepository` 局部别名,
  actor 内部调用全部走别名
- barrelsby.json 加入 interfaces/ 目录,让自动 barrel 能覆盖
- Auto-regenerated repositories/index.ts 与 interfaces/index.ts

参照 storage 层已有的 IAuthStorage / IChatStorage / IUserStorage 模式。

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-11 17:02:49 +08:00
admin 016bc6fd2c fix:修复所有的包导入错误问题 2026-06-09 18:30:49 +08:00
admin 904cb3638a refactor(data): move Result utility to utils and simplify API
Relocate the Result type from `@/data/result` to `@/utils/result` and
replace the discriminated-union API (`kind`/`value`) with a simpler
boolean-based API (`success`/`data`) across all repositories and
storage classes for improved readability and consistency.
2026-06-09 10:34:40 +08:00
admin a240f5965d feat(data): add repository layer with Auth/Chat/User/Metrics + shared Result<T>
引入仓库层(`src/data/repositories/`),对齐原 Dart `lib/data/repositories/`
的四个仓库:Auth(hybrid: API+AuthStorage+UserStorage)、Chat(hybrid:
API+LocalChatStorage via Dexie)、User(纯远程)、Metrics(纯远程)。

同步抽取 4 个 `*_api.ts` 中重复的 envelope-unwrap 代码到
`src/data/api/response_helper.ts`,失败时抛 `ApiError`(之前抛裸 Error)。

新建 `src/data/result.ts` 提供仓库层统一 `Result<T>`(`{success,data}` 形态),
与 `src/data/storage/result.ts`(`{kind,value}` 形态)并存。

更新 `barrelsby.json` 让 `src/data/repositories/` 加入 barrel 生成。
2026-06-08 19:28:02 +08:00