Implement multi-branch prefix editing functionality

- Add setPrefixBatch API endpoint to handle batch prefix updates
- Update branch_prefix dialog to support multiple branches
- Remove noSelectedNotes constraint from edit branch prefix menu
- Add translations for multi-branch prefix editing

Co-authored-by: eliandoran <21236836+eliandoran@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-11-02 21:52:02 +00:00
parent 4c5b2a7c75
commit 4fc434a52e
92 changed files with 663 additions and 25 deletions

View File

@@ -270,6 +270,29 @@ function setPrefix(req: Request) {
branch.save();
}
function setPrefixBatch(req: Request) {
const { branchIds, prefix } = req.body;
if (!Array.isArray(branchIds)) {
throw new ValidationError("branchIds must be an array");
}
const normalizedPrefix = utils.isEmptyOrWhitespace(prefix) ? null : prefix;
for (const branchId of branchIds) {
const branch = becca.getBranch(branchId);
if (branch) {
branch.prefix = normalizedPrefix;
branch.save();
}
}
return {
success: true,
count: branchIds.length
};
}
export default {
moveBranchToParent,
moveBranchBeforeNote,
@@ -277,5 +300,6 @@ export default {
setExpanded,
setExpandedForSubtree,
deleteBranch,
setPrefix
setPrefix,
setPrefixBatch
};