feat(tree): add tooltip when moving into hidden subtree

This commit is contained in:
Elian Doran 2026-01-10 09:53:23 +02:00
parent 0f77caad69
commit db57f3ff62
No known key found for this signature in database
2 changed files with 18 additions and 1 deletions

View File

@ -1773,7 +1773,11 @@
"clone-indicator-tooltip-single": "This note is cloned (1 additional parent: {{- parent}})",
"shared-indicator-tooltip": "This note is shared publicly",
"shared-indicator-tooltip-with-url": "This note is shared publicly at: {{- url}}",
"subtree-hidden-tooltip": "{{count}} child notes that are hidden from the tree"
"subtree-hidden-tooltip": "{{count}} child notes that are hidden from the tree",
"subtree-hidden-moved-title_one": "{{count}} note moved to {{title}}",
"subtree-hidden-moved-title_other": "{{count}} notes moved to {{title}}",
"subtree-hidden-moved-description-collection": "Items in this collection are managed by its views.",
"subtree-hidden-moved-description-other": "Items in this note are intentionally hidden."
},
"title_bar_buttons": {
"window-on-top": "Keep Window on Top"

View File

@ -555,6 +555,19 @@ export default class NoteTreeWidget extends NoteContextAwareWidget {
} else if (data.hitMode === "after") {
branchService.moveAfterBranch(selectedBranchIds, node.data.branchId);
} else if (data.hitMode === "over") {
const targetNote = froca.getNoteFromCache(node.data.noteId);
if (targetNote?.hasLabel("subtreeHidden")) {
toastService.showPersistent({
id: `subtree-hidden-moved`,
title: t("note_tree.subtree-hidden-moved-title", { count: selectedBranchIds.length, title: targetNote.title }),
message: targetNote.type === "book"
? t("note_tree.subtree-hidden-moved-description-collection")
: t("note_tree.subtree-hidden-moved-description-other"),
icon: "bx bx-hide",
timeout: 5_000,
});
}
branchService.moveToParentNote(selectedBranchIds, node.data.branchId);
} else {
throw new Error(`Unknown hitMode '${data.hitMode}'`);