From ee52e16a75d4371b8511c5b2a40f9ecddee0261c Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Fri, 9 Jan 2026 19:15:57 +0200 Subject: [PATCH] feat(tree): add title for subnote count badge --- apps/client/src/translations/en/translation.json | 3 ++- apps/client/src/widgets/note_tree.ts | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.json index 457f01eb6..33e69ba0f 100644 --- a/apps/client/src/translations/en/translation.json +++ b/apps/client/src/translations/en/translation.json @@ -1772,7 +1772,8 @@ "clone-indicator-tooltip": "This note has {{- count}} parents: {{- parents}}", "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}}" + "shared-indicator-tooltip-with-url": "This note is shared publicly at: {{- url}}", + "subtree-hidden-tooltip": "{{count}} child notes that are hidden from the tree" }, "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 29ddd1070..470f19dd0 100644 --- a/apps/client/src/widgets/note_tree.ts +++ b/apps/client/src/widgets/note_tree.ts @@ -1891,8 +1891,10 @@ function buildEnhanceTitle() { } // Add a badge with the number of items if it hides children. - if (isSubtreeHidden) { - const $badge = $(`${note.getChildNoteIds().length}`); + const count = note.getChildNoteIds().length; + if (isSubtreeHidden && count > 0) { + const $badge = $(`${count}`); + $badge.attr("title", t("note_tree.subtree-hidden-tooltip", { count })); $span.find(".fancytree-title").append($badge); } };