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); } };