Skip to content

Build your personal knowledge base with Trilium Notes

fix(ribbon): wrong default view type in search

Elian Doranb224267e3b7d
diff --git a/apps/client/src/widgets/ribbon/CollectionPropertiesTab.tsx b/apps/client/src/widgets/ribbon/CollectionPropertiesTab.tsx
index 4554054d67..9d8113b3c1 100644
--- a/apps/client/src/widgets/ribbon/CollectionPropertiesTab.tsx
+++ b/apps/client/src/widgets/ribbon/CollectionPropertiesTab.tsx
@@ -25,7 +25,8 @@ const VIEW_TYPE_MAPPINGS: Record<ViewTypeOptions, string> = {
export default function CollectionPropertiesTab({ note }: TabContext) {
const [ viewType, setViewType ] = useNoteLabel(note, "viewType");
- const viewTypeWithDefault = (viewType ?? "grid") as ViewTypeOptions;
+ const defaultViewType = (note?.type === "search" ? "list" : "grid");
+ const viewTypeWithDefault = (viewType ?? defaultViewType) as ViewTypeOptions;
const properties = bookPropertiesConfig[viewTypeWithDefault].properties;
return (