- 将 Zustand 默认 activeModule 从 workspace 调整为 dashboard,登录后默认展示总体概况页。 - 同步测试 resetStore 的默认模块,避免测试环境与真实默认入口不一致。 - 补充 useStore 默认模块回归测试,固定 dashboard 初始入口行为。 - 更新 AGENTS 和前端实现文档,记录登录后的默认模块。
31 lines
749 B
TypeScript
31 lines
749 B
TypeScript
import { DEFAULT_AI_MODEL_ID, DEFAULT_BRUSH_SIZE, DEFAULT_ERASER_SIZE, useStore } from '../store/useStore';
|
|
|
|
export function resetStore() {
|
|
useStore.setState({
|
|
isAuthenticated: false,
|
|
token: null,
|
|
currentUser: null,
|
|
projects: [],
|
|
currentProject: null,
|
|
activeModule: 'dashboard',
|
|
activeTool: 'move',
|
|
aiModel: DEFAULT_AI_MODEL_ID,
|
|
frames: [],
|
|
currentFrameIndex: 0,
|
|
annotations: [],
|
|
masks: [],
|
|
selectedMaskIds: [],
|
|
maskPreviewOpacity: 50,
|
|
brushSize: DEFAULT_BRUSH_SIZE,
|
|
eraserSize: DEFAULT_ERASER_SIZE,
|
|
maskHistory: [],
|
|
maskFuture: [],
|
|
templates: [],
|
|
activeTemplateId: null,
|
|
activeClassId: null,
|
|
activeClass: null,
|
|
isLoading: false,
|
|
error: null,
|
|
});
|
|
}
|