Skip to content

Build your personal knowledge base with Trilium Notes

client/icon pack/preview: disable the inline title for icon packs

Adorian Dorane42538340e71
diff --git a/apps/client/src/widgets/layout/InlineTitle.tsx b/apps/client/src/widgets/layout/InlineTitle.tsx
index a04e8be4f7..806b9455eb 100644
--- a/apps/client/src/widgets/layout/InlineTitle.tsx
+++ b/apps/client/src/widgets/layout/InlineTitle.tsx
@@ -92,6 +92,9 @@ function shouldShow(note: FNote | null | undefined, type: NoteType | undefined,
if (note?.noteId?.startsWith("_options")) return false;
if (note?.isTriliumSqlite()) return false;
if (note?.isMarkdown()) return false;
+ // Icon packs render their own preview (like markdown) and the `file`-type ones already have no
+ // inline title, so opt the `code`-type ones out too for a consistent collapsed header.
+ if (note?.isIconPack()) return false;
return type && supportedNoteTypes.has(type);
}
diff --git a/apps/client/src/widgets/layout/NoteTypeSwitcher.tsx b/apps/client/src/widgets/layout/NoteTypeSwitcher.tsx
index 3298eec6a4..4830b57060 100644
--- a/apps/client/src/widgets/layout/NoteTypeSwitcher.tsx
+++ b/apps/client/src/widgets/layout/NoteTypeSwitcher.tsx
@@ -40,7 +40,7 @@ export default function NoteTypeSwitcher({ note }: { note?: FNote | null }) {
const currentNoteTypeData = useMemo(() => NOTE_TYPES.find(t => t.type === currentNoteType), [ currentNoteType ]);
const { builtinTemplates, collectionTemplates } = useBuiltinTemplates();
- return (currentNoteType && supportedNoteTypes.has(currentNoteType) && !note?.isTriliumSqlite() && !note?.isMarkdown() &&
+ return (currentNoteType && supportedNoteTypes.has(currentNoteType) && !note?.isTriliumSqlite() && !note?.isMarkdown() && !note?.isIconPack() &&
<div
className="note-type-switcher"
onWheel={onWheelHorizontalScroll}