Skip to content

Build your personal knowledge base with Trilium Notes

_hidden note does not inherit attributes from root, fixes #3537

zadam2fa1d812f63d
diff --git a/src/becca/entities/bnote.js b/src/becca/entities/bnote.js
index f1d0fe3433..71e351f38d 100644
--- a/src/becca/entities/bnote.js
+++ b/src/becca/entities/bnote.js
@@ -401,7 +401,8 @@ class BNote extends AbstractBeccaEntity {
const parentAttributes = this.ownedAttributes.slice();
const newPath = [...path, this.noteId];
- if (this.noteId !== 'root') {
+ // inheritable attrs on root are typically not intended to be applied to hidden subtree #3537
+ if (this.noteId !== 'root' && this.noteId !== '_hidden') {
for (const parentNote of this.parents) {
parentAttributes.push(...parentNote.__getInheritableAttributes(newPath));
}
@@ -852,7 +853,8 @@ class BNote extends AbstractBeccaEntity {
const set = new Set();
function inner(note) {
- if (set.has(note)) {
+ // _hidden is not counted as subtree for the purpose of inheritance
+ if (set.has(note) || note.noteId === '_hidden') {
return;
}
diff --git a/src/public/app/entities/fnote.js b/src/public/app/entities/fnote.js
index 3e0da6cdb9..fa08995f26 100644
--- a/src/public/app/entities/fnote.js
+++ b/src/public/app/entities/fnote.js
@@ -250,7 +250,8 @@ class FNote {
const newPath = [...path, this.noteId];
const attrArrs = [ this.getOwnedAttributes() ];
- if (this.noteId !== 'root') {
+ // inheritable attrs on root are typically not intended to be applied to hidden subtree #3537
+ if (this.noteId !== 'root' && this.noteId !== '_hidden') {
for (const parentNote of this.getParentNotes()) {
// these virtual parent-child relationships are also loaded into froca
if (parentNote.type !== 'search') {