From 1f971670234b2e838c30a2bd4cf2c53ffeea5ef8 Mon Sep 17 00:00:00 2001 From: Stringadmin Date: Fri, 12 Jun 2026 18:15:58 +0800 Subject: [PATCH] fix: polish ecommerce generation states --- src/App.tsx | 5 +--- src/features/ecommerce/EcommercePage.tsx | 37 +++++++++++++++++------- src/styles/ecommerce-standalone.css | 25 +++++++++++----- 3 files changed, 44 insertions(+), 23 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 110a7d0..9cd67e4 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -503,10 +503,7 @@ function App() {

{authMode === "login" ? "欢迎回来" : "创建账号"}

{authMode === "login" ? "登录后继续你的 AI 创作之旅" : "注册即可免费体验全部功能"}

diff --git a/src/features/ecommerce/EcommercePage.tsx b/src/features/ecommerce/EcommercePage.tsx index d1a549a..09c48b1 100644 --- a/src/features/ecommerce/EcommercePage.tsx +++ b/src/features/ecommerce/EcommercePage.tsx @@ -106,7 +106,7 @@ const ecommerceInspirationAssets = ossAssets.ecommerce.inspiration; const ecommerceInspirationRows = [ { - title: "AI团队", + title: "社区集锦", desc: "不止作图,更懂转化。", variant: "team", cards: [ @@ -3295,7 +3295,8 @@ function ProductClonePage(_props: ProductClonePageProps = {}) { }, [openCloneBasicSelect]); useEffect(() => { - if (!composerMenu && !(status === "done" && !isCommandComposerCompact)) return undefined; + const shouldAutoCompactComposer = (status === "generating" || status === "done") && !isCommandComposerCompact; + if (!composerMenu && !shouldAutoCompactComposer) return undefined; const handlePointerDown = (event: PointerEvent) => { const target = event.target; @@ -3304,13 +3305,19 @@ function ProductClonePage(_props: ProductClonePageProps = {}) { if (composer?.contains(target)) return; if (composerMenu && composerMenu !== "settings") setComposerMenu(null); - if (status === "done" && !isCommandComposerCompact) setIsCommandComposerCompact(true); + if (shouldAutoCompactComposer) setIsCommandComposerCompact(true); }; document.addEventListener("pointerdown", handlePointerDown); return () => document.removeEventListener("pointerdown", handlePointerDown); }, [composerMenu, isCommandComposerCompact, status]); + useEffect(() => { + if ((status === "generating" || status === "done") && !isCommandComposerCompact) { + setIsCommandComposerCompact(true); + } + }, [isCommandComposerCompact, status]); + useEffect(() => { if (composerMenuCloseTimeoutRef.current !== null) { window.clearTimeout(composerMenuCloseTimeoutRef.current); @@ -4766,6 +4773,12 @@ function ProductClonePage(_props: ProductClonePageProps = {}) { }; const showMainVideoWorkspace = cloneOutput === "video" && isVideoWorkspaceVisible; + const hasGenerationSurface = status === "generating" || status === "done" || canvasNodes.length > 0; + const showPreGenerationGuides = + (status === "idle" || status === "ready") && + !showMainVideoWorkspace && + !activeHistoryRecordId && + canvasNodes.length === 0; const scrollInspirationRow = (event: ReactMouseEvent, direction: -1 | 1) => { const row = event.currentTarget.closest(".ecom-inspiration-row"); @@ -5041,16 +5054,18 @@ function ProductClonePage(_props: ProductClonePageProps = {}) {
0 ? " has-generated" : " is-before-generate"}${isCommandComposerCompact && (status === "done" || canvasNodes.length > 0) ? " is-compact" : ""}`} + className={`clone-ai-bottom-input ecom-command-composer-wrap${hasGenerationSurface ? " has-generated" : " is-before-generate"}${isCommandComposerCompact && hasGenerationSurface ? " is-compact" : ""}`} aria-label="生成指令" onClick={() => { - if (isCommandComposerCompact) setIsCommandComposerCompact(false); + if (isCommandComposerCompact && status !== "generating") setIsCommandComposerCompact(false); }} > -

0 ? " is-after-generate" : ""}`}> - {typewriterText} - -

+ {!hasGenerationSurface ? ( +

+ {typewriterText} + +

+ ) : null} {renderComposerMenu()} - {(status === "idle" || status === "ready") && !showMainVideoWorkspace ? ( + {showPreGenerationGuides ? (
{[ { label: "A+/详情页", tone: "detail", icon: , onClick: openQuickDetailPage }, @@ -5210,7 +5225,7 @@ function ProductClonePage(_props: ProductClonePageProps = {}) { ))}
) : null} - {(status === "idle" || status === "ready") && !showMainVideoWorkspace ? ( + {showPreGenerationGuides ? (
{ecommerceInspirationRows.map((row) => ( diff --git a/src/styles/ecommerce-standalone.css b/src/styles/ecommerce-standalone.css index 51c2fcb..051cfc1 100644 --- a/src/styles/ecommerce-standalone.css +++ b/src/styles/ecommerce-standalone.css @@ -455,19 +455,28 @@ .ecommerce-auth-modal__logo { position: relative; - display: block; + display: grid; + place-items: center; width: 58px; height: 58px; margin: 0 auto 14px; - overflow: hidden; - border-radius: 13px; + overflow: visible; + border-radius: 0; + background: transparent; + box-shadow: none; } -.ecommerce-auth-modal__logo i { - position: absolute; - width: 35px; - height: 35px; - border-radius: 10px; +.ecommerce-auth-modal__logo img { + display: block; + width: 58px; + height: 58px; + object-fit: contain; +} + +.ecommerce-auth-modal__logo i, +.ecommerce-auth-modal__logo::before { + content: none !important; + display: none !important; } .ecommerce-auth-modal__logo i:nth-child(1) {