From db57f3ff62cbfcde7b5f8bacb85d8132eeae9f1a Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 10 Jan 2026 09:53:23 +0200 Subject: [PATCH] feat(tree): add tooltip when moving into hidden subtree --- apps/client/src/translations/en/translation.json | 6 +++++- apps/client/src/widgets/note_tree.ts | 13 +++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.json index 33e69ba0f..54c10275b 100644 --- a/apps/client/src/translations/en/translation.json +++ b/apps/client/src/translations/en/translation.json @@ -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" diff --git a/apps/client/src/widgets/note_tree.ts b/apps/client/src/widgets/note_tree.ts index a61c454b2..f1ca96569 100644 --- a/apps/client/src/widgets/note_tree.ts +++ b/apps/client/src/widgets/note_tree.ts @@ -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}'`);