diff --git a/apps/client/src/stylesheets/style.css b/apps/client/src/stylesheets/style.css index cb286317d..b7c056248 100644 --- a/apps/client/src/stylesheets/style.css +++ b/apps/client/src/stylesheets/style.css @@ -2474,6 +2474,11 @@ footer.webview-footer button { inset-inline-start: 10px; } +.content-floating-buttons.top-right { + top: 10px; + inset-inline-end: 10px; +} + .content-floating-buttons.bottom-left { bottom: 10px; inset-inline-start: 10px; diff --git a/apps/client/src/widgets/FloatingButtonsDefinitions.tsx b/apps/client/src/widgets/FloatingButtonsDefinitions.tsx index bd7372d66..72cd37f5d 100644 --- a/apps/client/src/widgets/FloatingButtonsDefinitions.tsx +++ b/apps/client/src/widgets/FloatingButtonsDefinitions.tsx @@ -213,7 +213,7 @@ export function buildSaveSqlToNoteHandler(note: FNote) { } function RelationMapButtons({ note, isDefaultViewMode, triggerEvent }: FloatingButtonContext) { - const isEnabled = (note.type === "relationMap" && isDefaultViewMode); + const isEnabled = (!isNewLayout && note.type === "relationMap" && isDefaultViewMode); return isEnabled && ( <> (); const containerRef = useRef(null); const mapApiRef = useRef(null); @@ -119,9 +125,9 @@ export default function RelationMap({ note, noteContext, ntxId }: TypeWidgetProp options: { maxZoom: 2, minZoom: 0.3, - smoothScroll: false, + smoothScroll: false, //@ts-expect-error Upstream incorrectly mentions no arguments. - filterKey: function (e: KeyboardEvent) { + filterKey (e: KeyboardEvent) { // if ALT is pressed, then panzoom should bubble the event up // this is to preserve ALT-LEFT, ALT-RIGHT navigation working return e.altKey; @@ -156,6 +162,34 @@ export default function RelationMap({ note, noteContext, ntxId }: TypeWidgetProp ))} + + {isNewLayout && ( +
+ parentComponent?.triggerEvent("relationMapResetZoomIn", { ntxId })} + className="tn-tool-button" + noIconActionClass + /> + + parentComponent?.triggerEvent("relationMapResetZoomOut", { ntxId })} + className="tn-tool-button" + noIconActionClass + /> + + parentComponent?.triggerEvent("relationMapResetPanZoom", { ntxId })} + className="tn-tool-button" + noIconActionClass + /> +
+ )} ); } @@ -380,7 +414,7 @@ function useRelationCreation({ mapApiRef, jsPlumbApiRef }: { mapApiRef: RefObjec // if there's no event, then this has been triggered programmatically if (!originalEvent || !mapApiRef.current) return; - let name = await dialog.prompt({ + const name = await dialog.prompt({ message: t("relation_map.specify_new_relation_name"), shown: ({ $answer }) => { if (!$answer) {