标签统一:Tag/Status/Badge 合并成一个壳(同一份度量 + 同一张色板),尺寸改成挂在容器上的 --tag-* 两档令牌(表格自动降 sm),新增 TagGroup 管住组内 6px / 组下 12px,只读回显不再用 31px 胶囊、页面手抄的标签皮肤全部收编;Field 的 hint 真正落地、FormRow 子项贴顶对齐
parent
8614360ab7
commit
72afec93fc
|
|
@ -1,5 +1,6 @@
|
|||
import type { ReactNode } from 'react'
|
||||
import { cn } from '../../lib/cn'
|
||||
import { TAG_DENSE } from './Status'
|
||||
|
||||
/**
|
||||
* 控件栏体系(docs/UI规范.md §1~§5 的唯一实现)。
|
||||
|
|
@ -70,10 +71,18 @@ export function Field({ label, required, children, width = 'default', className,
|
|||
title?: string
|
||||
}) {
|
||||
return (
|
||||
<label title={title} className={cn(LABEL, FIELD_INNER, WIDTHS[width], 'min-w-0', className)}>
|
||||
<label title={title} className={cn(LABEL, FIELD_INNER, WIDTHS[width], 'min-w-0',
|
||||
// 带 hint 的字段翻成两列栅格:标签在左上、控件在右上、说明贴在控件下面。
|
||||
// 不能只是 flex-wrap——base.css 里控件是 w-full,一换行控件就被整体挤到第二行,
|
||||
// 标签跑回上面,同一栅格里就成了「一个横排、两个竖排」的混排(规范 R3)。
|
||||
hint && 'grid grid-cols-[auto_minmax(0,1fr)]', className)}>
|
||||
{label && <span className="flex-none">{label}{required && <Req />}</span>}
|
||||
{children}
|
||||
{hint}
|
||||
{hint && (
|
||||
<span className="col-start-2 w-full pt-[3px] text-faint text-tiny leading-[1.5] font-normal tracking-[0]">
|
||||
{hint}
|
||||
</span>
|
||||
)}
|
||||
</label>
|
||||
)
|
||||
}
|
||||
|
|
@ -118,13 +127,18 @@ export function FormRow({ children, cols, tight, stack, className }: {
|
|||
: `repeat(${cols},minmax(0,1fr))`
|
||||
return (
|
||||
<div className={cn('[--ctl-h:var(--ctl-h-main)] grid mb-[10px] min-w-0 [&>*]:min-w-0',
|
||||
// 每个字段贴到自己格子的顶端:否则带 hint 的字段把行撑高之后,
|
||||
// 旁边没 hint 的字段会被垂直居中,同一行三个输入框错开半行(规范 R3)。
|
||||
'[&>*]:self-start',
|
||||
// 间距照旧站 .frow(gap: 8px 10px):列间 10px 是「标签在左」不贴到上一格控件的地板,
|
||||
// 之前这里只在 tight 时给 gap,非 tight 档位间距为 0,窄屏上「镜号」几乎贴着上一格的输入框。
|
||||
tight ? 'gap-[8px]' : 'gap-x-[10px] gap-y-[8px]',
|
||||
cols === undefined && 'max-mid:grid-cols-2',
|
||||
(cols === 3 || cols === 4) && 'max-mid:grid-cols-2',
|
||||
(cols === 4 || cols === 6) && 'max-nav:grid-cols-2',
|
||||
stack && 'gap-y-[10px] [&>*]:flex-col [&>*]:items-stretch [&>*]:gap-[5px] [&>*]:w-auto [&>*:not(span)]:w-full',
|
||||
// 这里必须显式 [&>*]:flex:带 hint 的字段自己是 grid,
|
||||
// grid 元素不认 flex-direction,不覆盖就会在 stack 栅格里漏掉竖排。
|
||||
stack && 'gap-y-[10px] [&>*]:flex [&>*]:flex-col [&>*]:items-stretch [&>*]:gap-[5px] [&>*]:w-auto [&>*:not(span)]:w-full',
|
||||
className)}
|
||||
style={{ gridTemplateColumns: tracks }}>
|
||||
{children}
|
||||
|
|
@ -143,16 +157,24 @@ export function ChipBar({ children, label, className, top }: { children: ReactNo
|
|||
}
|
||||
|
||||
/**
|
||||
* 筛选/开关胶囊(.chip)。
|
||||
* 默认是可点的 button;只读计数(调度中心队列旁的「queued 12」那种)传 as="span",
|
||||
* 否则一行里会冒出七八个按了没反应的 Tab 停靠点。
|
||||
* 筛选/开关胶囊(.chip):**可点的**东西才属于这一族(31px,与同排按钮等高)。
|
||||
*
|
||||
* 只读回显(计数、能力、状态)不要在这里传 as="span",一律用 Tag / TagGroup:
|
||||
* 一行里 31px 的只读胶囊和 20px 的标签并排,正是「标签样式不统一」最显眼的那处。
|
||||
* as="span" 只留一个例外——文件选择器旁边「已选 xxx.mp3」这种回显,
|
||||
* 它跟着同排那串可点的素材 chip 成组,而不是跟着标签成组。
|
||||
*/
|
||||
export function Chip({ active, children, onClick, className, title, disabled, as = 'button', href }: {
|
||||
export function Chip({ active, children, onClick, className, title, disabled, as = 'button', href, size = 'md' }: {
|
||||
active?: boolean; children: ReactNode; onClick?: () => void; className?: string; title?: string
|
||||
disabled?: boolean; as?: 'button' | 'a' | 'span'; href?: string
|
||||
disabled?: boolean; as?: 'button' | 'a' | 'span'; href?: string; size?: 'md' | 'sm'
|
||||
}) {
|
||||
const classes = cn('inline-flex items-center justify-center gap-[5px] h-(--ctl-h-md) px-2 text-tiny rounded-pill '
|
||||
+ 'border whitespace-nowrap shrink-0 no-underline transition-colors duration-150',
|
||||
const classes = cn('inline-flex items-center justify-center border whitespace-nowrap shrink-0 no-underline '
|
||||
+ 'transition-colors duration-150',
|
||||
// sm 档存在的唯一理由:卡片元信息行里「可点的标签」和「只读的标签」必须同高同形,
|
||||
// 而 31px 的默认档会把那一行撑成工具条。尺寸取自标签令牌,不在这儿重复一遍数字。
|
||||
size === 'sm'
|
||||
? cn(TAG_DENSE, 'min-h-(--tag-h) px-(--tag-px) gap-(--tag-gap) [font-size:var(--tag-text)] rounded-chip')
|
||||
: 'h-(--ctl-h-md) px-2 gap-[5px] text-tiny rounded-pill',
|
||||
active ? 'bg-accent-fill border-accent-fill text-on-accent font-bold'
|
||||
: 'bg-raise border-line-strong text-ink-3 hover:bg-active hover:text-ink',
|
||||
disabled && 'opacity-40 cursor-not-allowed', className)
|
||||
|
|
|
|||
|
|
@ -3,41 +3,50 @@ import { cn } from '../../lib/cn'
|
|||
import { statusLabel, statusTone } from '../../lib/format'
|
||||
|
||||
/**
|
||||
* 状态胶囊。
|
||||
* 标签体系(docs/UI规范.md §2)。
|
||||
*
|
||||
* 旧站用 `:class="statusClass(x)"` 把 CSS 类名字符串拼进 markup,色调含义藏在
|
||||
* format.ts 的返回值里;React 侧改成显式的 tone:色调怎么配色只在这里有一份,
|
||||
* 页面只负责把业务枚举翻译成 tone(lib/format.ts 的 statusTone())。
|
||||
* 症状:同一个「这是什么 / 现在到哪」的小方块站内有三套写法——
|
||||
* Tag(text-tiny + py-0.5)、Status(text-tiny + py-[3px] 无边框)、
|
||||
* 以及各页面手抄的 rounded-pill span;同一行里 16/18/21px 混排,
|
||||
* 和旁边的 12px 正文、31px chip 挤在一起,间距全靠页面临场发挥。
|
||||
* 做法:**一个尺寸配方 + 一张色板**,Tag / Status / Badge 共用同一个壳,
|
||||
* 于是三种标签混排也严格等高;成排出现时用 TagGroup 拿到统一间距。
|
||||
* 高度只由 min-height 决定(Tailwind 的 border-box),不写 padding-block:
|
||||
* 写 padding 的话字号一变高度就跟着变,又会回到「三套高度」。
|
||||
* 分工(别再新增第四种):
|
||||
* Tag 只读名词标签——「竖屏」「已锁定」这类「它是什么」
|
||||
* Status 只读状态标签——后端状态枚举经 statusTone() 映射成色调
|
||||
* Badge 数字气泡——计数,挂在标题右侧
|
||||
* Chip 可点的筛选 / 开关胶囊(31px,ui/Controls.tsx)
|
||||
* TagChip 可移除的选中态胶囊(多选回显,31px,ui/Controls.tsx)
|
||||
*/
|
||||
export type Tone = 'completed' | 'failed' | 'running' | 'queued' | ''
|
||||
export type TagSize = 'sm' | 'md'
|
||||
|
||||
const TONES: Record<Tone, string> = {
|
||||
completed: 'bg-accent-tint-2 text-success',
|
||||
failed: 'bg-danger-tint text-danger',
|
||||
running: 'bg-warn-tint text-warn-bright',
|
||||
queued: 'bg-info-tint text-info',
|
||||
'': 'bg-active text-ink-2'
|
||||
}
|
||||
/**
|
||||
* 密集档。两档的圆角、边框、行高完全相同,只有高度、内边距、间隙和字号不同,
|
||||
* 所以混排仍然同形;sm 给密度高的地方——表格单元格、缩略图角标、一行挤五六个的元信息行。
|
||||
*
|
||||
* 档位是**挂在容器上的 CSS 变量**(同 --ctl-h 的规矩),不是每个标签的类名:
|
||||
* `<TagGroup size="sm">` 或 `<td className={TAG_DENSE}>` 一挂,整片标签一起降,
|
||||
* 往表格里加标签的人不必再记一遍尺寸。单独一个标签要降档就写 size="sm"。
|
||||
*/
|
||||
export const TAG_DENSE = '[--tag-h:var(--tag-h-sm)] [--tag-px:var(--tag-px-sm)] '
|
||||
+ '[--tag-gap:var(--tag-gap-sm)] [--tag-text:var(--tag-text-sm)]'
|
||||
|
||||
export function Status({ value, tone, children, className }: {
|
||||
value?: string | null
|
||||
tone?: Tone
|
||||
children?: ReactNode
|
||||
className?: string
|
||||
}) {
|
||||
const resolved: Tone = tone ?? (value ? statusTone(value) : '')
|
||||
return (
|
||||
<span className={cn('text-tiny rounded-chip px-1.5 py-[3px] whitespace-nowrap inline-flex items-center gap-1',
|
||||
TONES[resolved], className)}>
|
||||
{children ?? statusLabel(value)}
|
||||
</span>
|
||||
)
|
||||
}
|
||||
/**
|
||||
* 尺寸全部来自令牌,标签自己不写 padding-block:高度只由 min-height 决定。
|
||||
*
|
||||
* 字号写成任意属性 `[font-size:var(--tag-text)]` 而不是 `text-(length:--tag-text)`:
|
||||
* tailwind-merge 认为「带任意值的 text-*」可能同时携带行高,会把前面的
|
||||
* `leading-[1.45]` 判成冲突吃掉(DOM 里leading 莫名消失就是这么来的)。
|
||||
*/
|
||||
const SHELL = 'inline-flex items-center align-middle whitespace-nowrap rounded-chip border leading-[1.45] '
|
||||
+ 'min-h-(--tag-h) px-(--tag-px) gap-(--tag-gap) [font-size:var(--tag-text)]'
|
||||
|
||||
/** 语义标签(.tag / .tag.ok / .bad / .warn / .info):比 Status 更轻,用于「这是什么东西」而不是「进行到哪」 */
|
||||
/** 语义色(旧站 .tag / .tag.ok / .bad / …):default 是中性名词,色调只给有语义的字段 */
|
||||
export type TagTone = 'default' | 'ok' | 'bad' | 'warn' | 'info' | 'accent' | 'mono'
|
||||
|
||||
const TAG_TONES: Record<TagTone, string> = {
|
||||
const TONES: Record<TagTone, string> = {
|
||||
default: 'bg-line-soft text-ink-3 border-line',
|
||||
ok: 'bg-success-tint text-success border-success-line',
|
||||
bad: 'bg-danger-tint-2 text-danger border-danger-line',
|
||||
|
|
@ -47,22 +56,84 @@ const TAG_TONES: Record<TagTone, string> = {
|
|||
mono: 'bg-line-soft text-ink-3 border-line font-mono'
|
||||
}
|
||||
|
||||
export function Tag({ tone = 'default', children, className, title }: {
|
||||
export function Tag({ tone = 'default', size = 'md', icon, children, className, title }: {
|
||||
tone?: TagTone
|
||||
size?: TagSize
|
||||
/** 前导图标(文本图标或小 svg),与文字之间是 SIZES 里的固定间隙 */
|
||||
icon?: ReactNode
|
||||
children?: ReactNode
|
||||
className?: string
|
||||
title?: string
|
||||
}) {
|
||||
return <span title={title} className={cn('text-tiny px-1.5 py-0.5 rounded-chip border whitespace-nowrap inline-flex items-center gap-1', TAG_TONES[tone], className)}>{children}</span>
|
||||
return (
|
||||
<span title={title} className={cn(SHELL, size === 'sm' && TAG_DENSE, TONES[tone], className)}>
|
||||
{icon}
|
||||
{children}
|
||||
</span>
|
||||
)
|
||||
}
|
||||
|
||||
/** 信息行小圆点徽标(数字气泡) */
|
||||
export function Badge({ children, tone = 'default', className }: { children: ReactNode; tone?: 'default' | 'ok' | 'bad' | 'warn'; className?: string }) {
|
||||
const tones = {
|
||||
default: 'bg-raise text-ink-2 border-line-strong',
|
||||
ok: 'bg-success-tint text-success border-success-line',
|
||||
bad: 'bg-danger-tint text-danger border-danger-line',
|
||||
warn: 'bg-warn-tint text-warn border-warn-line'
|
||||
}
|
||||
return <span className={cn('inline-flex items-center gap-1 rounded-pill border px-2 py-[1px] text-tiny font-semibold', tones[tone], className)}>{children}</span>
|
||||
/**
|
||||
* 状态胶囊:从前的 Status 有自己一套无边框、另一个行高的皮肤,
|
||||
* 和 Tag 并排时永远差 2~3px。现在它只剩「枚举 → 色调」这一层语义映射。
|
||||
*/
|
||||
export type Tone = 'completed' | 'failed' | 'running' | 'queued' | ''
|
||||
|
||||
const STATUS_TONES: Record<Tone, TagTone> = {
|
||||
completed: 'ok',
|
||||
failed: 'bad',
|
||||
running: 'warn',
|
||||
queued: 'info',
|
||||
'': 'default'
|
||||
}
|
||||
|
||||
export function Status({ value, tone, size, children, className }: {
|
||||
value?: string | null
|
||||
tone?: Tone
|
||||
size?: TagSize
|
||||
children?: ReactNode
|
||||
className?: string
|
||||
}) {
|
||||
const resolved: Tone = tone ?? (value ? statusTone(value) : '')
|
||||
return <Tag tone={STATUS_TONES[resolved]} size={size} className={className}>{children ?? statusLabel(value)}</Tag>
|
||||
}
|
||||
|
||||
/** 数字气泡:与标签同度量,只是收成 pill 并加粗 */
|
||||
export function Badge({ children, tone = 'default', size = 'md', className }: {
|
||||
children: ReactNode
|
||||
tone?: TagTone
|
||||
size?: TagSize
|
||||
className?: string
|
||||
}) {
|
||||
return (
|
||||
<span className={cn(SHELL, 'rounded-pill font-semibold', size === 'sm' && TAG_DENSE, TONES[tone], className)}>
|
||||
{children}
|
||||
</span>
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* 标签组:一排只读标签(或标签 + 说明文字)的横向流。
|
||||
*
|
||||
* 页面上手抄的 `flex flex-wrap gap-1` 有两种病:gap-1(4px)比标签自己的左右
|
||||
* 内边距还小,两个标签读起来像一个词被劈开;没有下边距时又直接贴住下面的面板。
|
||||
* 这里把「组内 6px、组与下方 12px」定死,行首说明文字用 label(同 ChipBar 的 label)。
|
||||
* 嵌在卡片里不想留 12px 时下边距交给 className="mb-0" 覆盖。
|
||||
* 别和 ChipBar 混用:ChipBar 装**可点**的 chip(31px),TagGroup 装**只读**标签。
|
||||
*/
|
||||
export function TagGroup({ children, label, size, className, top }: {
|
||||
children: ReactNode
|
||||
label?: ReactNode
|
||||
/** sm = 整组标签降到密集档;组内单个标签不用再写 size */
|
||||
size?: TagSize
|
||||
className?: string
|
||||
top?: boolean
|
||||
}) {
|
||||
return (
|
||||
<div className={cn('flex flex-wrap items-center gap-[6px] min-w-0 mb-3',
|
||||
size === 'sm' && TAG_DENSE, top && 'mt-3', className)}>
|
||||
{label && <span className="flex-none text-muted text-tiny tracking-[.6px] font-bold">{label}</span>}
|
||||
{children}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,6 +30,10 @@ export function Table({ children, className, minWidth = 720, pickable }: {
|
|||
这里把两种对齐写回同一层特异性关系,表头和它下面的数字列才对得上。 */
|
||||
'[&_th.text-right]:text-right [&_th.text-center]:text-center',
|
||||
'[&_td]:px-2 [&_td]:py-[9px] [&_td]:border-b [&_td]:border-line-soft [&_td]:align-middle',
|
||||
/* 表格是全站最密的地方:把标签档位令牌压到 sm,单元格里的 Tag / Status
|
||||
自动一起降一档(同 Ctlbar 压 --ctl-h 的思路),页面不用逐个写 size="sm"。 */
|
||||
'[&_td]:[--tag-h:var(--tag-h-sm)] [&_td]:[--tag-px:var(--tag-px-sm)] '
|
||||
+ '[&_td]:[--tag-gap:var(--tag-gap-sm)] [&_td]:[--tag-text:var(--tag-text-sm)]',
|
||||
'[&_tbody_tr:hover>td]:bg-panel',
|
||||
/* 整行是热区的表(账号列表、模型列表):指针形状说明「点这一行有用」 */
|
||||
pickable && '[&_tbody_tr]:cursor-pointer',
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ import { useRecordingBusy } from '../stores/recording'
|
|||
import {
|
||||
BarRight, Between, Button, Chip, ChipBar, Check, Ctlbar, Drawer, Empty, ErrorText, Field, FieldBlock,
|
||||
FilePick, FormRow, Grid, LINK_CLS, Modal, MONO, MUTED, MUTED_MONO, Notice, PageHead, Pager, Panel, PanelHead,
|
||||
Row, SectionTitle, Spinner, Tag, TEXTAREA_TALL, ViewBtn
|
||||
Row, SectionTitle, Spinner, Tag, TagGroup, TEXTAREA_TALL, ViewBtn
|
||||
} from '../components/ui'
|
||||
|
||||
type AssetType = 'human' | 'scene' | 'voice'
|
||||
|
|
@ -1259,17 +1259,17 @@ export default function AssetLibrary() {
|
|||
<p className="mt-[3px] mb-1 line-clamp-1 text-[10.5px] leading-[1.45] text-ink-3">
|
||||
{row.persona_prompt || row.appearance || row.description || row.prompt || row.voice_profile || '尚未填写设定。'}
|
||||
</p>
|
||||
<div className="flex gap-1 flex-nowrap overflow-hidden">
|
||||
<TagGroup size="sm" className="mb-0 flex-nowrap overflow-hidden">
|
||||
{(row.tags || []).slice(0, 4).map((tag: string) => (
|
||||
<button key={tag} type="button" className={TAG_CHIP} title={`只看标签「${tag}」`}
|
||||
onClick={() => patchFilters({ tag })}>{tag}</button>
|
||||
<Chip key={tag} size="sm" title={`只看标签「${tag}」`}
|
||||
onClick={() => patchFilters({ tag })}>{tag}</Chip>
|
||||
))}
|
||||
<ScopeTag row={row} />
|
||||
<Tag title={`共 ${row.media_count} 个素材,占 ${fmtBytes(row.media_bytes)}`}>
|
||||
{row.media_count} 素材 · {fmtBytes(row.media_bytes)}
|
||||
</Tag>
|
||||
<Tag>{row.style_version || row.version || 'v1'} · {fmtAgo(row.updated_at)}</Tag>
|
||||
</div>
|
||||
</TagGroup>
|
||||
</div>
|
||||
<div className="row-media flex items-center gap-[5px] shrink-0">
|
||||
{stripOf(row, 5).map((media: any) => (
|
||||
|
|
@ -1343,10 +1343,10 @@ export default function AssetLibrary() {
|
|||
{row.persona_prompt || row.appearance || row.description || row.prompt || row.voice_profile || '尚未填写设定。'}
|
||||
</p>
|
||||
|
||||
<div className="flex gap-1 flex-wrap">
|
||||
<TagGroup size="sm" className="mb-0">
|
||||
{(row.tags || []).slice(0, 5).map((tag: string) => (
|
||||
<button key={tag} type="button" className={TAG_CHIP} title={`只看标签「${tag}」`}
|
||||
onClick={() => patchFilters({ tag })}>{tag}</button>
|
||||
<Chip key={tag} size="sm" title={`只看标签「${tag}」`}
|
||||
onClick={() => patchFilters({ tag })}>{tag}</Chip>
|
||||
))}
|
||||
{type === 'human' && <Tag>{row.role || '角色'}</Tag>}
|
||||
{type === 'human' && !!row.default_voice_name && (
|
||||
|
|
@ -1360,7 +1360,7 @@ export default function AssetLibrary() {
|
|||
<Tag title={`共 ${row.media_count} 个素材,占 ${fmtBytes(row.media_bytes)}`}>
|
||||
{row.media_count} 素材 · {fmtBytes(row.media_bytes)}
|
||||
</Tag>
|
||||
</div>
|
||||
</TagGroup>
|
||||
|
||||
{!!stripOf(row).length && (
|
||||
<div className="mt-[10px] grid grid-cols-4 gap-[5px] max-narrow:grid-cols-2 min-w-0 [&>*]:min-w-0">
|
||||
|
|
@ -1382,14 +1382,16 @@ export default function AssetLibrary() {
|
|||
durationMs={media.duration_ms} hint={versionHint(media)} />
|
||||
</div>
|
||||
{flag && (
|
||||
<span title={flag.title} className={cn(TIMBRE_PILL, TIMBRE_TONES[flag.tone])}>
|
||||
<Tag size="sm" tone={flag.tone} title={flag.title}
|
||||
className="flex-none min-w-0 max-w-[40%] truncate">
|
||||
◈ {flag.label}
|
||||
</span>
|
||||
</Tag>
|
||||
)}
|
||||
{!!provenance && (
|
||||
<span title={provenance} className={cn(TIMBRE_PILL, TIMBRE_TONES.warn)}>
|
||||
<Tag size="sm" tone="warn" title={provenance}
|
||||
className="flex-none min-w-0 max-w-[40%] truncate">
|
||||
◌ AI 样本 · 非参考
|
||||
</span>
|
||||
</Tag>
|
||||
)}
|
||||
<Button variant="del" size="sm" square title="单独删除此音频(含全部历史版本)"
|
||||
aria-label="删除这条音频" onClick={() => void deleteMedia(media)}>×</Button>
|
||||
|
|
@ -2001,20 +2003,9 @@ const MEDIA_REMOVE = 'absolute right-[3px] top-[3px] grid place-items-center w-5
|
|||
+ 'bg-[color-mix(in_srgb,var(--c-danger-tint2)_91%,transparent)]'
|
||||
const FILE_TILE = 'flex flex-col justify-between p-[6px] rounded-[6px] bg-hover '
|
||||
+ '[&>b]:text-ink-2 [&>b]:text-tiny [&>span]:text-dim [&>span]:text-tiny'
|
||||
/** 卡内标签:点一下就是「只看这个标签」,所以它长得像链接而不像徽章 */
|
||||
const TAG_CHIP = 'px-[7px] py-[2px] text-tiny rounded-pill border border-line-strong bg-raise text-ink-3 '
|
||||
+ 'whitespace-nowrap hover:border-accent-line hover:text-ink'
|
||||
const SUMMARY = 'line-clamp-3 min-h-[46px] mt-[10px] mb-[7px] text-[10.5px] leading-[1.55] text-muted'
|
||||
/** 卡片右下角的「哪一版 / 什么时候改的」:等宽 + 截断,不参与挤压标题 */
|
||||
const STAMP = 'ml-auto min-w-0 max-w-[140px] truncate font-mono text-tiny text-dim'
|
||||
/** 音色徽标:AI 样本 / 性别不符这类提醒要贴着播放条,但不能把整行撑爆 */
|
||||
const TIMBRE_PILL = 'flex-none min-w-0 max-w-[40%] truncate whitespace-nowrap px-[6px] py-[1px] text-tiny '
|
||||
+ 'leading-[1.6] rounded-pill border'
|
||||
const TIMBRE_TONES: Record<'ok' | 'bad' | 'warn', string> = {
|
||||
ok: 'text-success border-success-line bg-success-tint',
|
||||
bad: 'text-danger border-danger-line bg-danger-tint',
|
||||
warn: 'text-warn border-warn-line bg-warn-tint'
|
||||
}
|
||||
/** 确认框里那段「动的是什么」:左边一条重色竖线,比整块描边更像一个引用块 */
|
||||
const IMPORT_SUBJECT = 'my-4 p-[11px_12px] border-l-2 border-l-accent-deep bg-card text-muted text-tiny '
|
||||
+ 'leading-[1.7] [&_b]:text-accent-bright'
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ import {
|
|||
Actions, Button, buttonCls, Chip, ChipBar, Ctlbar, Divider, Empty, ErrorText, Field,
|
||||
FieldBlock, FormRow, Grid, LINK_CLS, Loading, LogBox, LogRow, MONO, MUTED, PageHead, Panel,
|
||||
PanelHead, ProgressBar, Row, SectionTitle, Stat, StatGrid, Status, TabStack, Table, TableBox,
|
||||
Tag, TagChip, Value, cellRight, cellWrap
|
||||
Tag, TagChip, TagGroup, Value, cellRight, cellWrap
|
||||
} from '../components/ui'
|
||||
import {
|
||||
capabilityHint, capsOf, defaultFor, deliveryResolutions, fpsChoices, isMock, loadModels,
|
||||
|
|
@ -399,12 +399,12 @@ export default function Dashboard() {
|
|||
onToggle={toggleLibrary} onPick={togglePick}
|
||||
onRefresh={() => void loadLibrary(libType, true)} />
|
||||
|
||||
<ChipBar>
|
||||
<Chip as="span">可用档位 {videoCaps.resolutions.join(' / ') || '未声明'}</Chip>
|
||||
<Chip as="span">帧率 {videoCaps.fps || '未声明'}fps</Chip>
|
||||
<Chip as="span">单镜 {videoCaps.minDuration || '?'}–{videoCaps.maxDuration || '?'} 秒</Chip>
|
||||
<Chip as="span">参考图上限 {videoCaps.maxReferenceImages || '未声明'}</Chip>
|
||||
</ChipBar>
|
||||
<TagGroup>
|
||||
<Tag>可用档位 {videoCaps.resolutions.join(' / ') || '未声明'}</Tag>
|
||||
<Tag>帧率 {videoCaps.fps || '未声明'}fps</Tag>
|
||||
<Tag>单镜 {videoCaps.minDuration || '?'}–{videoCaps.maxDuration || '?'} 秒</Tag>
|
||||
<Tag>参考图上限 {videoCaps.maxReferenceImages || '未声明'}</Tag>
|
||||
</TagGroup>
|
||||
{modelWarnings.map((w, i) => <ErrorText key={`w${i}`} className="mb-1">{w}</ErrorText>)}
|
||||
|
||||
<Actions>
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import { cn } from '../lib/cn'
|
|||
import { EyeIcon, SecretInput, Select } from '../components/forms'
|
||||
import {
|
||||
Between, Button, Check, Chip, ChipBar, Ctlbar, Drawer, Empty, Field, FieldBlock, FormRow, Grid, MONO,
|
||||
MUTED, Notice, PageHead, Panel, PanelHead, Row, SectionTitle, Slider, Spinner, Tag, buttonCls
|
||||
MUTED, Notice, PageHead, Panel, PanelHead, Row, SectionTitle, Slider, Spinner, Tag, TagGroup, buttonCls
|
||||
} from '../components/ui'
|
||||
import { useAuthStore } from '../stores/auth'
|
||||
import { useProjectStore } from '../stores/project'
|
||||
|
|
@ -619,17 +619,17 @@ export default function ModelCenter() {
|
|||
</Between>
|
||||
<p className="my-2 text-ink-3 text-caption leading-[1.55]">{probe.message || '—'}</p>
|
||||
{probe.queue && (
|
||||
<ChipBar>
|
||||
<Chip as="span">运行 {probe.queue.running}</Chip>
|
||||
<Chip as="span">排队 {probe.queue.pending}</Chip>
|
||||
</ChipBar>
|
||||
<TagGroup>
|
||||
<Tag tone={probe.queue.running ? 'info' : 'default'}>运行 {probe.queue.running}</Tag>
|
||||
<Tag>排队 {probe.queue.pending}</Tag>
|
||||
</TagGroup>
|
||||
)}
|
||||
{probe.nodes && (
|
||||
<ChipBar>
|
||||
<TagGroup>
|
||||
{Object.entries(probe.nodes).map(([node, ok]) => (
|
||||
<Chip key={node} as="span" active={!!ok}>{node} {ok ? '✓' : '缺'}</Chip>
|
||||
<Tag key={node} tone={ok ? 'ok' : 'bad'}>{node} {ok ? '✓' : '缺'}</Tag>
|
||||
))}
|
||||
</ChipBar>
|
||||
</TagGroup>
|
||||
)}
|
||||
{probe.files && (
|
||||
<div className="flex flex-col gap-[5px] mt-[10px] min-w-0">
|
||||
|
|
@ -1010,11 +1010,12 @@ function ModelCard({ row, rail, busy, canReveal, revealed, revealing, probing,
|
|||
</div>
|
||||
)}
|
||||
|
||||
<ChipBar>
|
||||
{(row.modes || []).slice(0, 5).map((mode: string) => <Chip key={mode} as="span">{mode}</Chip>)}
|
||||
{!!row.timeout_seconds && <Chip as="span">超时 {row.timeout_seconds}s</Chip>}
|
||||
{!!row.max_concurrency && <Chip as="span">并发 {row.max_concurrency}</Chip>}
|
||||
</ChipBar>
|
||||
{/* 这些是「这张卡是什么配置」的只读标签,不是可点的筛选项:用 Tag,不用 ChipBar / Chip */}
|
||||
<TagGroup size="sm">
|
||||
{(row.modes || []).slice(0, 5).map((mode: string) => <Tag key={mode}>{mode}</Tag>)}
|
||||
{!!row.timeout_seconds && <Tag>超时 {row.timeout_seconds}s</Tag>}
|
||||
{!!row.max_concurrency && <Tag>并发 {row.max_concurrency}</Tag>}
|
||||
</TagGroup>
|
||||
|
||||
{row.notes && <p className="mt-[9px] mb-0 text-faint text-tiny leading-[1.5]">{row.notes}</p>}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,9 +9,9 @@ import { fmtAgo, fmtMoney, statusLabel } from '../../lib/format'
|
|||
import { useAutoRefresh } from '../../hooks'
|
||||
import { Select } from '../../components/forms'
|
||||
import {
|
||||
Actions, Between, Button, buttonCls, Check, Chip, ChipBar, Ctlbar, Divider, ErrorText, Field,
|
||||
Actions, Between, Button, buttonCls, Check, Chip, Ctlbar, Divider, ErrorText, Field,
|
||||
Layout, MONO, MUTED, MUTED_MONO, Panel, PanelHead, ProgressBar, Row, Spinner, Status, TabStack,
|
||||
Table, TableBox, Tag, cellCenter, cellRight, cellWrap
|
||||
Table, TableBox, Tag, TagGroup, cellCenter, cellRight, cellWrap
|
||||
} from '../../components/ui'
|
||||
import { refresh, useProjectStore } from '../../stores/project'
|
||||
import { useSystemStore } from '../../stores/system'
|
||||
|
|
@ -212,16 +212,16 @@ export default function Dispatch() {
|
|||
<PanelHead title="分镜任务清单"
|
||||
right={<><span className={MUTED}>预计成本 {fmtMoney(plan?.estimated_cost, plan?.currency)}</span>
|
||||
<Button variant="primary" disabled={!!busy} onClick={enqueue}>▶ 入队所选 / 全部待生成</Button></>} />
|
||||
<ChipBar>
|
||||
<Chip as="span">待入队 {enqueueable.length}</Chip>
|
||||
<Chip as="span">配音待生成 {voiceoverable.length}</Chip>
|
||||
<Chip as="span">已排队 {plan?.queued_count || 0}</Chip>
|
||||
<Chip as="span">阻塞 {plan?.blocked_count || 0}</Chip>
|
||||
<Chip as="span">跳过 {plan?.skipped_count || 0}</Chip>
|
||||
<Chip as="span">预检就绪 {plan?.preflight?.ready || 0}</Chip>
|
||||
<Chip as="span">预检告警 {plan?.preflight?.warnings || 0}</Chip>
|
||||
<Chip as="span">预计 {plan?.voiceover_count || 0} 条配音</Chip>
|
||||
</ChipBar>
|
||||
<TagGroup>
|
||||
<Tag>待入队 {enqueueable.length}</Tag>
|
||||
<Tag>配音待生成 {voiceoverable.length}</Tag>
|
||||
<Tag>已排队 {plan?.queued_count || 0}</Tag>
|
||||
<Tag tone={plan?.blocked_count ? 'bad' : 'default'}>阻塞 {plan?.blocked_count || 0}</Tag>
|
||||
<Tag>跳过 {plan?.skipped_count || 0}</Tag>
|
||||
<Tag tone="ok">预检就绪 {plan?.preflight?.ready || 0}</Tag>
|
||||
<Tag tone={plan?.preflight?.warnings ? 'warn' : 'default'}>预检告警 {plan?.preflight?.warnings || 0}</Tag>
|
||||
<Tag>预计 {plan?.voiceover_count || 0} 条配音</Tag>
|
||||
</TagGroup>
|
||||
<TableBox maxHeight={360}>
|
||||
<Table minWidth={860}>
|
||||
<thead>
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ import {
|
|||
Actions, BarRight, Between, buttonCls, Button, CARD_ROW, Check, Chip, ChipBar, Ctlbar, Divider, Drawer,
|
||||
Empty, ErrorText, Field, FieldBlock, FilePick, FormRow, LineHint, LINK_CLS, MONO, MUTED, MUTED_MONO, Panel,
|
||||
PanelHead,
|
||||
Row, SectionTitle, Spinner, TabStack, Table, TableBox, Tag, TEXTAREA_TALL, cellRight, cellWrap
|
||||
Row, SectionTitle, Spinner, TabStack, Table, TableBox, Tag, TagGroup, TEXTAREA_TALL, cellRight, cellWrap
|
||||
} from '../../components/ui'
|
||||
import { useSystemStore } from '../../stores/system'
|
||||
import { refresh, useProjectStore } from '../../stores/project'
|
||||
|
|
@ -1374,16 +1374,16 @@ function UsageLine({ type, id, usage, projectId, limit = 5 }: {
|
|||
usage: { count: number; shots: any[] }
|
||||
}) {
|
||||
return (
|
||||
<div className="flex items-center flex-wrap gap-[5px] mt-2">
|
||||
<TagGroup size="sm" className="mb-0 mt-2">
|
||||
<Tag tone={usage.count ? 'ok' : 'default'}>被 {usage.count} 个镜头使用</Tag>
|
||||
{(usage.shots || []).slice(0, limit).map((shot: any) => (
|
||||
<Link key={shot.id} to={`/projects/${projectId}/storyboard?shot=${shot.id}`}
|
||||
title={`跳转到分镜 #${shot.order_index}`}
|
||||
className="text-success text-tiny px-[6px] py-[3px] border border-accent-tint-2 rounded-chip bg-raised no-underline hover:border-accent-deep hover:text-accent-bright">
|
||||
#{shot.order_index} {shot.title}
|
||||
className="no-underline hover:[&_span]:border-accent-deep hover:[&_span]:text-accent-bright">
|
||||
<Tag>#{shot.order_index} {shot.title}</Tag>
|
||||
</Link>
|
||||
))}
|
||||
</div>
|
||||
</TagGroup>
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ import { Select } from '../../components/forms'
|
|||
import {
|
||||
Actions, Button, CardRow, Chip, ChipBar, Ctlbar, Divider, ErrorText, Field, FieldBlock, FormRow, Grid,
|
||||
Layout, LINK_CLS, LogBox, LogRow, MONO, MUTED, MUTED_MONO, Panel, PanelHead, Row, Stack, Stat,
|
||||
TabStack, Table, TableBox, Tag, Value, buttonCls, cellCenter, cellWrap
|
||||
TabStack, Table, TableBox, Tag, TagGroup, Value, buttonCls, cellCenter, cellWrap
|
||||
} from '../../components/ui'
|
||||
import type { GridStep } from '../../components/ui'
|
||||
import AgentConsole from './AgentConsole'
|
||||
|
|
@ -400,13 +400,13 @@ export default function Overview() {
|
|||
</Field>
|
||||
</FormRow>
|
||||
|
||||
<ChipBar>
|
||||
<Chip as="span">生成模式 {modeLabels}</Chip>
|
||||
<Chip as="span">可用档位 {videoCaps.resolutions.join(' / ') || '未声明'}</Chip>
|
||||
<Chip as="span">帧率 {videoCaps.fps || '未声明'}fps</Chip>
|
||||
<Chip as="span">单镜 {videoCaps.minDuration || '?'}–{videoCaps.maxDuration || '?'} 秒</Chip>
|
||||
<Chip as="span">参考图上限 {videoCaps.maxReferenceImages || '未声明'}</Chip>
|
||||
</ChipBar>
|
||||
<TagGroup>
|
||||
<Tag>生成模式 {modeLabels}</Tag>
|
||||
<Tag>可用档位 {videoCaps.resolutions.join(' / ') || '未声明'}</Tag>
|
||||
<Tag>帧率 {videoCaps.fps || '未声明'}fps</Tag>
|
||||
<Tag>单镜 {videoCaps.minDuration || '?'}–{videoCaps.maxDuration || '?'} 秒</Tag>
|
||||
<Tag>参考图上限 {videoCaps.maxReferenceImages || '未声明'}</Tag>
|
||||
</TagGroup>
|
||||
{modelWarnings.map((w, i) => <ErrorText key={`mw${i}`}>{w}</ErrorText>)}
|
||||
|
||||
<FieldBlock label="简介">
|
||||
|
|
|
|||
|
|
@ -14,9 +14,9 @@ import { Select } from '../../components/forms'
|
|||
import { AudioPlay } from '../../components/media/AudioPlay'
|
||||
import { MediaThumb } from '../../components/media/MediaThumb'
|
||||
import {
|
||||
Actions, Between, Button, Check, Chip, ChipBar, Ctlbar, Divider, Empty, ErrorText, Field, FieldBlock,
|
||||
Actions, Between, Button, Check, ChipBar, Ctlbar, Divider, Empty, ErrorText, Field, FieldBlock,
|
||||
FormRow, Grid, Layout, LineHint, MONO, MUTED, MUTED_MONO, Panel, PanelHead, ProgressBar, Row,
|
||||
Spinner, Status, TabStack, Table, TableBox, Tag, cellCenter, cellRight, cellWrap
|
||||
Spinner, Status, TabStack, Table, TableBox, Tag, TagGroup, cellCenter, cellRight, cellWrap
|
||||
} from '../../components/ui'
|
||||
import { refresh, useProjectStore } from '../../stores/project'
|
||||
import { notify } from '../../stores/notice'
|
||||
|
|
@ -214,14 +214,14 @@ export default function Review() {
|
|||
return (
|
||||
<TabStack>
|
||||
<Between>
|
||||
<Row>
|
||||
<Chip as="span">已质检 {qc?.checked ?? 0}</Chip>
|
||||
<Chip as="span">通过 {qc?.passed ?? 0}</Chip>
|
||||
<Chip as="span">不合格 {qc?.failed ?? 0}</Chip>
|
||||
<Chip as="span">平均分 {qc?.average_score ?? '—'}</Chip>
|
||||
<Chip as="span">待人工审核 {approvable.length}</Chip>
|
||||
<Chip as="span">被驳回 {rejected.length}</Chip>
|
||||
</Row>
|
||||
<TagGroup className="mb-0">
|
||||
<Tag>已质检 {qc?.checked ?? 0}</Tag>
|
||||
<Tag tone={qc?.passed ? 'ok' : 'default'}>通过 {qc?.passed ?? 0}</Tag>
|
||||
<Tag tone={qc?.failed ? 'bad' : 'default'}>不合格 {qc?.failed ?? 0}</Tag>
|
||||
<Tag>平均分 {qc?.average_score ?? '—'}</Tag>
|
||||
<Tag tone={approvable.length ? 'warn' : 'default'}>待人工审核 {approvable.length}</Tag>
|
||||
<Tag tone={rejected.length ? 'bad' : 'default'}>被驳回 {rejected.length}</Tag>
|
||||
</TagGroup>
|
||||
<Row>
|
||||
{busy ? <span className={MUTED}><Spinner /> {busy}…</span> : null}
|
||||
<Button variant="outline" size="sm" disabled={!!busy} onClick={qcAll}>↻ 全量重跑质检</Button>
|
||||
|
|
@ -306,16 +306,20 @@ export default function Review() {
|
|||
: <Empty>该镜头还没有生成产物,请先在调度中心生成。</Empty>}
|
||||
|
||||
{current.output_url
|
||||
? <ChipBar top>
|
||||
{/* 音源提示是一整句话: nowrap 的 chip 在 341px 的右栏里会顶出整页横向滚动,
|
||||
所以这一条单独允许折行、允许被压缩(其它短状态标签仍保持单行)。 */}
|
||||
<Tag tone={current.preview_url ? 'ok' : 'warn'}
|
||||
className="min-w-0 max-w-full shrink whitespace-normal text-left leading-[1.55]">{audioSourceHint}</Tag>
|
||||
{current.voiceover_url && !current.preview_url && current.native_audio
|
||||
? <Button variant="outline" size="sm" disabled={!!busy} onClick={() => buildPreview(current)}>封装审片预览(用平台配音替换模型原声)</Button> : null}
|
||||
{current.preview_url
|
||||
? <Button variant="outline" size="sm" disabled={!!busy} onClick={() => buildPreview(current)}>重新封装预览</Button> : null}
|
||||
</ChipBar>
|
||||
? <>
|
||||
{/* 音源提示是一整句话:nowrap 的标签在 341px 的右栏里会顶出整页横向滚动,
|
||||
折了行的标签又变成「不知道该不该点」的假按钮。句子就该按句子排——
|
||||
用 LineHint 做说明行,胶囊只留给两三个词的短标签。 */}
|
||||
<LineHint className={`mt-3 mb-2 ${current.preview_url ? 'text-success' : 'text-warn-bright'}`}>
|
||||
{audioSourceHint}
|
||||
</LineHint>
|
||||
<ChipBar>
|
||||
{current.voiceover_url && !current.preview_url && current.native_audio
|
||||
? <Button variant="outline" size="sm" disabled={!!busy} onClick={() => buildPreview(current)}>封装审片预览(用平台配音替换模型原声)</Button> : null}
|
||||
{current.preview_url
|
||||
? <Button variant="outline" size="sm" disabled={!!busy} onClick={() => buildPreview(current)}>重新封装预览</Button> : null}
|
||||
</ChipBar>
|
||||
</>
|
||||
: null}
|
||||
|
||||
{evidenceStrips.length > 1
|
||||
|
|
@ -337,26 +341,26 @@ export default function Review() {
|
|||
</div>
|
||||
: null}
|
||||
|
||||
<ChipBar top>
|
||||
<TagGroup top>
|
||||
<Status value={current.status} />
|
||||
<Chip as="span">目标 {current.duration}s</Chip>
|
||||
<Chip as="span">模式 {opt('mode', current.mode)}</Chip>
|
||||
<Chip as="span">{current.effective_provider} / {current.effective_model || '默认'}</Chip>
|
||||
<Chip as="span">尝试 {current.attempts} 次</Chip>
|
||||
<Tag>目标 {current.duration}s</Tag>
|
||||
<Tag>模式 {opt('mode', current.mode)}</Tag>
|
||||
<Tag>{current.effective_provider} / {current.effective_model || '默认'}</Tag>
|
||||
<Tag>尝试 {current.attempts} 次</Tag>
|
||||
{current.voiceover_url ? <Tag tone="ok">已有配音</Tag> : null}
|
||||
</ChipBar>
|
||||
</TagGroup>
|
||||
|
||||
{checks.length ? (
|
||||
<>
|
||||
<ChipBar>
|
||||
<Chip as="span">总分 <b className={MONO}>{shotQc.score ?? '—'}</b></Chip>
|
||||
<Chip as="span">技术 <b className={MONO}>{shotQc.tech_score ?? '—'}</b></Chip>
|
||||
<TagGroup>
|
||||
<Tag>总分 <b className={MONO}>{shotQc.score ?? '—'}</b></Tag>
|
||||
<Tag>技术 <b className={MONO}>{shotQc.tech_score ?? '—'}</b></Tag>
|
||||
<Tag tone={!visualRan ? 'warn' : Number(shotQc.visual_score) >= 80 ? 'ok' : 'bad'}>画面 <b className={MONO}>{visualScoreText}</b></Tag>
|
||||
{visualProbe.visual_model ? <Chip as="span" className={MUTED_MONO}>{visualProbe.visual_model}</Chip> : null}
|
||||
{visualProbe.visual_model ? <Tag className={MUTED_MONO}>{visualProbe.visual_model}</Tag> : null}
|
||||
{visualProbe.visual_cast?.length
|
||||
? <Chip as="span">出场:{visualProbe.visual_cast.map((c: any) => `${c.name}${(c.frames || []).length ? `(${c.frames.join(',')})` : '·未出现'}`).join('、')}</Chip>
|
||||
? <Tag>出场:{visualProbe.visual_cast.map((c: any) => `${c.name}${(c.frames || []).length ? `(${c.frames.join(',')})` : '·未出现'}`).join('、')}</Tag>
|
||||
: null}
|
||||
</ChipBar>
|
||||
</TagGroup>
|
||||
|
||||
{visualChecks.length || visualRan
|
||||
? <VisualQc probe={visualProbe} checks={visualChecks} frames={frameUrls} frameItems={frameItems} note={visualSkipNote} />
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ import { openPreview, usePreviewOpen } from '../../stores/preview'
|
|||
import {
|
||||
Actions, BarRight, Between, Button, CARD_ROW, Check, Chip, ChipBar, Ctlbar, Divider, Empty, ErrorText,
|
||||
ExtLink, Field, FieldBlock, FilePick, FormRow, LINK_CLS, Loading, Mono, MUTED, MUTED_MONO, Notice,
|
||||
Panel, PanelHead, Row, SectionTitle, Spinner, Status, TabStack, Table, TableBox, Tabs, Tag, ViewBtn,
|
||||
Panel, PanelHead, Row, SectionTitle, Spinner, Status, TabStack, Table, TableBox, Tabs, Tag, TAG_DENSE, TagGroup, ViewBtn,
|
||||
buttonCls, cellCenter, cellRight, cellWrap, CloseButton, DRAWER_ACTIONS, DRAWER_BODY,
|
||||
DRAWER_HEAD
|
||||
} from '../../components/ui'
|
||||
|
|
@ -95,7 +95,9 @@ const THUMB_DUR = 'absolute top-[7px] right-[34px] rounded-chip bg-scrim-soft px
|
|||
+ 'text-[10px] leading-none text-ink-2'
|
||||
/** 卡片正文(.cardbody):说明两行截断,脚注靠 mt-auto 永远贴底对齐 */
|
||||
const SHOT_BODY = 'flex min-w-0 flex-1 flex-col gap-[7px] p-[11px_12px_12px]'
|
||||
const SHOT_META = 'flex flex-wrap items-center gap-[5px] text-tiny text-faint'
|
||||
// 元信息行是卡片里最挤的一行,标签整排降到 sm 档;组内间距与 TagGroup 同规格(6px),
|
||||
// 不再用页面临时抄的 5px。档位挂在容器上,行里新增标签不用再记一遍尺寸。
|
||||
const SHOT_META = cn('flex flex-wrap items-center gap-[6px] text-tiny text-faint', TAG_DENSE)
|
||||
const SHOT_FOOT = 'mt-auto flex items-center gap-[5px] pt-1'
|
||||
/** 预检阻塞条(.issues):左侧一道红线,比整块涂红省注意力 */
|
||||
const SHOT_ISSUES = 'flex flex-col gap-[2px] rounded-control border-l-2 border-danger-line bg-panel px-[7px] py-[3px] '
|
||||
|
|
@ -1188,10 +1190,10 @@ export default function Storyboard() {
|
|||
accept="image/*,.zip" multiple onFiles={(files) => setImageFiles(files)} />
|
||||
</FieldBlock>
|
||||
{imageFiles.length ? (
|
||||
<ChipBar>
|
||||
{imageFiles.slice(0, 12).map((f) => <Chip as="span" key={f.name}>{f.name}</Chip>)}
|
||||
{imageFiles.length > 12 ? <Chip as="span">+{imageFiles.length - 12}</Chip> : null}
|
||||
</ChipBar>
|
||||
<TagGroup className="mb-0 mt-2">
|
||||
{imageFiles.slice(0, 12).map((f) => <Tag key={f.name}>{f.name}</Tag>)}
|
||||
{imageFiles.length > 12 ? <Tag>+{imageFiles.length - 12}</Tag> : null}
|
||||
</TagGroup>
|
||||
) : null}
|
||||
<Ctlbar>
|
||||
<Field label="默认时长(秒)" width="narrow">
|
||||
|
|
@ -1941,9 +1943,9 @@ function ShotCard({
|
|||
onClick={(ev) => ev.stopPropagation()}
|
||||
onChange={(ev) => onCheck((ev.nativeEvent as MouseEvent).shiftKey)} />
|
||||
{s.output_url
|
||||
? <span className="absolute bottom-2 left-[7px] rounded-[4px] bg-success-tint px-[6px] py-[3px] text-tiny text-success">已生成</span>
|
||||
? <Tag size="sm" tone="ok" className="absolute bottom-2 left-[7px]">已生成</Tag>
|
||||
: (s.mode !== 't2v' && !s.keyframe_url
|
||||
? <span className="absolute bottom-2 left-[7px] rounded-[4px] bg-warn-tint px-[6px] py-[3px] text-tiny text-warn">缺关键帧</span>
|
||||
? <Tag size="sm" tone="warn" className="absolute bottom-2 left-[7px]">缺关键帧</Tag>
|
||||
: null)}
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,8 @@ import { openPreview } from '../../stores/preview'
|
|||
import {
|
||||
Actions, Between, Button, Check, Chip, ChipBar, Ctlbar, Divider, Empty, ErrorText, ExtLink, Field,
|
||||
FieldBlock, FilePick, FormRow, Grid, IssueRow, Layout, LineHint, MONO, MUTED, MUTED_MONO, Mono, Panel,
|
||||
PanelHead, Row, SectionTitle, Spinner, TabStack, Table, TableBox, Tag, Value, cellCenter, cellRight
|
||||
PanelHead, Row, SectionTitle, Spinner, Status, TabStack, Table, TableBox, Tag, TagGroup, Value,
|
||||
cellCenter, cellRight
|
||||
} from '../../components/ui'
|
||||
|
||||
const SUBTITLE_MODES = [
|
||||
|
|
@ -384,13 +385,16 @@ export default function Timeline() {
|
|||
{timeline ? (
|
||||
<Row>
|
||||
<b>{timeline.name}</b>
|
||||
<Tag tone="info">v{timeline.version}{timeline.is_current ? ' · 当前' : ' · 历史版本'}</Tag>
|
||||
<Chip as="span">{segments.length} 段</Chip>
|
||||
<Chip as="span">总时长 {fmtMs(timeline.total_duration_ms)}</Chip>
|
||||
<Chip as="span">{timeline.width}×{timeline.height} @{timeline.fps}</Chip>
|
||||
<Chip as="span">字幕 {subtitles.length}</Chip>
|
||||
<Chip as="span">音轨 {clips.length}</Chip>
|
||||
{report && <Tag tone={report.ready ? 'ok' : 'bad'}>{report.ready ? '可导出' : '存在阻塞'}</Tag>}
|
||||
{/* 这一段全是只读回显,用 TagGroup 收进同一档;Chip 留给真正能点的东西 */}
|
||||
<TagGroup className="mb-0">
|
||||
<Tag tone="info">v{timeline.version}{timeline.is_current ? ' · 当前' : ' · 历史版本'}</Tag>
|
||||
<Tag>{segments.length} 段</Tag>
|
||||
<Tag>总时长 {fmtMs(timeline.total_duration_ms)}</Tag>
|
||||
<Tag>{timeline.width}×{timeline.height} @{timeline.fps}</Tag>
|
||||
<Tag>字幕 {subtitles.length}</Tag>
|
||||
<Tag>音轨 {clips.length}</Tag>
|
||||
{report && <Tag tone={report.ready ? 'ok' : 'bad'}>{report.ready ? '可导出' : '有阻塞'}</Tag>}
|
||||
</TagGroup>
|
||||
</Row>
|
||||
) : <Row><span className={MUTED}>尚未构建时间线</span></Row>}
|
||||
<Row tight>
|
||||
|
|
@ -430,13 +434,13 @@ export default function Timeline() {
|
|||
仅收录审核合格的镜头
|
||||
</Check>
|
||||
</Ctlbar>
|
||||
<ChipBar>
|
||||
<Chip as="span">有产物镜头 {buildable.length}</Chip>
|
||||
<Chip as="span">已审核合格 {stats?.shots_approved ?? 0}</Chip>
|
||||
<TagGroup>
|
||||
<Tag>有产物镜头 {buildable.length}</Tag>
|
||||
<Tag>已审核合格 {stats?.shots_approved ?? 0}</Tag>
|
||||
<Button variant="outline" size="sm" onClick={selectAllBuildable}>
|
||||
{build.shot_ids.length === buildable.length ? '清空指定' : '指定全部镜头'}
|
||||
</Button>
|
||||
</ChipBar>
|
||||
</TagGroup>
|
||||
<ChipBar>
|
||||
{buildable.map((s: any) => (
|
||||
<Chip key={s.id} active={build.shot_ids.includes(s.id)} onClick={() => toggleBuildShot(s.id)}>
|
||||
|
|
@ -455,18 +459,18 @@ export default function Timeline() {
|
|||
|
||||
<Panel>
|
||||
<PanelHead title="交付预检报告"
|
||||
right={report ? <Tag tone={report.ready ? 'ok' : 'bad'}>{report.ready ? 'READY' : 'BLOCKED'}</Tag> : undefined} />
|
||||
right={report ? <Tag tone={report.ready ? 'ok' : 'bad'}>{report.ready ? '可导出' : '有阻塞'}</Tag> : undefined} />
|
||||
{!report && <Empty>构建时间线后生成报告。</Empty>}
|
||||
{report && (
|
||||
<>
|
||||
<ChipBar>
|
||||
<Chip as="span">片段 {report.segments}</Chip>
|
||||
<Chip as="span">字幕 {report.subtitles}</Chip>
|
||||
<Chip as="span">配音 {report.voice_clips}</Chip>
|
||||
<Chip as="span">BGM {report.bgm_clips}</Chip>
|
||||
<Chip as="span">总时长 {fmtMs(report.total_duration_ms)}</Chip>
|
||||
<Chip as="span">字幕 {subtitleModeLabel(report.subtitle_mode || (report.burn_subtitle ? 'burn' : 'sidecar'))}</Chip>
|
||||
</ChipBar>
|
||||
<TagGroup>
|
||||
<Tag>片段 {report.segments}</Tag>
|
||||
<Tag>字幕 {report.subtitles}</Tag>
|
||||
<Tag>配音 {report.voice_clips}</Tag>
|
||||
<Tag>BGM {report.bgm_clips}</Tag>
|
||||
<Tag>总时长 {fmtMs(report.total_duration_ms)}</Tag>
|
||||
<Tag>字幕 {subtitleModeLabel(report.subtitle_mode || (report.burn_subtitle ? 'burn' : 'sidecar'))}</Tag>
|
||||
</TagGroup>
|
||||
<Divider />
|
||||
{!report.issues?.length
|
||||
? <Value>✔ 没有阻塞项,可直接前往「导出与成本」出片。</Value>
|
||||
|
|
@ -797,14 +801,14 @@ function SegmentRow({ seg, i, count, item, queue, shot, transitions, busy, open,
|
|||
<div className="flex flex-wrap items-center gap-[5px_9px]">
|
||||
<h4 className="m-0 text-[12.5px] font-semibold">{seg.label}</h4>
|
||||
<Mono className={MUTED}>{fmtMs(seg.start_ms)} → {fmtMs(seg.start_ms + seg.duration_ms)}</Mono>
|
||||
<Chip as="span">源 {fmtMs(seg.source_in_ms)}–{fmtMs(seg.source_out_ms)}</Chip>
|
||||
<Tag>源 {fmtMs(seg.source_in_ms)}–{fmtMs(seg.source_out_ms)}</Tag>
|
||||
{hasVoice && (
|
||||
<Tag tone={native ? 'info' : 'ok'}
|
||||
title={native ? '台词直接用模型自带音轨,与口型天然同步' : '台词用平台配音(TTS),片段按配音长度补足'}>
|
||||
{native ? '原声' : '配音'}
|
||||
</Tag>
|
||||
)}
|
||||
{shot && <Chip as="span">{statusLabel(shot.status)}</Chip>}
|
||||
{shot && <Status value={shot.status} />}
|
||||
{seg.muted && <Tag tone="warn">静音</Tag>}
|
||||
{!!seg.transition_out && seg.transition_out !== 'cut' && (
|
||||
<Tag tone="info">{opt('transition', seg.transition_out)} {seg.transition_duration_ms}ms</Tag>
|
||||
|
|
|
|||
|
|
@ -164,6 +164,15 @@
|
|||
--ctl-h-main: 38px;
|
||||
--ctl-h-md: 31px;
|
||||
--ctl-h: var(--ctl-h-main);
|
||||
/* 标签度量(ui/Status.tsx 的 Tag / Status / Badge 与紧凑档 Chip 共用)。
|
||||
规矩和 --ctl-h 一模一样:尺寸不写在标签上,容器(TagGroup、密集表格)
|
||||
把 --tag-* 压到 sm 档,整片标签一起降;于是同一行里三种标签严格等高。 */
|
||||
--tag-h-main: 20px; --tag-px-main: 7px; --tag-gap-main: 5px; --tag-text-main: 11px;
|
||||
--tag-h-sm: 18px; --tag-px-sm: 6px; --tag-gap-sm: 4px; --tag-text-sm: 10px;
|
||||
--tag-h: var(--tag-h-main);
|
||||
--tag-px: var(--tag-px-main);
|
||||
--tag-gap: var(--tag-gap-main);
|
||||
--tag-text: var(--tag-text-main);
|
||||
/* 裸 <select> 的下拉箭头:base.css 把 select 的 appearance 抹掉了,
|
||||
不自己画就变成一个「没有 ▼ 的文本框」(分页条的「每页」正是这样)。
|
||||
几何与 components/forms/Caret.tsx 完全一致,只有颜色跟着主题翻。 */
|
||||
|
|
|
|||
Loading…
Reference in New Issue