From 41ce8b5e582085f3d68d2189a44debea2a3a3d95 Mon Sep 17 00:00:00 2001 From: zhanjunhao <642307404@qq.com> Date: Fri, 20 Nov 2026 18:30:13 +0800 Subject: [PATCH] =?UTF-8?q?fix(experience-center):=20=E7=BB=9F=E4=B8=80?= =?UTF-8?q?=E5=9B=BE=E5=83=8F=E4=B8=8E=E8=A7=86=E9=A2=91=E7=94=9F=E6=88=90?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E5=B9=B6=E4=BF=AE=E5=A4=8D=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 对齐表单、预览与任务区,跟随系统主题色,修复图片尺寸选择和视频高级参数显示。已通过本地浏览器验收、Lint、UI 审计和单测;未做生产测试。 --- docs/CHANGELOG.md | 24 + .../AICreation/Image/ImageGenerationForm.css | 260 +++++- .../AICreation/Image/ImageSizePicker.jsx | 28 +- .../AICreation/ImageGenerationForm.jsx | 448 +++++----- .../AICreation/ImageGenerationTab.jsx | 10 +- .../AICreation/ImageTaskList-README.md | 19 +- .../components/AICreation/ImageTaskList.css | 498 ++++++++--- .../components/AICreation/ImageTaskList.jsx | 835 ++++++------------ .../AICreation/Video/VideoInputPanel.css | 70 +- .../AICreation/Video/VideoInputPanel.jsx | 377 ++++---- .../AICreation/Video/VideoPreviewPanel.css | 159 ++-- .../AICreation/Video/VideoPreviewPanel.jsx | 247 +----- .../AICreation/Video/VideoTaskQueue.jsx | 114 +-- .../AICreation/Video/VideoWorkspace.css | 211 +++++ .../AICreation/VideoGenerationTab.jsx | 229 +---- .../components/VideoGeneration.jsx | 86 +- src/pages/ExperienceCenter/index.jsx | 16 +- 17 files changed, 1819 insertions(+), 1812 deletions(-) create mode 100644 src/pages/ExperienceCenter/components/AICreation/Video/VideoWorkspace.css diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index cc504924..ae02ac48 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -10,6 +10,30 @@ ## 2026-11-20 +### 优化 · 体验中心视频生成工作区 + +- **范围**:视频生成页的参数面板、视频预览和任务队列。 +- **变更**:以图片生成工作区的描边卡片为基准,统一标题、控件和空态;参数面板与任务队列可通过键盘折叠,任务队列不再遮挡预览;表单滚动区保留高级参数的展开高度,避免队列展开或窗口较矮时压缩折叠项。 +- **影响**:跟随系统主题配置;保持模型、视频生成、计价、任务和灰度开关契约。 +- **回滚**:仅逆向恢复本条对应的页面结构和样式。 +- **关联**:`src/pages/ExperienceCenter/components/AICreation/VideoGenerationTab.jsx`、`src/pages/ExperienceCenter/components/AICreation/Video/VideoWorkspace.css`。 + +### 优化 · 图片生成创作表单 + +- **范围**:体验中心图片生成页左侧创作表单。 +- **变更**:固定桌面端标题与生成区,归组模型和生成方式,整合提示词工具、模板、参考图与参数的视觉层次;移动端可收起表单并保留生成操作。 +- **影响**:沿用系统主题色与现有生成、引用、计价流程;右侧历史不变。 +- **回滚**:仅逆向恢复本条对应的表单结构和局部样式差异。 +- **关联**:`src/pages/ExperienceCenter/components/AICreation/ImageGenerationForm.jsx`、`src/pages/ExperienceCenter/components/AICreation/Image/ImageGenerationForm.css`、`src/pages/ExperienceCenter/components/AICreation/Image/ImageSizePicker.jsx`。 + +### 优化 · 体验中心图片生成工作区 + +- **范围**:图片生成页的双栏工作区、创作表单和生成历史。 +- **变更**:以模型超市的描边卡片为参考,统一缩略图、状态占位和操作区;窄屏堆叠,选中和焦点状态跟随系统主题色。 +- **影响**:保留任务、模型和计价流程;历史卡片在各显示密度下均可打开详情和操作菜单。 +- **回滚**:逆向恢复本条的页面布局、表单及历史卡片差异。 +- **关联**:`src/pages/ExperienceCenter/components/AICreation/ImageGenerationTab.jsx`、`ImageGenerationForm.jsx`、`ImageTaskList.jsx`。 + ### 修复 · 风控看板自动封号历史 - 复用运营看板折叠面板外框,展开时由分隔线连接标题和内容;保留默认展开、筛选、刷新、分页与解封行为。 diff --git a/src/pages/ExperienceCenter/components/AICreation/Image/ImageGenerationForm.css b/src/pages/ExperienceCenter/components/AICreation/Image/ImageGenerationForm.css index 7703e01e..d312ac2c 100644 --- a/src/pages/ExperienceCenter/components/AICreation/Image/ImageGenerationForm.css +++ b/src/pages/ExperienceCenter/components/AICreation/Image/ImageGenerationForm.css @@ -7,12 +7,20 @@ --igf-muted: var(--text-secondary); --igf-line: var(--border-subtle); --igf-surface: var(--surface-card); - --igf-accent: var(--ui-color-primary); + --igf-accent: var(--brand-accent); --igf-fill: color-mix(in srgb, var(--text-primary) 4%, var(--surface-card)); --igf-danger: var(--ui-color-danger); --igf-warning: var(--ui-color-warning); - --igf-ring: color-mix(in srgb, var(--ui-color-primary) 55%, transparent); + --igf-ring: var(--brand-accent); + display: flex; + flex-direction: column; + height: 100%; + min-height: 0; + overflow: hidden; + border: 1px solid var(--igf-line); + border-radius: 12px; background: var(--igf-surface); + color: var(--igf-ink); } .igf-form-scroll { @@ -20,7 +28,182 @@ min-height: 0; overflow-x: hidden; overflow-y: auto; - padding: 16px; + padding: 14px 16px 16px; + scrollbar-width: thin; +} + +.igf-form-scroll[hidden] { + display: none; +} + +.igf-header { + display: flex; + flex: none; + align-items: center; + gap: 10px; + padding: 15px 16px; + border-bottom: 1px solid var(--igf-line); +} + +.igf-header-icon { + display: grid; + flex: none; + place-items: center; + width: 40px; + height: 40px; + border-radius: 10px; + background: var(--brand-selection-bg); + color: var(--brand-selection-text); +} + +.igf-header-copy { + flex: 1; + min-width: 0; +} + +.igf-header-actions { + display: flex; + flex: none; + gap: 6px; +} + +.igf-title { + margin: 0; + font-size: 21px; + font-weight: 650; + line-height: 27px; +} + +.igf-description { + display: block; + overflow: hidden; + color: var(--igf-muted); + font-size: 12px; + line-height: 18px; + text-overflow: ellipsis; +} + +.igf-section + .igf-section { + margin-top: 16px; +} + +.igf-field-heading { + margin: 0 0 8px; + font-size: 13px; + font-weight: 650; + line-height: 20px; +} + +.igf-configuration, +.igf-parameters { + padding: 12px; + border: 1px solid var(--igf-line); + border-radius: 10px; + background: var(--igf-fill); +} + +.igf-mode-field { + margin-top: 10px; +} + +.igf-mode-group.cp-option-group { + display: flex; + width: 100%; + gap: 3px; + background: var(--igf-surface); +} + +.igf-mode-group .cp-option { + flex: 1 1 auto; + padding-inline: 6px; +} + +.igf-mode-group .cp-option.is-selected { + border-color: var(--igf-accent); + background: var(--brand-selection-bg); + color: var(--brand-selection-text); +} + +.igf-editor { + border: 1px solid var(--igf-line); + border-radius: 10px; + background: var(--igf-fill); +} + +.igf-editor:focus-within { + border-color: var(--igf-accent); +} + +.igf-editor textarea.ant-input { + min-height: 78px; + padding: 9px 10px; + resize: vertical; + font-size: 13px; + line-height: 20px; +} + +.igf-editor-toolbar, +.igf-editor-actions { + display: flex; + flex-wrap: wrap; + align-items: center; + gap: 4px; +} + +.igf-editor-toolbar { + justify-content: space-between; + padding: 4px 6px; + border-top: 1px solid var(--igf-line); +} + +.igf-editor-actions .ant-btn { + padding-inline: 7px; + font-size: 12px; +} + +.igf-shortcut { + display: inline-flex; + align-items: center; + gap: 3px; + padding: 1px 5px; + border: 1px solid var(--igf-line); + border-radius: 5px; + color: var(--igf-muted); + font-size: 11px; + white-space: nowrap; +} + +.igf-history-item { + display: block; + overflow: hidden; + max-width: min(280px, 70vw); + text-overflow: ellipsis; + white-space: nowrap; +} + +.igf-templates { + display: flex; + flex-wrap: wrap; + gap: 6px; + margin-top: 10px; +} + +.igf-templates .ant-btn { + flex: 1 1 27%; + min-height: 28px; + box-shadow: none; +} + +.igf-templates-label { + flex-basis: 100%; + color: var(--igf-muted); + font-size: 12px; +} + +.igf-generate .igf-submit.ant-btn { + height: 42px; + font-size: 14px; + font-weight: 600; } /* Keep disabled generation actions grounded in the same surface and border token. */ @@ -139,13 +322,36 @@ } .igf-slots { - display: flex; - flex-wrap: wrap; - gap: 10px; + display: grid; + grid-template-columns: repeat(3, minmax(0, 1fr)); + gap: 8px; +} + +.igf-slots .cp-slot { + width: 100%; + height: auto; + aspect-ratio: 1; + border-radius: 9px; +} + +.igf-reference-hint { + margin: 6px 0 0; +} + +.igf-size .cp-option-group--ratio { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(min(100%, 78px), 1fr)); } .igf-size .cp-option-group--ratio .cp-option { - min-width: 64px; + gap: 3px; + min-width: 0; + padding: 6px 4px; +} + +.igf-size .cp-option-group--ratio .cp-option-label { + white-space: normal; + overflow-wrap: anywhere; } .igf-size-dims { @@ -175,6 +381,35 @@ margin-top: 12px; } +.igf-advanced-trigger { + display: flex; + align-items: center; + gap: 8px; + width: 100%; + min-height: 34px; + padding: 6px 10px; + border: 1px solid var(--igf-line); + border-radius: 8px; + color: var(--igf-muted); + font-size: 13px; + text-align: start; +} + +.igf-advanced-trigger span { + flex: 1; +} + +.igf-advanced-trigger:hover, +.igf-advanced-trigger[aria-expanded='true'] { + border-color: var(--igf-accent); + background: var(--brand-selection-bg); + color: var(--brand-selection-text); +} + +.igf-advanced-content { + padding-top: 12px; +} + .igf-generate { display: flex; flex-direction: column; @@ -183,11 +418,20 @@ .igf-generate-wrap { flex: 0 0 auto; - padding: 16px 16px max(16px, env(safe-area-inset-bottom)); + padding: 12px 16px max(12px, env(safe-area-inset-bottom)); border-top: 1px solid var(--igf-line); background: var(--igf-surface); } +.igf-collapsed-summary { + overflow: hidden; + margin: 0 0 8px; + color: var(--igf-muted); + font-size: 12px; + text-overflow: ellipsis; + white-space: nowrap; +} + .igf-quote { min-height: 18px; color: var(--igf-muted); diff --git a/src/pages/ExperienceCenter/components/AICreation/Image/ImageSizePicker.jsx b/src/pages/ExperienceCenter/components/AICreation/Image/ImageSizePicker.jsx index 902202c1..f9596b24 100644 --- a/src/pages/ExperienceCenter/components/AICreation/Image/ImageSizePicker.jsx +++ b/src/pages/ExperienceCenter/components/AICreation/Image/ImageSizePicker.jsx @@ -15,6 +15,20 @@ import { const CUSTOM = '__custom__'; +const formatPreset = ({ width, height, label }) => { + const dimensions = `${width}×${height}`; + const caption = label + .replace(/\s*[((]\s*\d+\s*[x×]\s*\d+\s*[))]\s*$/i, '') + .trim(); + return { + dimensions, + caption: + caption.toLowerCase().replace(/\s/g, '').replace('x', '×') === dimensions + ? '' + : caption, + }; +}; + /** * 图像尺寸(schema type = 'size'):预设按宽高比图标展示;仅当 schema 下发 custom_size 时 * 提供"自定义",宽高输入框失焦 / 回车时按 min / max / step 吸附。 @@ -83,7 +97,9 @@ const ImageSizePicker = ({ param, value, onChange }) => { getOptionAriaLabel={(opt) => { if (opt === CUSTOM) return t('自定义尺寸'); const p = presets.find((x) => x.value === opt); - return p ? `${p.label || ''} ${p.width}×${p.height}`.trim() : opt; + if (!p) return opt; + const { caption, dimensions } = formatPreset(p); + return caption ? `${caption} ${dimensions}` : dimensions; }} renderOption={(opt) => { if (opt === CUSTOM) { @@ -97,16 +113,16 @@ const ImageSizePicker = ({ param, value, onChange }) => { ); } const p = presets.find((x) => x.value === opt); + if (!p) return opt; + const { caption, dimensions } = formatPreset(p); return ( <> - {p.label || `${p.width}×${p.height}`} + {caption || dimensions} - {p.label ? ( - - {p.width}×{p.height} - + {caption ? ( + {dimensions} ) : null} ); diff --git a/src/pages/ExperienceCenter/components/AICreation/ImageGenerationForm.jsx b/src/pages/ExperienceCenter/components/AICreation/ImageGenerationForm.jsx index 97b3d2e4..3f67cf63 100644 --- a/src/pages/ExperienceCenter/components/AICreation/ImageGenerationForm.jsx +++ b/src/pages/ExperienceCenter/components/AICreation/ImageGenerationForm.jsx @@ -1,13 +1,14 @@ import { I18N_TECHNICAL_TEXT } from '../../../../i18n/technicalText.js'; import { Wallet as ActionWallet, + Zap as ActionZap, RotateCcw as ActionRotateCcw, ChevronDown as ActionChevronDown, ChevronUp as ActionChevronUp, History as ActionHistory, Settings as ActionSettings, } from '@/components/common/icons/ActionIcons'; -import React, { useEffect, useRef, useState } from 'react'; +import React, { useEffect, useId, useRef, useState } from 'react'; import { Button, Collapsible, @@ -43,7 +44,7 @@ import { import ImageSizePicker from './Image/ImageSizePicker'; import './Image/ImageGenerationForm.css'; -const { Title, Text } = Typography; +const { Text } = Typography; // sessionStorage prompt 历史 key const PROMPT_HISTORY_KEY = 'expCenter.imageGen.promptHistory.v1'; @@ -119,20 +120,9 @@ const hasImageTaskType = (dataTransfer) => Array.from(dataTransfer.types).includes('application/x-image-task'), ); -const Section = ({ title, extra, children, className = '' }) => ( -
- {title || extra ? ( -
- {title ? ( - - {title} - - ) : null} - {extra} -
- ) : null} +const Section = ({ title, children, className = '' }) => ( +
+ {title &&

{title}

} {children}
); @@ -145,6 +135,10 @@ const ImageGenerationForm = ({ creation }) => { const { t } = useTranslation(); const navigate = useNavigate(); const isMobile = useIsMobile(); + const bodyId = useId(); + const advancedId = useId(); + const promptId = useId(); + const quoteId = useId(); const [mobileCollapsed, setMobileCollapsed] = useState(false); const [showAdvanced, setShowAdvanced] = useState(false); const [dropActive, setDropActive] = useState(false); @@ -348,10 +342,10 @@ const ImageGenerationForm = ({ creation }) => { theme='solid' size='large' block - icon={} + icon={