mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-03 21:03:08 +00:00
Merge remote-tracking branch 'origin/main' into feat/extend-models-support
This commit is contained in:
@@ -236,6 +236,7 @@ export interface AppActions {
|
||||
reorderProjects: (oldIndex: number, newIndex: number) => void;
|
||||
cyclePrevProject: () => void; // Cycle back through project history (Q)
|
||||
cycleNextProject: () => void; // Cycle forward through project history (E)
|
||||
clearProjectHistory: () => void; // Clear history, keeping only current project
|
||||
|
||||
// View actions
|
||||
setCurrentView: (view: ViewMode) => void;
|
||||
@@ -569,6 +570,23 @@ export const useAppStore = create<AppState & AppActions>()(
|
||||
}
|
||||
},
|
||||
|
||||
clearProjectHistory: () => {
|
||||
const currentProject = get().currentProject;
|
||||
if (currentProject) {
|
||||
// Keep only the current project in history
|
||||
set({
|
||||
projectHistory: [currentProject.id],
|
||||
projectHistoryIndex: 0,
|
||||
});
|
||||
} else {
|
||||
// No current project, clear everything
|
||||
set({
|
||||
projectHistory: [],
|
||||
projectHistoryIndex: -1,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// View actions
|
||||
setCurrentView: (view) => set({ currentView: view }),
|
||||
toggleSidebar: () => set({ sidebarOpen: !get().sidebarOpen }),
|
||||
|
||||
Reference in New Issue
Block a user