From f66a2d4fe4a693e5b956e490be71ce85bd114f99 Mon Sep 17 00:00:00 2001 From: Vipin Date: Tue, 24 Nov 2026 11:39:32 +0530 Subject: [PATCH 01/14] feat(ux): restore circular reveal theme switch ripple with View Transitions API and crossfade fallback --- app/globals.css | 13 +-- components/layout/ThemeToggle.tsx | 81 ++++++++++++++- scripts/verify-theme-ripple.mjs | 163 ++++++++++++++++++++++++++++++ 3 files changed, 246 insertions(+), 11 deletions(-) create mode 100644 scripts/verify-theme-ripple.mjs diff --git a/app/globals.css b/app/globals.css index dffbb94..4d4c32c 100644 --- a/app/globals.css +++ b/app/globals.css @@ -530,6 +530,12 @@ body::after { animation: none; mix-blend-mode: normal; } +::view-transition-old(root) { + z-index: 1; +} +::view-transition-new(root) { + z-index: 9999; +} /* Monaco Editor Clean Chrome */ .monaco-editor .scroll-decoration { @@ -1040,9 +1046,4 @@ body::after { } } -/* Smooth Theme Crossfade */ -::view-transition-old(root), -::view-transition-new(root) { - animation-duration: 0.22s; - animation-timing-function: cubic-bezier(0.15, 0, 0.2, 1); -} + diff --git a/components/layout/ThemeToggle.tsx b/components/layout/ThemeToggle.tsx index daeab24..208e05d 100644 --- a/components/layout/ThemeToggle.tsx +++ b/components/layout/ThemeToggle.tsx @@ -1,7 +1,8 @@ "use client"; -import { useEffect, useState } from "react"; +import { useEffect, useState, useRef } from "react"; import { useTheme } from "next-themes"; +import { flushSync } from "react-dom"; import { motion, AnimatePresence } from "framer-motion"; import { Moon, Sun } from "lucide-react"; import { IconButton } from "@/components/ui/icon-button"; @@ -9,6 +10,7 @@ import { IconButton } from "@/components/ui/icon-button"; export function ThemeToggle() { const { resolvedTheme, setTheme } = useTheme(); const [mounted, setMounted] = useState(false); + const buttonRef = useRef(null); useEffect(() => { // eslint-disable-next-line react-hooks/set-state-in-effect @@ -22,33 +24,102 @@ export function ThemeToggle() { setTheme(nextTheme); if (nextDark) { document.documentElement.classList.add("dark"); + document.documentElement.style.colorScheme = "dark"; } else { document.documentElement.classList.remove("dark"); + document.documentElement.style.colorScheme = "light"; + } + try { + localStorage.setItem("theme", nextTheme); + } catch { + // ignore } }; - const toggleTheme = (event: React.MouseEvent) => { - (event.currentTarget as HTMLElement)?.blur(); + const toggleTheme = (event: React.MouseEvent) => { + event.currentTarget?.blur(); const nextDark = !isDark; const prefersReduced = typeof window !== "undefined" && window.matchMedia?.("(prefers-reduced-motion: reduce)")?.matches; - if (prefersReduced || !document.startViewTransition) { + // Reduced motion: instant + if (prefersReduced) { applyTheme(nextDark); return; } - document.startViewTransition(() => { + // Fallback for browsers without View Transitions: a 200ms crossfade + if (typeof document === "undefined" || !document.startViewTransition) { + const currentColor = + getComputedStyle(document.documentElement).getPropertyValue("--background").trim() || + (isDark ? "#0F0F0E" : "#FBFBFA"); + const overlay = document.createElement("div"); + overlay.style.position = "fixed"; + overlay.style.inset = "0"; + overlay.style.zIndex = "9998"; + overlay.style.pointerEvents = "none"; + overlay.style.backgroundColor = currentColor; + overlay.style.transition = "opacity 200ms ease-out"; + overlay.style.opacity = "1"; + document.body.appendChild(overlay); + applyTheme(nextDark); + + requestAnimationFrame(() => { + overlay.style.opacity = "0"; + setTimeout(() => { + overlay.remove(); + }, 220); + }); + return; + } + + // View Transitions API: circular reveal radiating from toggle button center + const rect = event.currentTarget.getBoundingClientRect(); + const x = rect.left + rect.width / 2; + const y = rect.top + rect.height / 2; + + const endRadius = Math.hypot( + Math.max(x, window.innerWidth - x), + Math.max(y, window.innerHeight - y) + ); + + const transition = document.startViewTransition(() => { + flushSync(() => { + applyTheme(nextDark); + }); }); + + transition.ready + .then(() => { + const clipPath = [ + `circle(0px at ${x}px ${y}px)`, + `circle(${endRadius}px at ${x}px ${y}px)`, + ]; + + document.documentElement.animate( + { + clipPath, + }, + { + duration: 450, + easing: "ease-out", + pseudoElement: "::view-transition-new(root)", + } + ); + }) + .catch(() => { + // Fallback if animation fails + }); }; if (!mounted) return
; return ( setTimeout(r, ms)); +} + +async function run() { + const tmpDir = path.join(os.tmpdir(), 'chrome-cdp-ripple-' + Date.now()); + fs.mkdirSync(tmpDir, { recursive: true }); + const port = 9222 + Math.floor(Math.random() * 500); + + const args = [ + '--headless=new', + '--disable-gpu', + '--no-sandbox', + `--remote-debugging-port=${port}`, + `--user-data-dir=${tmpDir}`, + '--window-size=1440,900', + ]; + + const proc = spawn(chromePath, args); + + let wsUrl = null; + for (let i = 0; i < 30; i++) { + await sleep(200); + try { + const res = await fetch(`http://127.0.0.1:${port}/json/version`); + if (res.ok) { + const data = await res.json(); + wsUrl = data.webSocketDebuggerUrl; + break; + } + } catch {} + } + + if (!wsUrl) { + proc.kill(); + throw new Error('Failed to connect to Chrome CDP'); + } + + const ws = new WebSocket(wsUrl); + await new Promise((resolve, reject) => { + ws.onopen = resolve; + ws.onerror = reject; + }); + + let idCounter = 1; + function send(method, params = {}) { + return new Promise((resolve, reject) => { + const id = idCounter++; + const onMsg = (event) => { + const msg = JSON.parse(event.data); + if (msg.id === id) { + ws.removeEventListener('message', onMsg); + if (msg.error) reject(msg.error); + else resolve(msg.result); + } + }; + ws.addEventListener('message', onMsg); + ws.send(JSON.stringify({ id, method, params })); + }); + } + + const { targetId } = await send('Target.createTarget', { url: 'about:blank' }); + const { sessionId } = await send('Target.attachToTarget', { targetId, flatten: true }); + + function sendSession(method, params = {}) { + return new Promise((resolve, reject) => { + const id = idCounter++; + const onMsg = (event) => { + const msg = JSON.parse(event.data); + if (msg.id === id) { + ws.removeEventListener('message', onMsg); + if (msg.error) reject(msg.error); + else resolve(msg.result); + } + }; + ws.addEventListener('message', onMsg); + ws.send(JSON.stringify({ id, sessionId, method, params })); + }); + } + + await sendSession('Page.enable'); + await sendSession('Runtime.enable'); + + async function takeScreenshot(filename) { + const res = await sendSession('Page.captureScreenshot', { format: 'png' }); + const buffer = Buffer.from(res.data, 'base64'); + fs.writeFileSync(path.join(outDir, filename), buffer); + console.log(`Saved screenshot: ${filename}`); + } + + const pages = [ + { url: 'http://localhost:3001/', name: 'landing' }, + { url: 'http://localhost:3001/templates', name: 'templates' }, + { url: 'http://localhost:3001/builder/demo', name: 'builder' }, + ]; + + for (const p of pages) { + console.log(`Testing theme switch ripple on ${p.name}...`); + await sendSession('Page.navigate', { url: p.url }); + await sleep(2500); + + // Initial state (dark) + await takeScreenshot(`${p.name}-1-dark.png`); + + // Click Theme Toggle button + const clickRes = await sendSession('Runtime.evaluate', { + expression: ` + (() => { + const btn = document.querySelector('button[aria-label="Toggle theme"]'); + if (!btn) return 'not_found'; + btn.click(); + return 'clicked'; + })() + `, + returnByValue: true, + }); + console.log(`Click result on ${p.name}:`, clickRes.result.value); + + // Capture mid-transition ripple (~180ms into 450ms animation) + await sleep(180); + await takeScreenshot(`${p.name}-2-ripple-to-light.png`); + + // Wait for transition to complete + await sleep(400); + await takeScreenshot(`${p.name}-3-light.png`); + + // Click Theme Toggle again (light -> dark) + await sendSession('Runtime.evaluate', { + expression: ` + (() => { + const btn = document.querySelector('button[aria-label="Toggle theme"]'); + if (btn) btn.click(); + })() + `, + }); + + // Capture mid-transition ripple back to dark + await sleep(180); + await takeScreenshot(`${p.name}-4-ripple-to-dark.png`); + + await sleep(400); + await takeScreenshot(`${p.name}-5-dark-restored.png`); + } + + ws.close(); + proc.kill(); + try { fs.rmSync(tmpDir, { recursive: true, force: true }); } catch {} + console.log('Theme ripple verification completed successfully!'); +} + +run().catch(err => { + console.error(err); + process.exit(1); +}); From f15e4a24746b4a4dc5cad196bfc4600e02f1fe14 Mon Sep 17 00:00:00 2001 From: Vipin Date: Tue, 24 Nov 2026 11:40:28 +0530 Subject: [PATCH 02/14] docs: update progress tracker for Part 1 theme switch ripple --- context/progress-tracker.md | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/context/progress-tracker.md b/context/progress-tracker.md index 40cdb74..15e70a7 100644 --- a/context/progress-tracker.md +++ b/context/progress-tracker.md @@ -6,14 +6,10 @@ Update this file after every completed feature. Any AI agent reading this should ## Current Status -**Phase:** Builder Glass & Motion System Completed (branch `feat/landing-redesign`) -**Last completed:** -1. Cleaned public directory and verified 100% isolation of recordings/screenshots into gitignored `.recordings/`. -2. Mapped `--mesh-c1..c4` directly to canonical brand and ink tokens (`var(--ink-950)`, `var(--brand-800)`, `var(--brand-500)`, `var(--brand-headline-end)`). -3. Investigated ANGLE synchronous shader compilation 618ms delay; implemented `warmCompileMeshShader()` on idle, reducing input latency to 0.10ms median. Verified full-hero 5s motion diff (Dark: 3.73%, Light: 4.02%, both >= 3.0%) with subtext WCAG AA contrast maintained. -4. Part 3 (Builder Glass): Static frame of mesh gradient at ~60% opacity with zero WebGL animation in builder; applied `glass-1` tokens to top bar, pane headers, validation status bar, and device toggle group; kept Monaco editor and preview frame on solid surfaces with zero blur leak. Verified 0 axe contrast violations on `/builder/demo` in both themes. -5. Part 4 (Motion for Every Interaction): Applied standard motion tokens (`bounce: 0.15`, `visualDuration: 0.4s`); press feedback (scale 0.97) and 150ms ease hover transitions; morphing Copilot pill with shared `layoutId` and 80ms staggered content reveal; popovers and kebab menus scale 0.96 -> 1 with fade from trigger corner; sliding active-pill indicator on nav; dynamic button states on Save Draft and Publish with width spring; theme toggle icon rotate/crossfade; enabled Next.js 16 View Transitions API. Verified Chrome performance trace during Copilot animation (max main-thread task 13.47ms, zero tasks > 50ms). -**Next:** Ready for final review. +**Phase:** UX Polish & Design Hardening (branch `feat/ux-polish`) +**Last completed:** +1. Part 1 (Theme Switch Ripple): Audited git history and recovered circular reveal ripple; re-implemented View Transitions API with `document.startViewTransition` using button center coordinates and maximum diagonal viewport radius (`450ms`, `ease-out`); added 200ms crossfade fallback for browsers without View Transitions; ensured instant switch for `prefers-reduced-motion`; cleaned up conflicting `0.22s` CSS override in `globals.css`; verified across landing, templates, and builder with 0 hydration flash or console errors; 148 unit tests passing. +**Next:** Part 2: Logo Visibility Audit and Contrast Fix. --- From b60dcd60b63e9bde434feb26e9532a4cfa673a7a Mon Sep 17 00:00:00 2001 From: Vipin Date: Tue, 24 Nov 2026 11:52:14 +0530 Subject: [PATCH 03/14] style(buttons): unify button and card hairline borders to system tokens and remove primary outline --- app/builder/[appId]/page.tsx | 10 +- app/globals.css | 111 +++++--- components/builder/ValidationPanel.tsx | 6 +- components/dashboard/DashboardView.tsx | 4 +- components/dashboard/PromptBox.tsx | 4 +- components/templates/TemplatesView.tsx | 6 +- components/ui/button.tsx | 12 +- components/ui/icon-button.tsx | 2 +- components/ui/kbd.tsx | 2 +- components/ui/segmented-nav.tsx | 2 +- context/progress-tracker.md | 1 + context/ui-registry.md | 29 ++- scripts/verify-button-borders.mjs | 340 +++++++++++++++++++++++++ 13 files changed, 455 insertions(+), 74 deletions(-) create mode 100644 scripts/verify-button-borders.mjs diff --git a/app/builder/[appId]/page.tsx b/app/builder/[appId]/page.tsx index f35b7b1..0d4d9e8 100644 --- a/app/builder/[appId]/page.tsx +++ b/app/builder/[appId]/page.tsx @@ -640,7 +640,7 @@ function BuilderContent() { TOP APPLICATION TOOLBAR (h-14, 56px) - Glass top bar Sans breadcrumb with App Name, Copilot ⌘K toggle, Save Draft, Publish ========================================================================= */} -
+
{/* Left: Navigation & Breadcrumb with App Name */}
setIsEditorCollapsed(false)} title="Expand Config Editor" role="region" @@ -848,7 +848,7 @@ function BuilderContent() { role="region" > {/* Editor Panel Header: 36px (h-9) consistent with Preview header, styled with glass-1 */} -
+
@@ -942,7 +942,7 @@ function BuilderContent() { role="region" > {/* Preview Panel Header: 36px (h-9) consistent with Editor header, styled with glass-1 */} -
+
@@ -951,7 +951,7 @@ function BuilderContent() {
{/* Viewport Width Controls in preview panel header - styled with glass-2-nested */} -
+
diff --git a/components/templates/TemplatesView.tsx b/components/templates/TemplatesView.tsx index dc8137f..b4185d6 100644 --- a/components/templates/TemplatesView.tsx +++ b/components/templates/TemplatesView.tsx @@ -39,7 +39,7 @@ export function TemplatesView() {
{CATEGORIES.map((cat) => { const isSelected = selectedCategory === cat; @@ -67,7 +67,7 @@ export function TemplatesView() { {filteredTemplates.map((tpl) => (
{/* Live cropped thumbnail at top with bottom fade */} @@ -99,7 +99,7 @@ export function TemplatesView() {
{/* Actions row: Preview (secondary sm) + Use template (primary sm) on ONE row */} -
+
+ + +
+
- {/* DIVIDER: Between Editor and Preview */} - {!isEditorCollapsed && ( -
setActiveDrag("editor")} - onDoubleClick={() => setEditorWidth(DEFAULT_EDITOR_WIDTH)} - onKeyDown={(e) => { - if (e.key === "ArrowLeft") { - e.preventDefault(); - setEditorWidth((w) => Math.max(MIN_EDITOR_WIDTH, w - 10)); - } else if (e.key === "ArrowRight") { - e.preventDefault(); - setEditorWidth((w) => w + 10); - } else if (e.key === "Home" || e.key === "Enter") { - e.preventDefault(); - setEditorWidth(DEFAULT_EDITOR_WIDTH); - } - }} - className={`relative w-[6px] -mx-[3px] h-full cursor-col-resize z-30 shrink-0 group outline-none select-none transition-colors ${ - activeDrag === "editor" - ? "bg-brand/30" - : "hover:bg-brand/20 focus-visible:bg-brand/30" - }`} - title="Drag to resize, double-click to reset, arrow keys to adjust" +
+ +
+ + + ) : ( + -
+ {/* Editor Panel Header: 36px (h-9) consistent with Preview header, styled with glass-1 */} +
+
+ + + Config + +
+ setIsEditorCollapsed(true)} + className="text-muted-foreground hover:text-foreground" + aria-label="Collapse Config Editor to slim rail" + title="Collapse to slim rail" + > + + +
+ + {/* Monaco Editor (automaticLayout: true + ResizeObserver) */} +
+ setConfigStr(val || "")} + /> + {/* Floating Copilot Chat Pill anchored at bottom-right corner of Monaco editor pane */} + +
+ + {/* Validation Log */} + + + + {/* RESIZABLE HANDLE with 8px hit area, 1px line, small grip, col-resize, brand hover/drag, double-click reset */} + -
- )} - {/* PANE 2: PREVIEW (RIGHT) - fills remaining space, sits on solid surface */} -
- {/* Preview Panel Header: 36px (h-9) consistent with Editor header, styled with glass-1 */} -
-
- - - Preview - -
+ {/* PANE 2: PREVIEW (RIGHT) - fills remaining space, sits on solid surface */} + + {/* Preview Panel Header: 36px (h-9) consistent with Editor header, styled with glass-1 */} +
+
+ + + Preview + +
+ + {/* Viewport Width Controls in preview panel header - styled with glass-2-nested */} +
+ + + +
+
- {/* Viewport Width Controls in preview panel header - styled with glass-2-nested */} -
- - - -
-
+ {/* Framed Browser Viewport Container on solid surface */} +
+ +
+ + + )} - {/* Framed Browser Viewport Container on solid surface */} -
- -
-
+ {/* Transparent Drag Overlay: while dragging, prevents Monaco / iframe from swallowing mouse events or hiding cursor */} + {isHandleDragging && ( +
); } diff --git a/components/layout/ThemeToggle.tsx b/components/layout/ThemeToggle.tsx index 208e05d..1c82d4e 100644 --- a/components/layout/ThemeToggle.tsx +++ b/components/layout/ThemeToggle.tsx @@ -3,7 +3,6 @@ import { useEffect, useState, useRef } from "react"; import { useTheme } from "next-themes"; import { flushSync } from "react-dom"; -import { motion, AnimatePresence } from "framer-motion"; import { Moon, Sun } from "lucide-react"; import { IconButton } from "@/components/ui/icon-button"; @@ -126,22 +125,16 @@ export function ThemeToggle() { aria-label="Toggle theme" className="relative cursor-pointer overflow-hidden" > - - - {isDark ? ( - - ) : ( - - )} - - + + {isDark ? ( + + ) : ( + + )} + ); } From 7fdb958864d48ec76c6c6206ba78a03d8c6f74f7 Mon Sep 17 00:00:00 2001 From: Vipin Date: Tue, 24 Nov 2026 13:01:41 +0530 Subject: [PATCH 12/14] docs: update progress tracker with Copilot Option B morph and performance verification --- context/progress-tracker.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/context/progress-tracker.md b/context/progress-tracker.md index 154fb20..199b43b 100644 --- a/context/progress-tracker.md +++ b/context/progress-tracker.md @@ -12,9 +12,10 @@ Update this file after every completed feature. Any AI agent reading this should 2. Part 6 (Button Borders Match System): Unified all bordered surfaces (cards, nav, chips, inputs, buttons) to single hairline token (`1px rgba(23,23,31,0.10)` light, `1px rgba(255,255,255,0.10)` dark) with card inset top highlight; removed separate light-violet outline ring on primary buttons (edge defined cleanly by gradient fill, inset highlight, and violet glow); secondary buttons match card hairline with subtle background fill (`rgba(255,255,255,0.06)` dark + blur, `rgba(255,255,255,0.72)` light); on hover hairline transitions to 0.16 over 150ms; audited and unified fragmented border classes across /, /apps, /templates, and /builder. 3. Part 2 (Logo Visibility & Contrast): Audited AppForge logo across all surfaces (landing nav, app nav, builder header, footer, sign-in/sign-up, and favicon). Ensured >15:1 contrast against background in both themes using the inverted solid tile pattern (`w-8 h-8 rounded-[10px] bg-foreground text-background` in light mode: #17171F background with #FFFFFF mark; in dark mode: #F2F2F7 background with #0B0B12 mark). Added missing logo mark tile to builder header before breadcrumb text. Updated `app/icon.svg` with adaptive prefers-color-scheme SVG tile. Captured and verified light and dark screenshots for all 6 locations. 4. Part 3 (Builder Split-Pane Resize): Replaced custom divider with `react-resizable-panels` (shadcn Resizable pattern) in `components/ui/resizable.tsx`. Implemented 8px hit area (`w-2 -mx-1`), `col-resize` cursor, 1px center hairline transitioning to brand color on hover/drag, and a 4x16px centered grip. Added dragging state handler setting `cursor: col-resize` and `user-select: none` on `document.body` along with a transparent overlay covering Monaco and preview to prevent pointer event swallowing. Implemented min/max panel sizing, double-click reset, `localStorage` persistence with `try/catch`, and full keyboard navigation (`role="separator"`, `aria-valuenow`). Wired `ResizeObserver` with `requestAnimationFrame` on Monaco container for smooth layout updates. -5. Part 4 (Click & Press Feedback Everywhere + Copilot Morph): Applied scale 0.97 press feedback with spring back across all clickable elements (buttons, icon buttons, nav links, cards, pills, menu items); 150ms transitions on hover background, border, and shadow. Verified floating Copilot pill morphing into panel via shared `layoutId="copilot-container"` with bottom-right origin anchor (`originX: 1, originY: 1`), spring bounce 0.15, visualDuration 0.4s, and 80ms delayed content fade. Recorded CDP Performance trace confirming 0 long tasks over 50ms during animation. Added sliding active-pill nav indicator between Apps, Builder, and Templates in `AppHeader.tsx`. Confirmed smooth width spring transitions for Save Draft and Publish buttons. +5. Part 4 (Click & Press Feedback Everywhere + Copilot Morph): Applied scale 0.97 press feedback with spring back across all clickable elements (buttons, icon buttons, nav links, cards, pills, menu items); 150ms transitions on hover background, border, and shadow. Added sliding active-pill nav indicator between Apps, Builder, and Templates in `AppHeader.tsx`. Confirmed smooth width spring transitions for Save Draft and Publish buttons. 6. Part 5 (Small Fixes): Unlocked hero headline container width (`xl:max-w-none`, `xl:whitespace-nowrap`) ensuring "Live Config-driven Apps" stays on a single line at 1280px and wider with gradient strictly on "driven Apps". Updated builder preview address bar to render dynamic origin (`window.location.host`) rather than hardcoded `localhost:3000`. -**Next:** Final Verification Gate (tsc, lint, unit tests, DB tests [TEST host only], next build). +7. Part 7 (Copilot Option B Size Morph Done Right): Implemented shared `layoutId="copilot-container"` between floating pill and panel with bottom-right corner anchor (`originX: 1, originY: 1`, `transformOrigin: "100% 100%"`). Open spring transition `{ visualDuration: 0.38, bounce: 0.2 }` and faster close `{ duration: 0.22, ease: [0.4, 0, 0.2, 1] }`. Removed all CSS `transition-*`, `rounded-*`, and `shadow-*` classes fighting Motion; injected `borderRadius` (pill 20px, panel 16px) and `boxShadow` strictly via the `style` prop for correct layout interpolation. Protected children from stretching with `AnimatePresence` crossfade (`layout="position"`): pill label exits cleanly in 0.08s; panel content fades in after 0.14s over 0.16s (`absolute inset-0`). Reduced motion switches to 0.12s opacity-only fade without layout morph. CDP performance tracing recorded 0 long tasks over 50ms (maximum task: 23.98ms). Verified Esc and click-outside dismissal; recorded full demonstration clip (open → Esc → open → click-outside) in MP4, WebM, and GIF formats. +**Next:** Pre-PUSH Verification & Final Checks. --- From 3ab96db6c7f09c60917cc1d3009763d59315fcc3 Mon Sep 17 00:00:00 2001 From: Vipin Date: Tue, 24 Nov 2026 13:53:30 +0530 Subject: [PATCH 13/14] refactor(deps): consolidate animation imports on motion/react and remove framer-motion --- app/builder/[appId]/page.tsx | 2 +- components/builder/CopilotFloatingPill.tsx | 2 +- components/builder/LivePreview.tsx | 2 +- components/home/story/AiCopilotLive.tsx | 2 +- components/home/story/DynamicBackendsLive.tsx | 2 +- .../home/story/GracefulDegradationLive.tsx | 2 +- components/home/story/InstantPreviewLive.tsx | 2 +- components/homepage/Features.tsx | 2 +- components/homepage/Hero.tsx | 2 +- components/layout/AppHeader.tsx | 2 +- components/ui/animated-beam.tsx | 2 +- components/ui/number-ticker.tsx | 2 +- package-lock.json | 43 ------------------- package.json | 1 - 14 files changed, 12 insertions(+), 56 deletions(-) diff --git a/app/builder/[appId]/page.tsx b/app/builder/[appId]/page.tsx index 14ea1c1..25e9666 100644 --- a/app/builder/[appId]/page.tsx +++ b/app/builder/[appId]/page.tsx @@ -26,7 +26,7 @@ import { IconButton } from "@/components/ui/icon-button"; import { StatusPill } from "@/components/ui/status-pill"; import { ThemeToggle } from "@/components/layout/ThemeToggle"; import { Kbd } from "@/components/ui/kbd"; -import { motion, AnimatePresence } from "framer-motion"; +import { motion, AnimatePresence } from "motion/react"; import { MOTION_TOKENS } from "@/lib/motion-tokens"; import { ArrowLeft, diff --git a/components/builder/CopilotFloatingPill.tsx b/components/builder/CopilotFloatingPill.tsx index 83698a8..a5dbbd3 100644 --- a/components/builder/CopilotFloatingPill.tsx +++ b/components/builder/CopilotFloatingPill.tsx @@ -1,7 +1,7 @@ "use client"; import { useState, useEffect, useRef } from "react"; -import { motion, AnimatePresence, useReducedMotion, type Transition } from "framer-motion"; +import { motion, AnimatePresence, useReducedMotion, type Transition } from "motion/react"; import { Sparkles, ArrowUp, Loader2, ChevronDown } from "lucide-react"; import { Button } from "@/components/ui/button"; import { IconButton } from "@/components/ui/icon-button"; diff --git a/components/builder/LivePreview.tsx b/components/builder/LivePreview.tsx index a9cc361..61bbeff 100644 --- a/components/builder/LivePreview.tsx +++ b/components/builder/LivePreview.tsx @@ -3,7 +3,7 @@ import { useState, useEffect } from "react"; import { RenderNode } from "@/registry"; import { Skeleton } from "@/components/ui/skeleton"; -import { motion, AnimatePresence } from "framer-motion"; +import { motion, AnimatePresence } from "motion/react"; import { Monitor, Tablet, Smartphone, Lock, RotateCcw } from "lucide-react"; function PreviewSkeleton() { diff --git a/components/home/story/AiCopilotLive.tsx b/components/home/story/AiCopilotLive.tsx index 1679ffc..e775740 100644 --- a/components/home/story/AiCopilotLive.tsx +++ b/components/home/story/AiCopilotLive.tsx @@ -1,7 +1,7 @@ "use client"; import { useEffect, useRef, useState } from "react"; -import { LazyMotion, domAnimation, m, useReducedMotion } from "framer-motion"; +import { LazyMotion, domAnimation, m, useReducedMotion } from "motion/react"; import { CheckCircle2, Sparkles } from "lucide-react"; import { RenderNode } from "@/registry"; diff --git a/components/home/story/DynamicBackendsLive.tsx b/components/home/story/DynamicBackendsLive.tsx index c549164..91caa36 100644 --- a/components/home/story/DynamicBackendsLive.tsx +++ b/components/home/story/DynamicBackendsLive.tsx @@ -1,7 +1,7 @@ "use client"; import { useEffect, useRef, useState } from "react"; -import { LazyMotion, domAnimation, m, useReducedMotion } from "framer-motion"; +import { LazyMotion, domAnimation, m, useReducedMotion } from "motion/react"; import { Database, Layers } from "lucide-react"; import { AnimatedBeam } from "@/components/ui/animated-beam"; import { RenderNode } from "@/registry"; diff --git a/components/home/story/GracefulDegradationLive.tsx b/components/home/story/GracefulDegradationLive.tsx index 721374b..5a2e44c 100644 --- a/components/home/story/GracefulDegradationLive.tsx +++ b/components/home/story/GracefulDegradationLive.tsx @@ -1,7 +1,7 @@ "use client"; import { useEffect, useRef, useState } from "react"; -import { LazyMotion, domAnimation, AnimatePresence, m, useReducedMotion } from "framer-motion"; +import { LazyMotion, domAnimation, AnimatePresence, m, useReducedMotion } from "motion/react"; import { ShieldAlert, TrendingUp } from "lucide-react"; import { NumberTicker } from "@/components/ui/number-ticker"; import { RenderNode } from "@/registry"; diff --git a/components/home/story/InstantPreviewLive.tsx b/components/home/story/InstantPreviewLive.tsx index b2ce633..45e07a4 100644 --- a/components/home/story/InstantPreviewLive.tsx +++ b/components/home/story/InstantPreviewLive.tsx @@ -1,7 +1,7 @@ "use client"; import { useEffect, useRef, useState } from "react"; -import { LazyMotion, domAnimation, AnimatePresence, m, useReducedMotion } from "framer-motion"; +import { LazyMotion, domAnimation, AnimatePresence, m, useReducedMotion } from "motion/react"; import { ArrowDown, ArrowRight, Code } from "lucide-react"; import { RenderNode } from "@/registry"; diff --git a/components/homepage/Features.tsx b/components/homepage/Features.tsx index b8600af..c77a888 100644 --- a/components/homepage/Features.tsx +++ b/components/homepage/Features.tsx @@ -1,6 +1,6 @@ "use client"; -import { useReducedMotion, motion } from "framer-motion"; +import { useReducedMotion, motion } from "motion/react"; import { Database, ShieldAlert, diff --git a/components/homepage/Hero.tsx b/components/homepage/Hero.tsx index 1055312..f4feea5 100644 --- a/components/homepage/Hero.tsx +++ b/components/homepage/Hero.tsx @@ -2,7 +2,7 @@ import Link from "next/link"; import { LayoutTemplate } from "lucide-react"; -import { motion, Variants } from "framer-motion"; +import { motion, type Variants } from "motion/react"; import { Button } from "@/components/ui/button"; import { RenderNode } from "@/registry"; diff --git a/components/layout/AppHeader.tsx b/components/layout/AppHeader.tsx index e7a4b4b..ccb5366 100644 --- a/components/layout/AppHeader.tsx +++ b/components/layout/AppHeader.tsx @@ -9,7 +9,7 @@ import { UserButton, useOrganization, useUser } from "@clerk/nextjs"; import { Search, ChevronDown, Menu, X, LayoutGrid, FileCode2 } from "lucide-react"; import { IconButton } from "@/components/ui/icon-button"; import { Kbd } from "@/components/ui/kbd"; -import { motion } from "framer-motion"; +import { motion } from "motion/react"; import { MOTION_TOKENS } from "@/lib/motion-tokens"; type Props = { diff --git a/components/ui/animated-beam.tsx b/components/ui/animated-beam.tsx index 346d012..c7d1220 100644 --- a/components/ui/animated-beam.tsx +++ b/components/ui/animated-beam.tsx @@ -1,7 +1,7 @@ "use client" import { useEffect, useId, useState, type RefObject } from "react" -import { m, useReducedMotion } from "framer-motion" +import { m, useReducedMotion } from "motion/react" import { cn } from "@/lib/utils" diff --git a/components/ui/number-ticker.tsx b/components/ui/number-ticker.tsx index 4d72135..1656ed8 100644 --- a/components/ui/number-ticker.tsx +++ b/components/ui/number-ticker.tsx @@ -1,7 +1,7 @@ "use client" import { useEffect, useRef, type ComponentPropsWithoutRef } from "react" -import { useInView, useMotionValue, useReducedMotion, useSpring } from "framer-motion" +import { useInView, useMotionValue, useReducedMotion, useSpring } from "motion/react" import { cn } from "@/lib/utils" diff --git a/package-lock.json b/package-lock.json index 9402651..8ec3acc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,7 +27,6 @@ "canvas-confetti": "^1.9.4", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", - "framer-motion": "^12.41.0", "gsap": "^3.15.0", "lenis": "^1.3.23", "lucide-react": "^1.21.0", @@ -7266,33 +7265,6 @@ "node": ">=12.20.0" } }, - "node_modules/framer-motion": { - "version": "12.41.0", - "resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-12.41.0.tgz", - "integrity": "sha512-OHAMNiCEON1RDBlRGuulsN5AD8ptMjvk5QWfFmYmBLPZ3zFGIJe60kQucQQf4cez1OzQmjYBWDY+dYfISkUdqg==", - "license": "MIT", - "dependencies": { - "motion-dom": "^12.41.0", - "motion-utils": "^12.39.0", - "tslib": "^2.4.0" - }, - "peerDependencies": { - "@emotion/is-prop-valid": "*", - "react": "^18.0.0 || ^19.0.0", - "react-dom": "^18.0.0 || ^19.0.0" - }, - "peerDependenciesMeta": { - "@emotion/is-prop-valid": { - "optional": true - }, - "react": { - "optional": true - }, - "react-dom": { - "optional": true - } - } - }, "node_modules/fs-extra": { "version": "11.3.5", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.3.5.tgz", @@ -9351,21 +9323,6 @@ } } }, - "node_modules/motion-dom": { - "version": "12.41.0", - "resolved": "https://registry.npmjs.org/motion-dom/-/motion-dom-12.41.0.tgz", - "integrity": "sha512-Lk3J39fOGg6xNr1KRZsN6usDyBf8aP7MEbUPez1VCughHt79OrP7VGqNrPyFL0riaT7WS8t9DRw1M3BHtM/xKw==", - "license": "MIT", - "dependencies": { - "motion-utils": "^12.39.0" - } - }, - "node_modules/motion-utils": { - "version": "12.39.0", - "resolved": "https://registry.npmjs.org/motion-utils/-/motion-utils-12.39.0.tgz", - "integrity": "sha512-8nadJAJjTtqRkmRF36FoJTrywK9nnFmnPwnSMyxaOCU7GDjN9RTMJIxx9De8ErM+vpPhMccr/6fo5WciyQLnMQ==", - "license": "MIT" - }, "node_modules/motion/node_modules/framer-motion": { "version": "14.14.0", "resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-14.14.0.tgz", diff --git a/package.json b/package.json index ef59ef0..453608e 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,6 @@ "canvas-confetti": "^1.9.4", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", - "framer-motion": "^12.41.0", "gsap": "^3.15.0", "lenis": "^1.3.23", "lucide-react": "^1.21.0", From 600706950df6a66256b7e1f612eaf02010a4301e Mon Sep 17 00:00:00 2001 From: Vipin Date: Tue, 24 Nov 2026 13:53:52 +0530 Subject: [PATCH 14/14] docs: update progress tracker with motion consolidation and lighthouse verification --- context/progress-tracker.md | 1 + 1 file changed, 1 insertion(+) diff --git a/context/progress-tracker.md b/context/progress-tracker.md index 199b43b..8a5a4ea 100644 --- a/context/progress-tracker.md +++ b/context/progress-tracker.md @@ -15,6 +15,7 @@ Update this file after every completed feature. Any AI agent reading this should 5. Part 4 (Click & Press Feedback Everywhere + Copilot Morph): Applied scale 0.97 press feedback with spring back across all clickable elements (buttons, icon buttons, nav links, cards, pills, menu items); 150ms transitions on hover background, border, and shadow. Added sliding active-pill nav indicator between Apps, Builder, and Templates in `AppHeader.tsx`. Confirmed smooth width spring transitions for Save Draft and Publish buttons. 6. Part 5 (Small Fixes): Unlocked hero headline container width (`xl:max-w-none`, `xl:whitespace-nowrap`) ensuring "Live Config-driven Apps" stays on a single line at 1280px and wider with gradient strictly on "driven Apps". Updated builder preview address bar to render dynamic origin (`window.location.host`) rather than hardcoded `localhost:3000`. 7. Part 7 (Copilot Option B Size Morph Done Right): Implemented shared `layoutId="copilot-container"` between floating pill and panel with bottom-right corner anchor (`originX: 1, originY: 1`, `transformOrigin: "100% 100%"`). Open spring transition `{ visualDuration: 0.38, bounce: 0.2 }` and faster close `{ duration: 0.22, ease: [0.4, 0, 0.2, 1] }`. Removed all CSS `transition-*`, `rounded-*`, and `shadow-*` classes fighting Motion; injected `borderRadius` (pill 20px, panel 16px) and `boxShadow` strictly via the `style` prop for correct layout interpolation. Protected children from stretching with `AnimatePresence` crossfade (`layout="position"`): pill label exits cleanly in 0.08s; panel content fades in after 0.14s over 0.16s (`absolute inset-0`). Reduced motion switches to 0.12s opacity-only fade without layout morph. CDP performance tracing recorded 0 long tasks over 50ms (maximum task: 23.98ms). Verified Esc and click-outside dismissal; recorded full demonstration clip (open → Esc → open → click-outside) in MP4, WebM, and GIF formats. +8. Part 8 (Motion Consolidation & Lighthouse Verification): Consolidated animation imports across 12 components on `motion/react` and removed duplicate `framer-motion` package from `package.json`. Back-to-back Lighthouse benchmark on port 3001 with zero background load confirmed zero performance regression: `feat/ux-polish` scored a median of 91 (runs: 94, 91, 90; LCP 1.2s, TBT 290ms, CLS 0) vs `origin/master` median of 88 (runs: 88, 92, 86; LCP 1.2s, TBT 340ms, CLS 0). Confirmed all 148 unit tests across 16 files are 100% intact and passing. **Next:** Pre-PUSH Verification & Final Checks. ---