chore: save snapshot before tag 0.3
This commit is contained in:
@@ -7,11 +7,14 @@ interface SidebarState {
|
||||
width: number;
|
||||
collapsedSections: Record<SidebarSectionId, boolean>;
|
||||
trashConfirm: boolean;
|
||||
viewMode: "section" | "filesystem";
|
||||
setOpen: (open: boolean) => void;
|
||||
setWidth: (width: number) => void;
|
||||
toggleSection: (section: SidebarSectionId) => void;
|
||||
setSectionCollapsed: (section: SidebarSectionId, collapsed: boolean) => void;
|
||||
setTrashConfirm: (value: boolean) => void;
|
||||
setViewMode: (mode: SidebarState["viewMode"]) => void;
|
||||
setCollapsedSections: (collapsed: Record<SidebarSectionId, boolean>) => void;
|
||||
}
|
||||
|
||||
const sectionDefaults: Record<SidebarSectionId, boolean> = {
|
||||
@@ -29,6 +32,7 @@ export const useSidebarStore = create<SidebarState>()(
|
||||
width: 280,
|
||||
collapsedSections: { ...sectionDefaults },
|
||||
trashConfirm: true,
|
||||
viewMode: "section",
|
||||
setOpen: (open) => set({ open }),
|
||||
setWidth: (width) => set({ width }),
|
||||
toggleSection: (section) =>
|
||||
@@ -46,6 +50,8 @@ export const useSidebarStore = create<SidebarState>()(
|
||||
},
|
||||
})),
|
||||
setTrashConfirm: (value) => set({ trashConfirm: value }),
|
||||
setViewMode: (mode) => set({ viewMode: mode }),
|
||||
setCollapsedSections: (collapsed) => set({ collapsedSections: collapsed }),
|
||||
}),
|
||||
{
|
||||
name: "sidebar-ui",
|
||||
@@ -53,6 +59,7 @@ export const useSidebarStore = create<SidebarState>()(
|
||||
width: state.width,
|
||||
collapsedSections: state.collapsedSections,
|
||||
trashConfirm: state.trashConfirm,
|
||||
viewMode: state.viewMode,
|
||||
}),
|
||||
},
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user