diff --git a/apps/client/src/components/note_context.ts b/apps/client/src/components/note_context.ts index 3a8a54310..020817073 100644 --- a/apps/client/src/components/note_context.ts +++ b/apps/client/src/components/note_context.ts @@ -315,14 +315,38 @@ class NoteContext extends Component implements EventListener<"entitiesReloaded"> } hasNoteList() { - return ( - this.note && - ["default", "contextual-help"].includes(this.viewScope?.viewMode ?? "") && - (this.note.hasChildren() || this.note.getLabelValue("viewType") === "calendar") && - ["book", "text", "code"].includes(this.note.type) && - this.note.mime !== "text/x-sqlite;schema=trilium" && - !this.note.isLabelTruthy("hideChildrenOverview") - ); + const note = this.note; + + if (!note) { + return false; + } + + if (!["default", "contextual-help"].includes(this.viewScope?.viewMode ?? "")) { + return false; + } + + // Some book types must always display a note list, even if no children. + if (["calendar", "table"].includes(note.getLabelValue("viewType") ?? "")) { + return true; + } + + if (!note.hasChildren()) { + return false; + } + + if (!["book", "text", "code"].includes(note.type)) { + return false; + } + + if (note.mime === "text/x-sqlite;schema=trilium") { + return false; + } + + if (note.isLabelTruthy("hideChildrenOverview")) { + return false; + } + + return true; } async getTextEditor(callback?: GetTextEditorCallback) {