From 2c103595583929a74ae795be1ad06f93be419cbc Mon Sep 17 00:00:00 2001 From: suharshit singh Date: Tue, 15 Sep 2026 21:37:49 +0530 Subject: [PATCH] feat(loading): added darftly loader to canvas connection and loading state for saving and deleteing project --- components/editor/canvas-wrapper.tsx | 7 +-- components/editor/project-dialogs.tsx | 34 ++++++++++++-- context/progress-tracker.md | 13 ++++++ context/ui-context.md | 2 +- hooks/use-project-actions.ts | 64 ++++++++++++++++----------- 5 files changed, 87 insertions(+), 33 deletions(-) diff --git a/components/editor/canvas-wrapper.tsx b/components/editor/canvas-wrapper.tsx index 66debc4..442c256 100644 --- a/components/editor/canvas-wrapper.tsx +++ b/components/editor/canvas-wrapper.tsx @@ -4,6 +4,7 @@ import { Component, type ReactNode } from "react"; import { LiveblocksProvider, RoomProvider, ClientSideSuspense } from "@liveblocks/react/suspense"; import { CanvasFlow } from "@/components/editor/canvas-flow"; +import { DraftlyLoader } from "@/components/ui/marketing/draftly-loader"; import type { CanvasSaveStatus } from "@/hooks/use-canvas-autosave"; // --------------------------------------------------------------------------- @@ -85,9 +86,9 @@ export function CanvasWrapper({ -

Connecting to canvas…

- + // Fixed over the whole editor: the navbar and AI sidebar render outside this boundary. + // z-45 sits above the sidebars (z-20/z-40) and below dialogs (z-50). + } > Promise; } +/** Button label that swaps to a spinner and progress text while the action runs. */ +function ActionLabel({ isLoading, idle, busy }: { isLoading: boolean; idle: string; busy: string }) { + if (!isLoading) { + return idle; + } + + return ( + <> +