feat(tree): add title for subnote count badge

This commit is contained in:
Elian Doran 2026-01-09 19:15:57 +02:00
parent 0c27bd25fa
commit ee52e16a75
No known key found for this signature in database
2 changed files with 6 additions and 3 deletions

View File

@ -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"

View File

@ -1891,8 +1891,10 @@ function buildEnhanceTitle() {
}
// Add a badge with the number of items if it hides children.
if (isSubtreeHidden) {
const $badge = $(`<span class="note-indicator-icon subtree-hidden-badge">${note.getChildNoteIds().length}</span>`);
const count = note.getChildNoteIds().length;
if (isSubtreeHidden && count > 0) {
const $badge = $(`<span class="note-indicator-icon subtree-hidden-badge">${count}</span>`);
$badge.attr("title", t("note_tree.subtree-hidden-tooltip", { count }));
$span.find(".fancytree-title").append($badge);
}
};