feat(experience-center): 侧栏、页头与生成页布局对齐用户中心规范

- 侧栏:结构、样式与收起交互对齐用户中心,去掉标题块与装饰
- 页头:云端大脑 / 图片生成 / 视频生成统一用户中心页头规格,去掉标题图标,页底与 /console/analytics 统一
- 云端大脑:专家广场 / 我的任务改为线型页签(对齐数据看板),页头操作右置
- 图片生成:参数栏固定、右侧整列局部滚动;工具栏单行,筛选固定宽度省略并悬停提示,清除筛选前置;两行卡片按可视高度拉伸并与左栏底边对齐;空状态居中;对比勾选框缩小居中
- 视频生成:任务队列浮层覆盖展开,表格对齐密钥管理列表,分页移出滚动区修复抖动,任务 ID 完整展示,状态去图标居中
- 三页底部内边距减半统一

验证:ESLint / Prettier / git diff --check 通过,单测 875 项通过;本地 Playwright 浅深主题 × 1920×951 / 1920×1080 / 393×851 布局与交互、6 套主题色兼容回归通过(图片 / 视频任务为模拟数据)
This commit is contained in:
zhanjunhao
2026-11-20 21:38:31 +08:00
parent d8d3736f8e
commit 6bf5a88cbc
18 changed files with 1045 additions and 678 deletions
@@ -533,11 +533,22 @@ const ImageTaskList = ({
setSearchKeyword('');
};
// 筛选下拉:固定宽度,文字超出时省略号截断,仅在被截断时悬停提示全名
const renderFilterLabel = (item) => (
<Typography.Text
className='image-filter-text'
ellipsis={{ tooltip: item?.label }}
>
{item?.label}
</Typography.Text>
);
const renderFilterOption = (option) => renderFilterLabel(option);
return (
<section className='image-task-list' aria-labelledby='image-history-title'>
{/* 顶部:标题 + 状态徽标 tab + 操作 */}
<div className='image-history-toolbar'>
{/* 第一行:状态 tabs + 操作 */}
{/* 单行:标题 + 状态 tabs | 筛选 + 搜索 + 操作 */}
<div className='image-history-heading'>
<div className='image-history-title-row'>
<h2 id='image-history-title'>{t('生成历史')}</h2>
@@ -560,144 +571,150 @@ const ImageTaskList = ({
</div>
</div>
<div className='image-history-tools'>
<Input
prefix={<Search size={14} />}
placeholder={t('搜索...')}
value={searchInput}
onChange={setSearchInput}
aria-label={t('搜索...')}
className='image-task-search'
showClear
/>
<div className='image-history-actions'>
{/* 筛选与工具并入同一行(宽屏单行,窄屏自动换行),让出更多图片可视高度 */}
{(modelOptions.length > 0 || sizeOptions.length > 0) && (
<div className='image-history-filters'>
{/* 清除筛选放在最前:筛选区整体右对齐,出现 / 消失时只向左伸缩,下拉框与右侧工具位置不动 */}
{hasActiveFilters && (
<button
type='button'
onClick={clearAllFilters}
className='image-history-clear'
>
<ActionX size={11} />
{t('清除筛选')}
</button>
)}
<Select
value={modelFilter}
onChange={setModelFilter}
className='image-task-model-filter'
renderSelectedItem={renderFilterLabel}
renderOptionItem={renderFilterOption}
aria-label={t('模型')}
placeholder={t('模型')}
>
<Select.Option value='all'>{t('全部模型')}</Select.Option>
{modelOptions.map((m) => (
<Select.Option key={m} value={m}>
{m}
</Select.Option>
))}
</Select>
<Select
value={sizeFilter}
onChange={setSizeFilter}
className='image-task-size-filter'
renderSelectedItem={renderFilterLabel}
renderOptionItem={renderFilterOption}
aria-label={t('尺寸')}
placeholder={t('尺寸')}
>
<Select.Option value='all'>{t('全部尺寸')}</Select.Option>
{sizeOptions.map((s) => (
<Select.Option key={s} value={s}>
{s}
</Select.Option>
))}
</Select>
</div>
)}
<div className='image-history-tools'>
<Input
prefix={<Search size={14} />}
placeholder={t('搜索...')}
value={searchInput}
onChange={setSearchInput}
aria-label={t('搜索...')}
className='image-task-search'
showClear
/>
{/* 密度切换 */}
<Dropdown
trigger='click'
position='bottomRight'
render={
<Dropdown.Menu>
<Dropdown.Item
icon={<Rows size={14} />}
onClick={() => updatePrefs({ density: 'comfortable' })}
>
{t('舒适')}
</Dropdown.Item>
<Dropdown.Item
icon={<Layout size={14} />}
onClick={() => updatePrefs({ density: 'compact' })}
>
{t('紧凑')}
</Dropdown.Item>
<Dropdown.Item
icon={<LayoutGrid size={14} />}
onClick={() => updatePrefs({ density: 'grid' })}
>
{t('网格')}
</Dropdown.Item>
</Dropdown.Menu>
}
>
{/* 密度切换 */}
<Dropdown
trigger='click'
position='bottomRight'
render={
<Dropdown.Menu>
<Dropdown.Item
icon={<Rows size={14} />}
onClick={() => updatePrefs({ density: 'comfortable' })}
>
{t('舒适')}
</Dropdown.Item>
<Dropdown.Item
icon={<Layout size={14} />}
onClick={() => updatePrefs({ density: 'compact' })}
>
{t('紧凑')}
</Dropdown.Item>
<Dropdown.Item
icon={<LayoutGrid size={14} />}
onClick={() => updatePrefs({ density: 'grid' })}
>
{t('网格')}
</Dropdown.Item>
</Dropdown.Menu>
}
>
<Button
icon={
density === 'comfortable' ? (
<ActionRows size={14} />
) : density === 'compact' ? (
<ActionLayout size={14} />
) : (
<ActionLayoutGrid size={14} />
)
}
theme='outline'
aria-label={t('切换显示密度')}
title={t('切换显示密度')}
/>
</Dropdown>
{/* 多选模式切换 */}
<Button
icon={<ActionGitCompare size={14} />}
theme={selectMode ? 'light' : 'outline'}
type={selectMode ? 'primary' : 'tertiary'}
onClick={() => {
if (selectMode) exitSelectMode();
else setSelectMode(true);
}}
aria-label={t('对比模式')}
aria-pressed={selectMode}
title={t('对比模式')}
/>
{/* 收藏过滤 */}
<Button
icon={
density === 'comfortable' ? (
<ActionRows size={14} />
) : density === 'compact' ? (
<ActionLayout size={14} />
) : (
<ActionLayoutGrid size={14} />
)
<ActionStar
size={14}
fill={favOnly ? 'var(--brand-primary)' : 'none'}
color={favOnly ? 'var(--brand-primary)' : 'currentColor'}
/>
}
theme='outline'
aria-label={t('切换显示密度')}
title={t('切换显示密度')}
theme={favOnly ? 'light' : 'outline'}
onClick={() => setFavOnly((v) => !v)}
aria-label={t('只看收藏')}
aria-pressed={favOnly}
title={t('只看收藏')}
/>
</Dropdown>
{/* 多选模式切换 */}
<Button
icon={<ActionGitCompare size={14} />}
theme={selectMode ? 'light' : 'outline'}
type={selectMode ? 'primary' : 'tertiary'}
onClick={() => {
if (selectMode) exitSelectMode();
else setSelectMode(true);
}}
aria-label={t('对比模式')}
aria-pressed={selectMode}
title={t('对比模式')}
/>
{/* 收藏过滤 */}
<Button
icon={
<ActionStar
size={14}
fill={favOnly ? 'var(--brand-primary)' : 'none'}
color={favOnly ? 'var(--brand-primary)' : 'currentColor'}
/>
}
theme={favOnly ? 'light' : 'outline'}
onClick={() => setFavOnly((v) => !v)}
aria-label={t('只看收藏')}
aria-pressed={favOnly}
title={t('只看收藏')}
/>
<Button
icon={<ActionRefreshCw size={14} />}
theme='outline'
onClick={() => onRefresh(true, false)}
aria-label={t('刷新任务列表')}
title={t('刷新任务列表')}
/>
<Button
icon={<ActionRefreshCw size={14} />}
theme='outline'
onClick={() => onRefresh(true, false)}
aria-label={t('刷新任务列表')}
title={t('刷新任务列表')}
/>
</div>
</div>
</div>
{/* 第二行:筛选 chips(仅在有可选/激活时显示) */}
{(modelOptions.length > 0 || sizeOptions.length > 0) && (
<div className='image-history-filters'>
<Select
value={modelFilter}
onChange={setModelFilter}
className='image-task-model-filter'
aria-label={t('模型')}
placeholder={t('模型')}
>
<Select.Option value='all'>{t('全部模型')}</Select.Option>
{modelOptions.map((m) => (
<Select.Option key={m} value={m}>
{m}
</Select.Option>
))}
</Select>
<Select
value={sizeFilter}
onChange={setSizeFilter}
className='image-task-size-filter'
aria-label={t('尺寸')}
placeholder={t('尺寸')}
>
<Select.Option value='all'>{t('全部尺寸')}</Select.Option>
{sizeOptions.map((s) => (
<Select.Option key={s} value={s}>
{s}
</Select.Option>
))}
</Select>
{hasActiveFilters && (
<button
type='button'
onClick={clearAllFilters}
className='image-history-clear'
>
<ActionX size={11} />
{t('清除筛选')}
</button>
)}
</div>
)}
{/* 多选模式下的操作条 */}
{selectMode && (
<div className='image-history-compare'>
@@ -727,7 +744,7 @@ const ImageTaskList = ({
<div className='task-list-scrollable app-scrollbar'>
<div className='image-history-content'>
{filteredTasks.length === 0 ? (
<div className='py-6'>
<div className='image-history-empty py-6'>
<Empty
image={
<IllustrationNoContent style={{ width: 150, height: 150 }} />
@@ -779,12 +796,16 @@ const ImageTaskList = ({
<div className='space-y-4'>
{groupedTasks.map((group) => (
<div key={group.key}>
<div className='image-task-group-header'>
<h3>{group.label}</h3>
<span className='image-history-count'>
{group.tasks.length}
</span>
</div>
{/* 只有一个时间分组时标题不提供额外信息(总数已在“全部”页签),直接省略以让出图片高度;
多个分组时保留紧凑的分组标签 */}
{groupedTasks.length > 1 && (
<div className='image-task-group-header'>
<h3>{group.label}</h3>
<span className='image-history-count'>
{group.tasks.length}
</span>
</div>
)}
<div className='image-task-grid' data-density={density}>
{group.tasks.map((task) => renderTaskCard(task))}
</div>