feat: implement node deletion handling and geometry synchronization in canvas

- Added functionality to block node deletion based on synchronization status with Convex, providing user feedback through toast notifications.
- Introduced helper functions to determine reasons for blocking deletions, enhancing user experience during canvas interactions.
- Updated asset node styling to improve visual consistency and adjusted minimum dimensions for asset nodes to ensure better layout management.
This commit is contained in:
Matthias
2026-03-28 23:07:27 +01:00
parent acb5bca3b8
commit 2a645b9489
4 changed files with 165 additions and 18 deletions

View File

@@ -199,7 +199,7 @@ export default function AssetNode({ id, data, selected, width, height }: NodePro
<img
src={previewUrl}
alt={data.title ?? "FreePik-Vorschau"}
className={`h-full w-full object-cover object-right transition-opacity ${
className={`h-full w-full object-contain transition-opacity ${
isPreviewLoading ? "opacity-0" : "opacity-100"
}`}
draggable={false}

View File

@@ -16,7 +16,7 @@ const RESIZE_CONFIGS: Record<string, ResizeConfig> = {
frame: { minWidth: 200, minHeight: 150 },
group: { minWidth: 150, minHeight: 100 },
image: { minWidth: 140, minHeight: 120, keepAspectRatio: true },
asset: { minWidth: 140, minHeight: 208, keepAspectRatio: false },
asset: { minWidth: 200, minHeight: 240, keepAspectRatio: false },
video: { minWidth: 200, minHeight: 120, keepAspectRatio: true },
// Chrome 88 + min. Viewport 120 → äußere Mindesthöhe 208 (siehe canvas onNodesChange)
"ai-image": { minWidth: 200, minHeight: 208, keepAspectRatio: false },