Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
fix(layout): title area gets wrong note context
Elian Doran8c793bf0fe15
diff --git a/apps/client/src/layouts/desktop_layout.tsx b/apps/client/src/layouts/desktop_layout.tsxindex 06e02f0583..b443bd27d3 100644--- a/apps/client/src/layouts/desktop_layout.tsx+++ b/apps/client/src/layouts/desktop_layout.tsx@@ -79,19 +79,6 @@ export default class DesktopLayout {const customTitleBarButtons = !hasNativeTitleBar && !isMac && !isWindows;const isNewLayout = isExperimentalFeatureEnabled("new-layout");- const titleRow = new FlexContainer("row")- .class("title-row")- .cssBlock(".title-row > * { margin: 5px; }")- .child(<NoteIconWidget />)- .child(<NoteTitleWidget />)- .optChild(isNewLayout, <NoteBadges />)- .child(<SpacerWidget baseSize={0} growthFactor={1} />)- .optChild(!isNewLayout, <MovePaneButton direction="left" />)- .optChild(!isNewLayout, <MovePaneButton direction="right" />)- .optChild(!isNewLayout, <ClosePaneButton />)- .optChild(!isNewLayout, <CreatePaneButton />)- .optChild(isNewLayout, <NoteActions />);-const rootContainer = new RootContainer(true).setParent(appContext).class(`${launcherPaneIsHorizontal ? "horizontal" : "vertical" }-layout`)@@ -144,7 +131,18 @@ export default class DesktopLayout {.child(new SplitNoteContainer(() =>new NoteWrapperWidget()- .child(titleRow)+ .child(new FlexContainer("row")+ .class("title-row")+ .cssBlock(".title-row > * { margin: 5px; }")+ .child(<NoteIconWidget />)+ .child(<NoteTitleWidget />)+ .optChild(isNewLayout, <NoteBadges />)+ .child(<SpacerWidget baseSize={0} growthFactor={1} />)+ .optChild(!isNewLayout, <MovePaneButton direction="left" />)+ .optChild(!isNewLayout, <MovePaneButton direction="right" />)+ .optChild(!isNewLayout, <ClosePaneButton />)+ .optChild(!isNewLayout, <CreatePaneButton />)+ .optChild(isNewLayout, <NoteActions />)).optChild(!isNewLayout, <Ribbon><NoteActions /></Ribbon>).optChild(isNewLayout, <Ribbon />).child(new WatchedFileUpdateStatusWidget())diff --git a/apps/client/src/widgets/ribbon/RibbonDefinition.ts b/apps/client/src/widgets/ribbon/RibbonDefinition.tsindex 4960c31c95..a525718fe7 100644--- a/apps/client/src/widgets/ribbon/RibbonDefinition.ts+++ b/apps/client/src/widgets/ribbon/RibbonDefinition.ts@@ -74,7 +74,7 @@ export const RIBBON_TAB_DEFINITIONS: TabConfiguration[] = [title: t("file_properties.title"),icon: "bx bx-file",content: FilePropertiesTab,- show: ({ note }) => note?.type === "file",+ show: ({ note }) => !isNewLayout && note?.type === "file",toggleCommand: "toggleRibbonTabFileProperties",activate: ({ note }) => note?.mime !== "application/pdf"},