From 054cb974f108e90ede7daeadb1f43a4b3191c488 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 31 Jan 2026 13:49:02 +0200 Subject: [PATCH] fix(collections): old layout floating toolbar interfering --- .../src/widgets/FloatingButtonsDefinitions.tsx | 18 +++--------------- .../src/widgets/collections/geomap/index.tsx | 14 +++++++++++++- .../src/widgets/ribbon/NoteActionsCustom.tsx | 4 ++-- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/apps/client/src/widgets/FloatingButtonsDefinitions.tsx b/apps/client/src/widgets/FloatingButtonsDefinitions.tsx index 4ad6c520a..be8a41c46 100644 --- a/apps/client/src/widgets/FloatingButtonsDefinitions.tsx +++ b/apps/client/src/widgets/FloatingButtonsDefinitions.tsx @@ -54,7 +54,6 @@ export const DESKTOP_FLOATING_BUTTONS: FloatingButtonsList = [ OpenTriliumApiDocsButton, SaveToNoteButton, RelationMapButtons, - GeoMapButtons, CopyImageReferenceButton, ExportImageButtons, InAppHelpButton, @@ -98,10 +97,10 @@ function SwitchSplitOrientationButton({ note, isReadOnly, isDefaultViewMode }: F />; } -function ToggleReadOnlyButton({ note, viewType, isDefaultViewMode }: FloatingButtonContext) { +function ToggleReadOnlyButton({ note, isDefaultViewMode }: FloatingButtonContext) { const [ isReadOnly, setReadOnly ] = useNoteLabelBoolean(note, "readOnly"); const isSavedSqlite = note.isTriliumSqlite() && !note.isHiddenCompletely(); - const isEnabled = ([ "mermaid", "mindMap", "canvas" ].includes(note.type) || viewType === "geoMap" || isSavedSqlite) + const isEnabled = ([ "mermaid", "mindMap", "canvas" ].includes(note.type) || isSavedSqlite) && note.isContentAvailable() && isDefaultViewMode; return isEnabled && triggerEvent("geoMapCreateChildNote")} - /> - ); -} - function CopyImageReferenceButton({ note, isDefaultViewMode }: FloatingButtonContext) { const hiddenImageCopyRef = useRef(null); const isEnabled = ( @@ -305,7 +293,7 @@ function ExportImageButtons({ note, triggerEvent, isDefaultViewMode }: FloatingB function InAppHelpButton({ note }: FloatingButtonContext) { const helpUrl = getHelpUrlForNote(note); - const isEnabled = !!helpUrl; + const isEnabled = note.type !== "book" && !!helpUrl; return isEnabled && ( + setReadOnly(!isReadOnly)} + />; +} + function NoteWrapper({ note, isReadOnly }: { note: FNote, isReadOnly: boolean }) { const mime = useNoteProperty(note, "mime"); const [ location ] = useNoteLabel(note, LOCATION_ATTRIBUTE); diff --git a/apps/client/src/widgets/ribbon/NoteActionsCustom.tsx b/apps/client/src/widgets/ribbon/NoteActionsCustom.tsx index c371b4a83..edaf043bf 100644 --- a/apps/client/src/widgets/ribbon/NoteActionsCustom.tsx +++ b/apps/client/src/widgets/ribbon/NoteActionsCustom.tsx @@ -182,10 +182,10 @@ function SwitchSplitOrientationButton({ note, isReadOnly, isDefaultViewMode }: N />; } -function ToggleReadOnlyButton({ note, viewType, isDefaultViewMode }: NoteActionsCustomInnerProps) { +export function ToggleReadOnlyButton({ note, isDefaultViewMode }: NoteActionsCustomInnerProps) { const [ isReadOnly, setReadOnly ] = useNoteLabelBoolean(note, "readOnly"); const isSavedSqlite = note.isTriliumSqlite() && !note.isHiddenCompletely(); - const isEnabled = ([ "mermaid", "mindMap", "canvas" ].includes(note.type) || viewType === "geoMap" || isSavedSqlite) + const isEnabled = ([ "mermaid", "mindMap", "canvas" ].includes(note.type) || isSavedSqlite) && note.isContentAvailable() && isDefaultViewMode; return isEnabled &&