mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-03-19 22:53:08 +00:00
Fix deleting worktree crash and improve UX (#798)
* Changes from fix/deleting-worktree * fix: Improve worktree deletion safety and branch cleanup logic * fix: Improve error handling and async operations across auto-mode and worktree services * Update apps/server/src/routes/auto-mode/routes/analyze-project.ts Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
@@ -878,6 +878,13 @@ export const useAppStore = create<AppState & AppActions>()((set, get) => ({
|
||||
set((state) => ({
|
||||
features: state.features.map((f) => (f.id === id ? { ...f, ...updates } : f)),
|
||||
})),
|
||||
batchUpdateFeatures: (ids, updates) => {
|
||||
if (ids.length === 0) return;
|
||||
const idSet = new Set(ids);
|
||||
set((state) => ({
|
||||
features: state.features.map((f) => (idSet.has(f.id) ? { ...f, ...updates } : f)),
|
||||
}));
|
||||
},
|
||||
addFeature: (feature) => {
|
||||
const id = feature.id ?? `feature-${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
||||
const newFeature = { ...feature, id } as Feature;
|
||||
|
||||
@@ -440,6 +440,8 @@ export interface AppActions {
|
||||
// Feature actions
|
||||
setFeatures: (features: Feature[]) => void;
|
||||
updateFeature: (id: string, updates: Partial<Feature>) => void;
|
||||
/** Apply the same updates to multiple features in a single store mutation. */
|
||||
batchUpdateFeatures: (ids: string[], updates: Partial<Feature>) => void;
|
||||
addFeature: (feature: Omit<Feature, 'id'> & Partial<Pick<Feature, 'id'>>) => Feature;
|
||||
removeFeature: (id: string) => void;
|
||||
moveFeature: (id: string, newStatus: Feature['status']) => void;
|
||||
|
||||
Reference in New Issue
Block a user