Goal
When AI logo generation finishes, go to the Logo Composer with an ID specific to the new logo. If saving to Firestore isn’t active, fall back to a client-side draft and still open the Composer.

Keep

IBrandBiz dashboard styling, brand colors (#00CB51 etc.), existing Preview modal.

Existing legacy route /brand-development/ai-logo-creator/logo-composer-:id.

Add/Ensure

Param route /brand-development/ai-logo-creator/logo-composer/:id loads the same Composer.

Generator success handler tries saveGeneratedLogo(result); if it returns null/throws, generate draft-<uuid> and stash result to sessionStorage as logoDraft:<draftId>.

Composer loader behavior:

If id starts with draft-, load from sessionStorage and normalize via normalizeGeneratedLogo.

Else try logo_templates/<id>.

Else try logos/<id> (if our generated logos collection is named differently, replace "logos").

Else show a 404 message (non-intrusive toast OK).

Emit analytics (optional):

logo.generate.success_navigate_composer with { logoId }

logo.generate.success_navigate_composer_draft with { draftId }

Micro-diffs (≤12 lines/file; ≤3 files)

client/src/pages/LogoGenerator.tsx — on success, navigate to Composer (save or draft)

--- a/client/src/pages/LogoGenerator.tsx
+++ b/client/src/pages/LogoGenerator.tsx
@@ -118,6 +118,16 @@ const LogoGenerator = () => {
   const onGenerateSuccess = async (result: GenerateResult) => {
-    // navigate("/brand-development/brand-kit");
+    let logoId: string | null = null;
+    try { logoId = await saveGeneratedLogo?.(result); } catch (e) { console.warn(e); }
+    if (!logoId) {
+      const draftId = `draft-${crypto?.randomUUID?.() || Date.now()}`;
+      sessionStorage.setItem(`logoDraft:${draftId}`, JSON.stringify(result));
+      analytics?.track?.("logo.generate.success_navigate_composer_draft", { draftId });
+      return navigate(`/brand-development/ai-logo-creator/logo-composer/${draftId}`);
+    }
+    analytics?.track?.("logo.generate.success_navigate_composer", { logoId });
+    navigate(`/brand-development/ai-logo-creator/logo-composer/${logoId}`);
   };


client/src/routes.tsx — ensure param route exists; keep legacy

--- a/client/src/routes.tsx
+++ b/client/src/routes.tsx
@@ -45,6 +45,10 @@ export const routes = [
   { path: "/brand-development/ai-logo-creator/logo-composer-:id", element: <LogoComposer /> },
+  { path: "/brand-development/ai-logo-creator/logo-composer/:id", element: <LogoComposer /> },
 ];


client/src/pages/LogoComposer/loader.ts — support drafts, then templates, then logos

--- a/client/src/pages/LogoComposer/loader.ts
+++ b/client/src/pages/LogoComposer/loader.ts
@@ -1,7 +1,19 @@
 export async function loadLogoComposerData(id: string) {
-  const doc = await getDocById("logo_templates", id);
-  if (!doc) throw new Error("Template not found");
-  return normalizeTemplate(doc);
+  if (id.startsWith("draft-")) {
+    const raw = sessionStorage.getItem(`logoDraft:${id}`);
+    if (!raw) throw new Error(`[logo-composer] Draft not found: ${id}`);
+    return normalizeGeneratedLogo(JSON.parse(raw));
+  }
+  const tpl = await getDocById("logo_templates", id);
+  if (tpl) return normalizeTemplate(tpl);
+  const logo = await getDocById("logos", id); // change to "logo_designs" if that's our collection
+  if (logo) return normalizeGeneratedLogo(logo);
+  console.warn("[logo-composer] Not found:", id);
+  throw new Error(`[logo-composer] Not found: ${id}`);
 }


Notes / Adaptations:

If helper names differ (saveGeneratedLogo, getDocById, normalizeTemplate, normalizeGeneratedLogo, analytics.track), map them to existing utils.

If logos is actually logo_designs, change the string in one place.

Do not alter branding, dashboard layout, or add deps.

QA Checklist

Generate logo → navigates to /brand-development/ai-logo-creator/logo-composer/<logoId> when save works.

If save path is disabled → navigates to /logo-composer/draft-<uuid> and loads from sessionStorage.

Old links /logo-composer-<templateId> still load.

Visiting /logo-composer/<templateId> also works (auto-detect).

Refresh on a draft shows a friendly “draft missing” notice (optional toast OK).

Optional (nice-to-have, ≤12 lines, separate PR if needed)

Add a “Save to Brand Kit” button in Composer that:

Writes the draft payload to Firestore → returns logoId

Replaces history to /logo-composer/<logoId> (no hard reload)