Commit Graph
9 Commits
Author SHA1 Message Date
diguaandClaude Sonnet 4.6 68cc5ffcee fix(owner): correct per-session ownerId cache and share one PreferencesManager
On name-match platforms (WhatsApp/Line/Instagram), applyProfileToOtherSessions
writes the local member's platformId to each session, which can differ from the
source ownerId. The session store was caching the source ownerId for all updated
sessions, causing owner display misalignment before a full reload.

Fix: applyProfileToOtherSessions now returns {id, ownerId}[] so the service can
expose updatedSessionOwnerIds in the result; the store uses that map instead of
the single source ownerId.

Also fix a stale-cache issue: registerSessionRoutes and registerPreferencesRoutes
each created their own PreferencesManager when ctx.preferencesManager was absent
(CLI and Electron both omit it). Two independent caches caused a later PATCH to
preferences to deep-merge against stale data and overwrite ownerProfilesByPlatform
back to its pre-selection value. registerSharedRoutes now creates one shared
instance and passes it to all routes via resolvedCtx.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-13 13:16:52 +08:00
diguaandClaude Fable 5 7589515eeb feat(owner): add platform-level owner profile types and matching
Add deterministic owner matching in core (exact platformId first, then
normalized-name fallback limited to whatsapp/line/instagram), plus
OwnerProfile preferences fields shared across Electron and CLI Web.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-13 13:16:52 +08:00
digua 1290ae6569 feat(ai): add chart auto mode preference 2026-06-10 00:15:25 +08:00
diguaandClaude Opus 4.8 7af7fb1f10 fix: persist thinking level selection across restarts
thinkingLevels was excluded from the mergeDefaults whitelist in
PreferencesManager, so user choices were silently dropped on every
save/load cycle and never written to preferences.json.

Add the field to the Preferences interface, DEFAULTS, and mergeDefaults
so the existing backendPersist → savePreferences pipeline can write and
restore it correctly. Adds regression tests covering the save/load
round-trip, multi-save merge, and legacy-file backward compatibility.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-10 00:15:25 +08:00
digua 218c3c9ee9 feat(ai): group desensitize rules 2026-06-04 14:37:12 +08:00
diguaandCursor 6727ff609c feat(ai): add summary strategy with brief and standard detail levels
Support two summary strategies (brief/standard) for AI-generated session
summaries. Users can choose their preferred detail level in Settings > AI >
Session Index. Standard (default) produces richer summaries covering people,
events, and key details.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-27 23:47:27 +08:00
diguaandCursor 0ba9ae04a6 chore: migrate workspace packages to ESM
- Add "type": "module" to all workspace package.json files
- Replace __dirname with import.meta.url-based resolveCliPath() helper
- Convert stream-json/stream-chain CJS named imports to default + destructure
  for ESM compatibility
- Use createRequire() for @node-rs/jieba native module loading in ESM context

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-26 23:19:47 +08:00
digua 08260499f8 feat: migrate localStorage to backend storage with declarative persist plugin
- Add backendPersist Pinia plugin for declarative preferences.json persistence
- Move Preferences types to @openchatlab/shared-types (single source of truth)
- Migrate sessionGapThreshold from localStorage to config.toml [ui]
- Migrate chatlab_filter_history from localStorage to preferences.json
- Fix stale localStorage locale read in i18n/index.ts
- Simplify usePreferencesSync (172 → 75 lines) by delegating to plugin

Adding a new backend-synced preference now only requires 3 changes:
1. shared-types interface  2. node-runtime DEFAULTS  3. store backendPersist.pick
2026-05-19 22:42:00 +08:00
digua 0f9f21db83 feat: 迁移到pnpm-workspace 2026-05-06 23:56:45 +08:00