Fix: archived session bulk delete for VS Code extension (#1256)
* fix/archived sessiongroup bulk delete * Remove in line comment Signed-off-by: Jake <101855602+jjdubski@users.noreply.github.com> * small fix for lint * indentation fix, restore to original --------- Signed-off-by: Jake <101855602+jjdubski@users.noreply.github.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { ErrorBoundary } from '../ui/ErrorBoundary';
|
import { ErrorBoundary } from '../ui/ErrorBoundary';
|
||||||
import { SessionSidebar } from '@/components/session/SessionSidebar';
|
import { SessionSidebar } from '@/components/session/SessionSidebar';
|
||||||
|
import { SessionDialogs } from '@/components/session/SessionDialogs';
|
||||||
import { ChatView } from '@/components/views/ChatView';
|
import { ChatView } from '@/components/views/ChatView';
|
||||||
import { useSessionUIStore } from '@/sync/session-ui-store';
|
import { useSessionUIStore } from '@/sync/session-ui-store';
|
||||||
import { useViewportStore } from '@/sync/viewport-store';
|
import { useViewportStore } from '@/sync/viewport-store';
|
||||||
@@ -520,6 +521,7 @@ export const VSCodeLayout: React.FC = () => {
|
|||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
<SessionDialogs />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -442,11 +442,7 @@ export const SessionDialogs: React.FC = () => {
|
|||||||
deletedIds = result.archivedIds;
|
deletedIds = result.archivedIds;
|
||||||
failedIds = result.failedIds;
|
failedIds = result.failedIds;
|
||||||
} else {
|
} else {
|
||||||
const result = await deleteSessions(ids, {
|
const result = await deleteSessions(ids);
|
||||||
archiveWorktree: false,
|
|
||||||
deleteRemoteBranch: removeRemoteBranch,
|
|
||||||
deleteLocalBranch,
|
|
||||||
});
|
|
||||||
deletedIds = result.deletedIds;
|
deletedIds = result.deletedIds;
|
||||||
failedIds = result.failedIds;
|
failedIds = result.failedIds;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import type { WorktreeMetadata } from "@/types/worktree"
|
|||||||
import { opencodeClient } from "@/lib/opencode/client"
|
import { opencodeClient } from "@/lib/opencode/client"
|
||||||
import { useConfigStore } from "@/stores/useConfigStore"
|
import { useConfigStore } from "@/stores/useConfigStore"
|
||||||
import { useProjectsStore } from "@/stores/useProjectsStore"
|
import { useProjectsStore } from "@/stores/useProjectsStore"
|
||||||
|
import { useGlobalSessionsStore, resolveGlobalSessionDirectory } from "@/stores/useGlobalSessionsStore"
|
||||||
import { useDirectoryStore } from "@/stores/useDirectoryStore"
|
import { useDirectoryStore } from "@/stores/useDirectoryStore"
|
||||||
import { useSessionFoldersStore } from "@/stores/useSessionFoldersStore"
|
import { useSessionFoldersStore } from "@/stores/useSessionFoldersStore"
|
||||||
import { useCommandsStore } from "@/stores/useCommandsStore"
|
import { useCommandsStore } from "@/stores/useCommandsStore"
|
||||||
@@ -1111,8 +1112,12 @@ export const useSessionUIStore = create<SessionUIState>()((set, get) => ({
|
|||||||
if (attachmentDirectory) return attachmentDirectory
|
if (attachmentDirectory) return attachmentDirectory
|
||||||
const sessions = getAllSyncSessions()
|
const sessions = getAllSyncSessions()
|
||||||
const session = sessions.find((s) => s.id === sessionId)
|
const session = sessions.find((s) => s.id === sessionId)
|
||||||
if (!session) return null
|
if (session) return resolveDirectoryKey(session)
|
||||||
return resolveDirectoryKey(session)
|
const globalStore = useGlobalSessionsStore.getState()
|
||||||
|
const globalSession = [...globalStore.activeSessions, ...globalStore.archivedSessions]
|
||||||
|
.find((s) => s.id === sessionId)
|
||||||
|
if (globalSession) return resolveGlobalSessionDirectory(globalSession)
|
||||||
|
return null
|
||||||
},
|
},
|
||||||
|
|
||||||
getLastUserChoice: (sessionId) => {
|
getLastUserChoice: (sessionId) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user