feat(tree): hide add button if subtree is hidden

This commit is contained in:
Elian Doran 2026-01-09 16:59:55 +02:00
parent 92e6a29e70
commit b6a6e78d01
No known key found for this signature in database

View File

@ -1843,10 +1843,12 @@ function buildEnhanceTitle() {
}
// TODO: Deduplicate with server's notes.ts#getAndValidateParent
const isSubtreeHidden = note.hasLabel("subtreeHidden");
if (!["search", "launcher"].includes(note.type)
&& !note.isOptions()
&& !note.isLaunchBarConfig()
&& !note.noteId.startsWith("_help")
&& !isSubtreeHidden
) {
node.span.append(createChildTemplate.cloneNode());
}
@ -1889,7 +1891,7 @@ function buildEnhanceTitle() {
}
// Add a badge with the number of items if it hides children.
if (note.hasLabel("subtreeHidden")) {
if (isSubtreeHidden) {
const $badge = $(`<span class="note-indicator-icon subtree-hidden-badge">${note.getChildNoteIds().length}</span>`);
$span.find(".fancytree-title").append($badge);
}