feat: add auto-create worktree setting and related UI components

This commit is contained in:
Bohdan Triapitsyn
2026-01-07 23:37:32 +02:00
parent b6646b6b3e
commit c7700d5384
11 changed files with 144 additions and 14 deletions
@@ -698,6 +698,18 @@ export const SessionSidebar: React.FC<SessionSidebarProps> = ({
const handleDeleteSession = React.useCallback(
async (session: Session) => {
const descendants = collectDescendants(session.id);
// Check if this is a worktree session - if so, show confirmation dialog
const worktree = worktreeMetadata.get(session.id);
if (worktree) {
sessionEvents.requestDelete({
sessions: [session, ...descendants],
mode: 'worktree',
worktree,
});
return;
}
if (descendants.length === 0) {
const success = await deleteSession(session.id);
@@ -718,7 +730,7 @@ export const SessionSidebar: React.FC<SessionSidebarProps> = ({
}
}
},
[collectDescendants, deleteSession, deleteSessions],
[collectDescendants, deleteSession, deleteSessions, worktreeMetadata],
);
const handleCreateSessionInGroup = React.useCallback(