feat(21-03): remove slide-out panels from root layout and clean UIStore
- Remove Item and Candidate SlideOutPanel instances from __root.tsx - Remove SlideOutPanel, ItemForm, CandidateForm imports from root - Remove panel state (panelMode, editingItemId, candidatePanelMode, editingCandidateId) from UIStore - Remove panel actions (openEditPanel, openAddPanel, closePanel, etc.) from UIStore - Preserve currentThreadId derivation for CandidateDeleteDialog - Update CollectionView empty state to use catalog search instead of add panel - Update ItemForm/CandidateForm with onClose prop replacing store panel close - Clean all dead panel references across src/client/
This commit is contained in:
@@ -1,25 +1,15 @@
|
||||
import { create } from "zustand";
|
||||
|
||||
interface UIState {
|
||||
// Item panel state
|
||||
panelMode: "closed" | "add" | "edit";
|
||||
editingItemId: number | null;
|
||||
// Item delete state
|
||||
confirmDeleteItemId: number | null;
|
||||
|
||||
openAddPanel: () => void;
|
||||
openEditPanel: (itemId: number) => void;
|
||||
closePanel: () => void;
|
||||
openConfirmDelete: (itemId: number) => void;
|
||||
closeConfirmDelete: () => void;
|
||||
|
||||
// Candidate panel state
|
||||
candidatePanelMode: "closed" | "add" | "edit";
|
||||
editingCandidateId: number | null;
|
||||
// Candidate delete state
|
||||
confirmDeleteCandidateId: number | null;
|
||||
|
||||
openCandidateAddPanel: () => void;
|
||||
openCandidateEditPanel: (id: number) => void;
|
||||
closeCandidatePanel: () => void;
|
||||
openConfirmDeleteCandidate: (id: number) => void;
|
||||
closeConfirmDeleteCandidate: () => void;
|
||||
|
||||
@@ -70,28 +60,15 @@ interface UIState {
|
||||
}
|
||||
|
||||
export const useUIStore = create<UIState>((set) => ({
|
||||
// Item panel
|
||||
panelMode: "closed",
|
||||
editingItemId: null,
|
||||
// Item delete
|
||||
confirmDeleteItemId: null,
|
||||
|
||||
openAddPanel: () => set({ panelMode: "add", editingItemId: null }),
|
||||
openEditPanel: (itemId) => set({ panelMode: "edit", editingItemId: itemId }),
|
||||
closePanel: () => set({ panelMode: "closed", editingItemId: null }),
|
||||
openConfirmDelete: (itemId) => set({ confirmDeleteItemId: itemId }),
|
||||
closeConfirmDelete: () => set({ confirmDeleteItemId: null }),
|
||||
|
||||
// Candidate panel
|
||||
candidatePanelMode: "closed",
|
||||
editingCandidateId: null,
|
||||
// Candidate delete
|
||||
confirmDeleteCandidateId: null,
|
||||
|
||||
openCandidateAddPanel: () =>
|
||||
set({ candidatePanelMode: "add", editingCandidateId: null }),
|
||||
openCandidateEditPanel: (id) =>
|
||||
set({ candidatePanelMode: "edit", editingCandidateId: id }),
|
||||
closeCandidatePanel: () =>
|
||||
set({ candidatePanelMode: "closed", editingCandidateId: null }),
|
||||
openConfirmDeleteCandidate: (id) => set({ confirmDeleteCandidateId: id }),
|
||||
closeConfirmDeleteCandidate: () => set({ confirmDeleteCandidateId: null }),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user