feat(*): 创作平台 - 升级短剧分镜工作流并完善模型计费与界面状态

This commit is contained in:
ddCat
2026-08-29 13:19:01 +08:00
parent 4b75504f75
commit 0558cf4381
33 changed files with 2849 additions and 239 deletions

View File

@@ -1 +1,29 @@
export const WORKSPACE_SIDEBAR_STORAGE_KEY = "infinite-canvas:workspace-sidebar-collapsed";
type WorkspaceSidebarStorage = Pick<Storage, "getItem" | "setItem">;
function workspaceSidebarStorage(storage?: WorkspaceSidebarStorage) {
if (storage) return storage;
if (typeof window === "undefined") return undefined;
try {
return window.localStorage;
} catch {
return undefined;
}
}
export function readWorkspaceSidebarCollapsed(storage?: WorkspaceSidebarStorage) {
try {
return workspaceSidebarStorage(storage)?.getItem(WORKSPACE_SIDEBAR_STORAGE_KEY) === "1";
} catch {
return false;
}
}
export function writeWorkspaceSidebarCollapsed(collapsed: boolean, storage?: WorkspaceSidebarStorage) {
try {
workspaceSidebarStorage(storage)?.setItem(WORKSPACE_SIDEBAR_STORAGE_KEY, collapsed ? "1" : "0");
} catch {
// localStorage 不可用时保留当前内存状态,不能阻断侧栏交互。
}
}