diff --git a/frontend/src/components/ui/Table.tsx b/frontend/src/components/ui/Table.tsx index 545b8a5..ee22bea 100644 --- a/frontend/src/components/ui/Table.tsx +++ b/frontend/src/components/ui/Table.tsx @@ -23,9 +23,30 @@ * (antd 在 scroll.y 下用的是 fixed 布局,没有 width 的列才拿剩余宽度)。 */ import type { ReactNode } from 'react' -import { Table as AntTable, type TableProps } from 'antd' +import { Grid as AntGrid, Table as AntTable, type TableProps } from 'antd' import { cn } from '../../lib/cn' +/** + * 表格窄档开关:<992(antd/tailwind 的 `lg`)返回 true。 + * + * 症状(2026-11 第 30 轮 · NEX 阶段 8.5 响应式收口):站内六张表的列宽预算是按 + * 1440 那把尺子算的(全宽表容器 1118),窄屏容器只剩 356 / 462 / 502, + * 定宽列合计 400–902 直接把长文列挤成 0 宽(tableaudit「横向溢出 546」), + * 或者整张表拖一条横向滚动条才能看完。 + * 做法:页面按档位给两套 columns——宽档(≥992)保持原来那份一字不动, + * 窄档把次要列并进主列的第二、三行(数据换位置,不失踪),长文列才有活路。 + * 为什么是 992:侧栏 224 + 正文左右 48 之后,992 视口的表容器实测 670, + * 是「全站那份定宽预算放得下」的最窄一档;992 以下实测只有 502 / 462 / 356, + * 而 768 那一档比 576 还窄(侧栏没折叠,正文被压到 462), + * 所以三档窄屏共用同一套精简列,不再按 576/768 细分。 + * 为什么用 Grid.useBreakpoint 而不是 CSS `max-lg:`:换的是**列定义**(少几列、 + * 单元格合成几行),不是显隐两个 DOM;两套 columns 只有一份在渲染, + * 表头与单元格的辅助技术朗读才不会读到藏起来的列。 + */ +export function useNarrowTable(): boolean { + return AntGrid.useBreakpoint().lg === false +} + /** 列定义:直接借用 antd 的类型,页面不需要(也不准)自己 import antd */ export type Column = NonNullable['columns']>[number] export type Columns = NonNullable['columns']> diff --git a/frontend/src/pages/Dashboard.tsx b/frontend/src/pages/Dashboard.tsx index 50ae15e..75acce6 100644 --- a/frontend/src/pages/Dashboard.tsx +++ b/frontend/src/pages/Dashboard.tsx @@ -465,7 +465,13 @@ export default function Dashboard() { : !filtered.length ? 还没有项目。点击右上角「新建长视频项目」开始。 : ( <> - {/* 窄屏换成卡片:940px 的表在手机上只能横向拖,进度和成本永远看不见 */} -
+
{filtered.map((p) => )}
diff --git a/frontend/src/pages/project/Delivery.tsx b/frontend/src/pages/project/Delivery.tsx index f949255..290dc29 100644 --- a/frontend/src/pages/project/Delivery.tsx +++ b/frontend/src/pages/project/Delivery.tsx @@ -10,7 +10,7 @@ import { fromExport } from '../../lib/media' import { useAutoRefresh } from '../../hooks' import { Select } from '../../components/forms' import { MediaThumb } from '../../components/media/MediaThumb' -import { PageHead, ActionGroup, Button, Clamp, Value, Chip, ErrorText, ExtLink, Field, FormGrid, FormRow, Grid, IconText, Info, Input, LineHint, OptionGrid, Toolbar, LINK_CLS, MONO, MUTED, MUTED_MONO, NumberInput, PageStack, Panel, PanelHead, Row, Spinner, Stat, StatGrid, Status, Table, Tag } from '../../components/ui' +import { PageHead, ActionGroup, Button, Clamp, Value, Chip, ErrorText, ExtLink, Field, FormGrid, FormRow, Grid, IconText, Info, Input, LineHint, OptionGrid, Toolbar, LINK_CLS, MONO, MUTED, MUTED_MONO, NumberInput, PageStack, Panel, PanelHead, Row, Spinner, Stat, StatGrid, Status, Table, Tag, useNarrowTable } from '../../components/ui' import { refresh, useProjectStore } from '../../stores/project' import { presetLabel, presets as FALLBACK_PRESETS, useSystemStore } from '../../stores/system' import { notify } from '../../stores/notice' @@ -54,6 +54,8 @@ export default function Delivery() { const [form, setForm] = useState({ presets: ['web_1080p'] as string[], name: '', subtitle_mode: '', timeline_id: '', priority: 2 }) const currency = costs?.currency || 'CNY' + /* 窄档表格开关(<992):本页四张表都换列定义,见各自 columns 上方的说明 */ + const narrow = useNarrowTable() const busyExports = exportList.filter((e) => ['queued', 'running', 'pending'].includes(e.status)) const succeeded = exportList.filter((e) => e.status === 'succeeded') const presetList: string[] = meta?.presets?.length ? meta.presets : FALLBACK_PRESETS @@ -284,7 +286,28 @@ export default function Delivery() { 去配置模型单价 )} - columns={[ + columns={narrow ? [ + /* ── 窄档(<992 · NEX 阶段 8.5 响应式收口之⑨「成本台账」)──────────────── + 四列定宽 118+128+96 = 342,430 的容器 356 ⇒「取值」实测只剩 14px + (开发库所有项目都还没配模型单价,这张表一直是空态,所以常驻探针 + 量不到它——它是待数据的潜在违规,不是已复现的违规)。 + 方案:维度与取值合成一列(取值是主语、维度是它的定语),金额与 + 记录数合成右对齐数字块;两列 244 定宽 + 取值列 112,仍然读得完。 */ + { title: '取值 / 维度', key: 'value', render: (_: any, row: any) => ( + <> + {row._mono + ? {row.key} + : {statusLabel(row.key)}} +
{row._dim}
+ + ) }, + { title: '金额 / 记录数', key: 'cost', width: 112, align: 'right', render: (_: any, row: any) => ( + <> +
{fmtMoney(row.cost, currency)}
+ {row.count} 条 + + ) } + ] : [ { title: '维度', key: 'dim', width: 118, className: MUTED, render: (_: any, row: any) => row._dim }, { title: '取值', key: 'value', render: (_: any, row: any) => ( row._mono ? {row.key} : statusLabel(row.key) @@ -305,7 +328,68 @@ export default function Delivery() { minWidth={0} dataSource={exportList} empty="还没有成片。先在时间线页通过交付预检,再回到这里出片。" - columns={[ + columns={narrow ? [ + /* ── 窄档(<992 · NEX 阶段 8.5 响应式收口之⑥「成片记录」)──────────────── + 数据特点:三五行成片,扫读顺序是「哪一份 / 出片成功没有 / 能不能播」。 + 宽档定宽合计 56+104+116+80+84+72+96+168 = 776,窄屏容器实测 356 ⇒ + 溢出 484,被挤成 0 宽的偏偏是片名那一列(tableaudit:名称 / 预设=0)。 + 方案:规格·时长·大小并进片名下的第三行,耗时与校验和收进同一行的 + 完整内容提示(排障时是复制用的字符串,不是扫读用的);「状态」标签 + 与预设元信息合成第二行——报错的行把第三行让给错误文本,成片参数 + 仍在 title 里。缩略图保留:它是这份记录唯一的画面证据,也是预览入口。 + 定宽只剩操作列 132(预览 66 + 下载 40 + 间距 8 + 内边距 16,实测值), + 片名列拿 224,扣掉缩略图 68 仍有 140px 正文,三行封顶 = 行高 82 ≤ 84。 */ + { title: '成片 / 状态', key: 'name', render: (_: any, rec: any) => { + const at = indexOfExport(rec) + const meta = `${rec.preset} · timeline#${rec.timeline_id} · task#${rec.task_id || '—'}` + const spec = `${rec.width || '?'}×${rec.height || '?'}${rec.fps ? ` @${rec.fps}` : ''}` + + ` · ${fmtMs(rec.duration_ms)} · ${fmtBytes(rec.size_bytes)}` + const full = `${spec} · 耗时 ${rec.elapsed_ms ? (rec.elapsed_ms / 1000).toFixed(1) + 's' : '—'}` + + ` · 校验和 ${(rec.checksum || '').slice(0, 10) || '—'}` + return ( +
+ +
+ {/* 阶段 8.5 第 3 项数据完整性回归补的一刀:宽档第 1 列就是 `#id` + (出片记录靠它对齐下载链接与工单),窄档原本这一列整个没了—— + 430 实测 missing: 65 / 78 / 79。并进片名行写成 `#65 片名`, + 与 ③「任务」列、⑦「生成记录」首列同一个写法(全站一致的 + 「编号 + 名称」一行式),不新增第二行 ⇒ 行高仍是 84 封顶。 */} + + #{rec.id} {rec.name} + + {/* 不留 mt-0.5:三行 22×3 已经把行高顶到 82,多这 2px 就破 84 红线 */} +
+ + {meta} +
+ {rec.error_message + ? {rec.error_message} + : + {rec.subtitle_burned ? `已烧字幕 · ${spec}` : spec} + } +
+
+ ) + } }, + { title: '操作', key: 'actions', width: 132, align: 'right', render: (_: any, rec: any) => ( + + {rec.status === 'succeeded' && ( + <> + + 下载 + + )} + {rec.status !== 'succeeded' && rec.task_id && ['failed', 'cancelled'].includes(rec.status) && ( + + )} + {rec.status !== 'succeeded' && !(rec.task_id && ['failed', 'cancelled'].includes(rec.status)) && ( + — + )} + + ) } + ] : [ { title: '#', key: 'id', width: 56, align: 'center', className: MONO, render: (_: any, rec: any) => rec.id }, /* 定宽列合计 776、容器 1118 ⇒ 这一列拿 ~342px,同时把原来 1184 的表宽收回容器内。 片名与「预设 · timeline# · task#」各占一行并封顶,全文挂 title: @@ -375,7 +459,48 @@ export default function Delivery() { minWidth={0} dataSource={generations} empty="暂无生成记录。" - columns={[ + columns={narrow ? [ + /* ── 窄档(<992 · NEX 阶段 8.5 响应式收口之⑦「生成记录」)──────────────── + 数据特点:43 行调用流水,一行的主语是「那次调用花了我多少钱」。 + 宽档定宽 68+132+168+84+96+68+104 = 720,容器 356 ⇒ 溢出 428, + 提示词列被挤成 0 宽(tableaudit:提示词=0)—— 而提示词正是这张表 + 唯一不可替换的内容(「每条记录都留下当时的模型与参数,可原样复现」)。 + 方案:编号/类型/镜头/模型 合成第一列三行(等宽字,读的是标识符); + 成本提到数值块第一行(这张表的主语),时长、相对时间跟在下面; + 尝试次数只在 >1 时出现,缀在镜头号后面——正常调用不需要占一列。 + 124 + 88 = 212 ⇒ 提示词在 430 拿 144(比宽档被挤成的 0 宽是质变), + 两行封顶 + 原文 title 不变。 */ + { title: '生成记录', key: 'shot', width: 124, className: MONO, render: (_: any, g: any) => ( + <> + #{g.id} {statusLabel(g.kind)} + + shot#{g.shot_id || '—'}{g.attempts > 1 ? ` · ${g.attempts} 次` : ''} + + {g.provider}/{g.model} + + ) }, + { title: '提示词', key: 'prompt', render: (_: any, g: any) => { + const prompt = g.prompt || '' + const params = g.params && Object.keys(g.params).length > 0 ? JSON.stringify(g.params) : '' + const refs = g.asset_paths?.length + ? `参考素材 ${g.asset_paths.length} 个 · job ${g.provider_job_id || '—'}` : '' + return ( + <> + {prompt} + {params || refs + ?
{params || refs}
+ : null} + + ) + } }, + { title: '成本 / 时间', key: 'cost', width: 88, align: 'right', className: MONO, render: (_: any, g: any) => ( + <> +
{fmtMoney(g.cost, g.currency || currency)}
+
{fmtSeconds(g.duration_seconds)}
+ {fmtAgo(g.created_at)} + + ) } + ] : [ { title: '#', key: 'id', width: 68, align: 'center', className: MONO, render: (_: any, g: any) => g.id }, { title: '镜头 / 类型', key: 'shot', width: 132, className: MONO, render: (_: any, g: any) => ( <>shot#{g.shot_id || '—'}
{statusLabel(g.kind)}
@@ -411,7 +536,33 @@ export default function Delivery() { maxHeight={280} minWidth={0} dataSource={shownCostItems} - columns={[ + columns={narrow ? [ + /* ── 窄档(<992 · NEX 阶段 8.5 响应式收口之⑧「计费明细」)──────────────── + 这张表要点「展开计费明细」才渲染,常驻探针看不见它,但七列定宽 + 68+120+180+96+104+104+140 = 812 在 430 的 356 容器里必然溢出 456。 + 方案同生成记录:标识合成一列、金额与时间合成一列,中间留给人读的 + 数量与单价(它解释金额怎么来的,不能省)。 */ + { title: '计费记录', key: 'kind', width: 124, render: (_: any, it: any) => ( + <> + #{it.id} {statusLabel(it.kind)} + {it.provider}/{it.model} + + ) }, + { title: '数量 / 单价', key: 'quantity', render: (_: any, it: any) => ( + <> + {it.quantity} {it.unit} +
+ × {fmtMoney(it.unit_price, it.currency || currency)}/{it.unit} +
+ + ) }, + { title: '金额 / 时间', key: 'cost', width: 96, align: 'right', className: MONO, render: (_: any, it: any) => ( + <> +
{fmtMoney(it.cost, it.currency || currency)}
+ {fmtAgo(it.created_at)} + + ) } + ] : [ { title: '#', key: 'id', width: 68, align: 'center', className: MONO, render: (_: any, it: any) => it.id }, { title: '类型', key: 'kind', width: 120, render: (_: any, it: any) => statusLabel(it.kind) }, { title: 'Provider / 模型', key: 'model', width: 180, className: MUTED_MONO, render: (_: any, it: any) => `${it.provider}/${it.model}` }, diff --git a/frontend/src/pages/project/Dispatch.tsx b/frontend/src/pages/project/Dispatch.tsx index 32f0559..0ec34e5 100644 --- a/frontend/src/pages/project/Dispatch.tsx +++ b/frontend/src/pages/project/Dispatch.tsx @@ -8,7 +8,7 @@ import * as api from '../../api/client' import { fmtAgo, fmtMoney, statusLabel } from '../../lib/format' import { useAutoRefresh } from '../../hooks' import { Select } from '../../components/forms' -import { PageHead, ActionGroup, Actions, Button, Check, Ctlbar, Divider, Count, ErrorText, ExtLink, Field, Info, Layout, LinkButton, MONO, MUTED, MUTED_MONO, NumberInput, PageStack, Panel, PanelHead, ProgressBar, Row, Spinner, Status, Table, Tag, TagGroup, Toolbar, Value, Clamp } from '../../components/ui' +import { PageHead, ActionGroup, Actions, Button, Check, Ctlbar, Divider, Count, ErrorText, ExtLink, Field, Info, Layout, LinkButton, MONO, MUTED, MUTED_MONO, NumberInput, PageStack, Panel, PanelHead, ProgressBar, Row, Spinner, Status, Table, Tag, TagGroup, Toolbar, Value, Clamp, useNarrowTable } from '../../components/ui' import { refresh, useProjectStore } from '../../stores/project' import { useSystemStore } from '../../stores/system' import { notify } from '../../stores/notice' @@ -197,6 +197,9 @@ export default function Dispatch() { setShotIds((list) => (list.includes(id) ? list.filter((x) => x !== id) : [...list, id])) } + /* 表格窄档(<992):两张表各备一套列,宽档那份列定义一字不动(1440 像素级不变) */ + const narrow = useNarrowTable() + return ( {/* 页头(第 1 条):入队是这一页唯一整页成立的主操作,从「分镜任务清单」的卡头里提出来。 @@ -250,7 +253,54 @@ export default function Dispatch() { rowKey="_key" dataSource={planRows} empty="还没有分镜清单,先去「分镜工作台」拆镜头。" - columns={[ + columns={narrow ? [ + + /* ── 窄档(<992 · NEX 阶段 8.5 六表收口之②「分镜任务清单」)────────────────── + 数据特点:一行 = 一个镜头要不要入队,读的人是「为什么这镜被跳过」。 + 宽档定宽合计 40+200+84+76 = 400,430 视口容器实测 356 ⇒ 溢出 44, + 说明列被挤到 0 宽(tableaudit 读到 说明=0),恰恰是唯一不能丢的那一列。 + 方案:不砍列、不横滚,把「动作」标签与「预估成本」并进镜头行的第二行 + (两者都只有几十字像素宽),时长/Provider 那行元信息退到第三行, + 说明列回到 140–306px 并保留两行封顶 + 全文 title。 + 三行预算:正文 22 + 标签 22 + 元信息 20 + 单元格内边距 16 = 80 ≤ 84。 */ + { title: '#', key: 'pick', width: 40, align: 'center', render: (_: any, row: any) => ( + row._row === 'shot' + ? toggleShot(row.shot_id)} /> + : + ) }, + { title: '镜头 / 动作', key: 'shot', width: 176, render: (_: any, row: any) => { + const who = row._row === 'shot' ? row.title : '配音' + const meta = row._row === 'shot' + ? `shot#${row.shot_id} · ${row.duration}s · ${row.provider || '—'}/${row.model || '默认'}` + : `shot#${row.shot_id} · ${row.chars} 字 · TTS` + const isShot = row._row === 'shot' + const tone = isShot + ? (row.action === 'enqueue' ? 'info' : row.action === 'needs_attention' ? 'bad' : 'warn') + : (row.action !== 'skip' ? 'info' : 'default') + const act = isShot ? actionLabel(row.action) : (row.action !== 'skip' ? '待配音' : '跳过') + return <> + #{row.order_index} {who} + {/* nowrap + 标签自带的 max-width/ellipsis:窄到放不下时折的是标签正文, + 不是把整行撑出第三排(R17 那条 84px 的行高红线) */} +
+ {act} + {isShot ? fmtMoney(row.estimated_cost) : '—'} +
+ {meta} + + } }, + { title: '说明', key: 'reason', className: MUTED, render: (_: any, row: any) => { + const blocking = row.blocking?.length ? `阻塞:${row.blocking.join(';')}` : '' + return + {row.reason} + {blocking ? {blocking} : null} + + } } + + ] : [ { title: '#', key: 'pick', width: 40, align: 'center', render: (_: any, row: any) => ( row._row === 'shot' ? { + const el = t.elapsed_ms ? `${(t.elapsed_ms / 1000).toFixed(1)}s` + : t.queue_wait_ms ? `排队 ${(t.queue_wait_ms / 1000).toFixed(1)}s` : '—' + /* 阶段 8.5 第 3 项数据完整性回归补的一刀:宽档「任务」列第二行是 + `配音 · voiceover`(类型中文名 + stage 码),窄档原本整行丢了它—— + 不是折行折掉的,是这一档压根没有这两个字段(430 实测 missing: + voiceover / asset / compose / dispatch / quality_check / + 时间线合成 / 资产处理)。 + 放在**句尾**而不是句首:这一格正文 132px、line-clamp 1,实测正文要 3 行 + (sh=60 / ch=20),句首句尾同样是「只有开头十几个字符看得见」, + 摆句首等于把 100% 这个数字换成 stage 码——状态标签(第二行)加错误列 + 已经把「哪条挂了」答完,窄屏要扫的那一位是进度与尝试次数。 + 两个字段仍然实打实在这格里:能朗读、能选中复制、悬停读全(§13.2.1)。 */ + const meta = `进度 ${Math.round((t.progress || 0) * 100)}% · 尝试 ${t.attempts}/${t.max_attempts} · ${el}` + + ` · ${t.shot_id ? `镜头#${t.shot_id}` : t.timeline_id ? `时间线#${t.timeline_id}` : '—'}` + + ` · ${statusLabel(t.kind)} · ${t.stage}` + return <> + #{t.id} {t.name} +
+ + {t.stale + ? + 心跳停止 + + : {fmtAgo(t.updated_at)}} +
+ + {meta} + + + } }, + { title: '状态 / 错误 / 检查点', key: 'error', render: (_: any, t: any) => { + const detail = [ + t.error_message ? `${t.error_code || 'error'} ${t.error_message}` : '', + t.checkpoint?.last_note || '' + ].filter(Boolean).join(' / ') + return <> + + {t.error_message ? {t.error_code} {t.error_message} : null} + {t.checkpoint?.last_note ? {t.checkpoint.last_note} + : Object.keys(t.checkpoint || {}).length + ? checkpoint: {JSON.stringify(t.checkpoint)} : null} + + {t.output_url ? 产物 : null} + + } }, + { title: '操作', key: 'actions', width: 80, align: 'right', render: (_: any, t: any) => ( + + {['failed', 'cancelled'].includes(t.status) + ? : null} + {ACTIVE_STATUSES.includes(t.status) + ? : null} + {t.status === 'succeeded' || t.status === 'skipped' ? — : null} + + ) } + + ] : [ { title: '任务', key: 'name', width: 180, render: (_: any, t: any) => ( <> #{t.id} {t.name} diff --git a/frontend/src/pages/project/Review.tsx b/frontend/src/pages/project/Review.tsx index b7e97d2..3c4f5e1 100644 --- a/frontend/src/pages/project/Review.tsx +++ b/frontend/src/pages/project/Review.tsx @@ -13,7 +13,7 @@ import { useAutoRefresh } from '../../hooks' import { Select } from '../../components/forms' import { AudioPlay } from '../../components/media/AudioPlay' import { MediaThumb } from '../../components/media/MediaThumb' -import { PageHead, ActionGroup, Actions, Button, Check, ChipBar, Ctlbar, Divider, Empty, ErrorText, Field, FormRow, Row, BarRight, SegmentedTabs, Count, IconText, Info, Input, Layout, LineHint, MONO, MUTED, MUTED_MONO, NumberInput, PageStack, Panel, PanelHead, SectionTitle, Spinner, Status, Table, Tag, TagGroup, TextArea, Toolbar, Value, Clamp } from '../../components/ui' +import { PageHead, ActionGroup, Actions, Button, Check, ChipBar, Ctlbar, Divider, Empty, ErrorText, Field, FormRow, Row, BarRight, SegmentedTabs, Count, IconText, Info, Input, Layout, LineHint, MONO, MUTED, MUTED_MONO, NumberInput, PageStack, Panel, PanelHead, SectionTitle, Spinner, Status, Table, Tag, TagGroup, TextArea, Toolbar, Value, Clamp, useNarrowTable } from '../../components/ui' import { refresh, useProjectStore } from '../../stores/project' import { notify } from '../../stores/notice' import { IconAim, IconDownload, IconEye, IconPass, IconReject, IconReload, IconRetry } from '../../components/icons' @@ -201,6 +201,9 @@ export default function Review() { } } + /* 表格窄档(<992):窄屏另给一套列,宽档那份一字不动(1440 像素级不变) */ + const narrow = useNarrowTable() + return ( {/* 页头(第 1 条):三个批量动作是这一页的主操作,整页成立 → 进 PageHead。 @@ -462,7 +465,45 @@ export default function Review() { minWidth={false} dataSource={reviews} empty="暂无审核记录。" - columns={[ + columns={narrow ? [ + + /* ── 窄档(<992 · NEX 阶段 8.5 六表收口之④「审核留痕」)──────────────────── + 数据特点:一行 = 一次审核动作,人要读的是「谁在什么时候判了什么、为什么」。 + 宽档六列定宽 548 加说明列:768 那档容器实测只有 462 ⇒ 溢出 145, + 430 溢出 251,说明列(那句质检结论)又被挤成 0 宽。 + 方案:时间 / 类型 / 审核人 / 镜头 这四个「定位一次记录」的短字段合成首列三行 + (一行一个,全文挂 title),得分并进结论下面(它是结论的下文,不配独占 60px), + 说明列回到 144–292px 并保留两行封顶。 */ + { title: '审核记录', key: 'record', width: 132, render: (_: any, rv: any) => { + const shot = byId[rv.shot_id] + ? `镜头 ${String(byId[rv.shot_id].order_index).padStart(2, '0')} · shot#${rv.shot_id}` : '未知镜头' + return <> +
{fmtTime(rv.created_at)}
+ + {statusLabel(rv.kind)} · {rv.reviewer || '—'} + + {shot} + + } }, + { title: '结论 / 得分', key: 'verdict', width: 80, align: 'center', render: (_: any, rv: any) => ( + <> + {rv.verdict === 'pass' ? '合格' : '不合格'} +
{rv.score ?? '—'}
+ + ) }, + { title: '说明', key: 'notes', render: (_: any, rv: any) => { + const fails = rv.checks?.checks + ? rv.checks.checks.filter((c: any) => !c.passed).map((c: any) => c.label).join('、') || '全部达标' + : '' + const note = rv.notes || '' + return ( + + {note || '—'} + {fails ? 检查:{fails} : null} + + ) + } } + ] : [ { title: '时间', key: 'time', width: 132, align: 'center', className: `${MUTED_MONO} whitespace-nowrap`, render: (_: any, rv: any) => fmtTime(rv.created_at) }, { title: '类型', key: 'kind', width: 80, align: 'center', render: (_: any, rv: any) => statusLabel(rv.kind) }, diff --git a/frontend/src/pages/project/Timeline.tsx b/frontend/src/pages/project/Timeline.tsx index 43dee6c..4f47edb 100644 --- a/frontend/src/pages/project/Timeline.tsx +++ b/frontend/src/pages/project/Timeline.tsx @@ -17,7 +17,7 @@ import { useSystemStore } from '../../stores/system' import { notify } from '../../stores/notice' import { confirmAction } from '../../stores/confirm' import { openPreview } from '../../stores/preview' -import { PageHead, ActionGroup, Actions, Button, Check, Chip, ChipBar, Ctlbar, Divider, Empty, ErrorText, ExtLink, Field, FieldBlock, FilePick, FormGrid, FormRow, Grid, Count, IconText, Input, IssueRow, Layout, LineHint, MONO, MUTED, MUTED_MONO, MaybeNumberInput, Mono, NumberInput, OptionGrid, PageStack, Panel, PanelHead, Row, Spinner, Status, Table, Tag, TagGroup, TextArea, Toolbar, Value } from '../../components/ui' +import { PageHead, ActionGroup, Actions, Button, Check, Chip, ChipBar, Ctlbar, Divider, Empty, ErrorText, ExtLink, Field, FieldBlock, FilePick, FormGrid, FormRow, Grid, Count, IconText, Input, IssueRow, Layout, LineHint, MONO, MUTED, MUTED_MONO, MaybeNumberInput, Mono, NumberInput, OptionGrid, PageStack, Panel, PanelHead, Row, Spinner, Status, Table, Tag, TagGroup, TextArea, Toolbar, Value, Clamp, useNarrowTable } from '../../components/ui' import { IconAdd, IconArrowDown, IconArrowUp, IconCheck, IconChevronDown, IconChevronUp, IconClose, IconDelete, IconEdit, IconEye, IconMic, IconPass, IconSound, IconStar, IconTracks, IconWarn } from '../../components/icons' /** @@ -416,6 +416,9 @@ export default function Timeline() { const patchAudio = (p: Partial) => setAudio((f) => ({ ...f, ...p })) const patchSetting = (p: Partial) => setSetting((f) => ({ ...f, ...p })) + /* 表格窄档(<992):窄屏另给一套列,宽档那份一字不动(1440 像素级不变) */ + const narrow = useNarrowTable() + return ( {/* 时间线总览 + 版本切换:以前是 Between 裸排在页面底色上 @@ -792,10 +795,46 @@ export default function Timeline() { right={最近编辑 {fmtTime(versions[0]?.updated_at)}} />
!!v.is_current} - columns={[ + columns={narrow ? [ + + /* ── 窄档(<992 · NEX 阶段 8.5 六表收口之⑤「时间线版本」)────────────────── + 数据特点:一屏就几版,读的是「哪一版在生效、要不要切回去」,行少而字段碎。 + 宽档 minWidth 820 在 430 溢出 464、768 溢出 358、576 溢出 318; + 版本号 / 片段 / 时长 / 更新时间这四个数字列,没有一个重要到独占一列。 + 方案:版本号提到名称行首(v3 · 主时间线),片段数·时长·更新时间收成第二行 + (全文挂 title,鼠标/触摸都能读回),只留「状态」「操作」两列定宽; + minWidth 同时关掉——窄屏那条 820 的横向滚动条换不来任何可读性。 + 操作列保持 128px 的三颗图标按钮(R15 那颗公式在 356 的容器里放得下)。 */ + { title: '版本 / 名称', key: 'name', render: (_: any, v: any) => ( + <> + + v{v.version} {v.name} + + + {v.segments} 段 · {fmtMs(v.total_duration_ms)} · {fmtTime(v.updated_at)} + + + ) }, + { title: '状态', key: 'state', width: 84, align: 'center', render: (_: any, v: any) => + {v.is_current ? '当前生效' : '历史版本'} }, + { title: '操作', key: 'actions', width: 128, align: 'right', render: (_: any, v: any) => ( + +