You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(admin): migrate ad-hoc stores to Zustand + Jotai
Adopts lobe-chat's slice pattern (externalized action class, flattenActions,
subscribeWithSelector + shallow). Each store gets initial-state / action /
store / index split into its own folder.
- focus-scope, context-menu, modal-imperative, codemirror/editor-store →
Zustand, with imperative wrappers preserved so callers like present.ts
and the ContextMenu trigger keep their existing API.
- theme, codemirror/editor-setting → Zustand + persist middleware. The
hand-rolled localStorage + custom-event broadcasts are gone; the matchMedia
listener in theme.ts stays on useSyncExternalStore (DOM source).
- codemirror/image-popover-state → Jotai atom (small, transient).
- Add src/store/{types,utils/flatten-actions}.ts shared by every slice.
useSyncExternalStore now only remains in theme.ts for matchMedia.
0 commit comments