Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion app/src/components/compose/CanvasToolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ export function CanvasToolbar({
if (!selectedFigure) return;
const newDepth =
direction === 'up' ? selectedFigure.z_depth + 1 : Math.max(0, selectedFigure.z_depth - 1);
updateFigure.mutate({ id: selectedFigure.id, data: { z_depth: newDepth } });
updateFigure.mutate(
{ id: selectedFigure.id, data: { z_depth: newDepth } },
{ onError: (err) => toast.error(err.message) },
);
}

function downloadPanel(file: PanelFile, panelCount: number, dpi: number) {
Expand Down
10 changes: 8 additions & 2 deletions app/src/components/compose/CompositionCanvas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,20 @@

const handleDragEnd = useCallback(
(figureId: string, normX: number, normY: number) => {
updateFigure.mutate({ id: figureId, data: { position_x: normX, position_y: normY } });
updateFigure.mutate(
{ id: figureId, data: { position_x: normX, position_y: normY } },
{ onError: (err) => toast.error(err.message) },
);
},
[updateFigure],
);

const handleScaleChange = useCallback(
(figureId: string, scale: number) => {
updateFigure.mutate({ id: figureId, data: { scale } });
updateFigure.mutate(
{ id: figureId, data: { scale } },
{ onError: (err) => toast.error(err.message) },
);
},
[updateFigure],
);
Expand Down Expand Up @@ -148,7 +154,7 @@
onClick={() => setSelectedId(fig.id)}
>
<div className="w-10 h-10 rounded-lg overflow-hidden bg-white/[0.03] shrink-0">
<img src={url} alt={fig.label ?? 'Figure'} className="w-full h-full object-cover" />

Check warning on line 157 in app/src/components/compose/CompositionCanvas.tsx

View workflow job for this annotation

GitHub Actions / verify

Using `<img>` could result in slower LCP and higher bandwidth. Consider using `<Image />` from `next/image` or a custom image loader to automatically optimize images. This may incur additional usage or cost from your provider. See: https://nextjs.org/docs/messages/no-img-element
</div>
<span className="text-xs text-foreground/80 truncate">{fig.label ?? 'Unnamed'}</span>
</button>
Expand Down
Loading