feat(branches): add bulk delete for branch folders
Add a context-menu action to delete all branches in a folder at once. Top-level remote folders are protected and the currently checked-out branch is preserved. The BranchPanel API now includes folder depth to prevent accidental bulk-deletes and summarizes individual failures after processing. UI polish and localization were applied, and the package/version metadata, changelog, and help overlay were updated for the 2026.8.4 release. - Bulk delete with top-level remote protection and failure summaries. - BranchPanel now tracks folder depth and disables unsafe context menus. - Version bump, changelog/help overlay updates, and UI/localization tweaks.
This commit is contained in:
@@ -59,7 +59,7 @@
|
||||
onRenameBranch: (branch: GitBranchInfo) => void | Promise<void>;
|
||||
onDeleteBranch: (branch: GitBranchInfo) => void | Promise<void>;
|
||||
onDeleteRemoteBranch: (branch: GitBranchInfo) => void | Promise<void>;
|
||||
onDeleteBranchFolder: (folderName: string, branches: GitBranchInfo[]) => void | Promise<void>;
|
||||
onDeleteBranchFolder: (folderName: string, branches: GitBranchInfo[], depth: number) => void | Promise<void>;
|
||||
onCreateTag: (name: string, message: string) => void | Promise<void>;
|
||||
onDeleteTag: (tag: GitTag) => void | Promise<void>;
|
||||
onPushTag: (tag: GitTag) => void | Promise<void>;
|
||||
@@ -283,7 +283,7 @@
|
||||
async function openFolderContextMenu(event: MouseEvent, folder: BranchFolderRow) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
if (isBusy) return;
|
||||
if (isBusy || (folder.depth === 0 && folder.branches.every((branch) => branch.remote))) return;
|
||||
|
||||
contextFolder = folder;
|
||||
contextMenuX = event.clientX + 2;
|
||||
@@ -324,9 +324,9 @@
|
||||
|
||||
async function deleteContextFolder() {
|
||||
const folder = contextFolder;
|
||||
if (!folder || isBusy) return;
|
||||
if (!folder || isBusy || (folder.depth === 0 && folder.branches.every((branch) => branch.remote))) return;
|
||||
closeBranchContextMenu();
|
||||
await onDeleteBranchFolder(folder.name, folder.branches);
|
||||
await onDeleteBranchFolder(folder.name, folder.branches, folder.depth);
|
||||
}
|
||||
|
||||
async function createContextWorktree() {
|
||||
@@ -584,7 +584,7 @@
|
||||
style={`--branch-indent: ${row.depth * 16}px;`}
|
||||
type="button"
|
||||
onclick={() => toggleBranchFolder(row.id)}
|
||||
oncontextmenu={(event) => openFolderContextMenu(event, row)}
|
||||
oncontextmenu={row.depth > 0 ? (event) => openFolderContextMenu(event, row) : undefined}
|
||||
aria-expanded={isBranchFolderOpen(row.id)}
|
||||
title={`${row.name} (${row.branchCount})`}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user