feat: enhance AI image generation and prompt handling in canvas components
- Introduced shimmer animation for loading states in AI image nodes. - Updated prompt node to handle image generation with improved error handling and user feedback. - Refactored AI image node to manage generation status and display loading indicators. - Enhanced data handling in canvas components to include canvasId for better context management. - Improved status message handling in Convex mutations for clearer user feedback.
This commit is contained in:
@@ -270,7 +270,15 @@ export const updateStatus = mutation({
|
||||
if (!node) throw new Error("Node not found");
|
||||
|
||||
await getCanvasOrThrow(ctx, node.canvasId, user.userId);
|
||||
await ctx.db.patch(nodeId, { status, statusMessage });
|
||||
const patch: { status: typeof status; statusMessage?: string } = {
|
||||
status,
|
||||
};
|
||||
if (statusMessage !== undefined) {
|
||||
patch.statusMessage = statusMessage;
|
||||
} else if (status === "done" || status === "executing" || status === "idle") {
|
||||
patch.statusMessage = undefined;
|
||||
}
|
||||
await ctx.db.patch(nodeId, patch);
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user