diff --git a/AGENTS.md b/AGENTS.md
index 5028377..5347439 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -65,11 +65,15 @@
- 绿色背景、白色文字用于保存、提交、开始生成等主要执行操作;关闭、取消和普通辅助操作使用中性样式。
- 错误、校验未通过、需要修复的区域使用柔和浅红背景,深色主题使用对应柔和深红底面。禁止使用上下两条绿色横线表示错误或待修复状态,也不能借用绿色选中态来标记错误。
+- 普通镜头定位仅使用中性提示,不能因点击“定位镜头”就标红;只有从当前明确问题定位时才使用错误底色,正文刷新后清除旧定位标记。
- 错误入口按钮的文字、图标和焦点提示与红色底面保持一致;默认、悬停、按下、聚焦各状态都不能被主题主色覆盖成绿色。保留清晰的键盘焦点提示。
- 只有执行完成且结果明确通过校验时,成功任务区域才使用柔和浅绿背景。执行结束但校验失败、质量待审或结果未确认时,不能显示成绿色成功状态,也不能用满格绿色进度条暗示业务成功。
- 卡片内的定位、复查、修订和历史入口使用带图标、独立中性底面的按钮,不添加边框,不能与说明文字混在一起;复用 `workspace-action-button` / `workspace-action-group`,不把辅助操作改成绿色主按钮。
- 工具栏中相邻按钮保持一致的高度、内边距、图标大小和间距。问题入口使用图标加文字;分镜结构校验失败时文案为“分镜校验未通过”,其他问题按真实类型命名。
- 移动端的工具栏操作优先只显示图标,保留完整的 `aria-label`、提示文本和足够点击区域;普通表单的底部关闭、取消、提交按钮仍保留文字。
+- 仅显示单个图标的操作按钮统一使用正方形,图标居中,并使用 Naive UI `NPopover` 展示完整操作名称;优先复用 `WorkspaceActionTooltip`,保留对应 `aria-label`,相邻按钮尺寸和间距一致。
+- 按钮已显示完整文字时,不再重复添加同名悬浮提示;桌面有文字、移动端仅图标的响应式按钮,仅在隐藏文字的屏幕尺寸下启用 `NPopover`。桌面仍为纯图标的按钮继续保留提示。
+- 诊断结果卡片的定位、可选 AI 复查、修订及历史按钮在移动端也保留图标和完整文字,宽度不足时自动换行,不套用顶部工具栏仅显示图标的规则。
- 页面左侧汇总状态在运行、成功、失败等状态下均有意义,应保留;右侧操作入口负责打开对应处理界面,避免把状态展示和操作混成重复文案。
### 设置、问题处理与任务进度
@@ -82,6 +86,8 @@
- 从问题界面定位正文时,先关闭抽屉,等离场和焦点约束释放后再定位,不能同时叠加两个主界面。
- 后端从其他入口启动或重新执行任务时,前端也应发现任务并显示真实运行阶段、进度、作用范围及更新时间;重新进入页面后能够恢复观察,不能只依赖前端本次点击形成的加载状态。
- 执行状态与质量校验结果分别表达,不能把“执行完成”直接等同于“校验通过”;没有真实进度或结果时明确显示待确认,不伪造百分比。
+- 已修订且当前审核通过的镜头,不因未运行或过期的独立 AI 诊断再次列为“需处理”。AI 复查单独作为可选项,只有当前明确冲突或实时结构化问题才提示修复;复查入口受限不能直接解释为正式分镜需要重拆。
+- 默认收起的“高级检查详情”只保留必要的检查记录和当前复查范围,不再单独展示旧手部覆盖率或未填写手部记录;缺少记录使用中性说明,不作为错误,实际检出的动作冲突仍在普通问题区域展示。
- 拆解执行中暂不显示“查看诊断”等需要稳定结果的入口。问题可以只读查看,但人工修改、候选提交、修复和恢复操作应遵守真实活动任务锁,避免冲突。
- 拆解任务卡片与相邻模块采用统一边距和状态底色,必要的阶段、范围、进度和时间直接简洁展示;不要把重要信息只藏在“任务详情”折叠中,也不默认展示无助于操作的内部编号或原始数据。
diff --git a/src/components/ui/WorkspaceActionTooltip.vue b/src/components/ui/WorkspaceActionTooltip.vue
new file mode 100644
index 0000000..0064b66
--- /dev/null
+++ b/src/components/ui/WorkspaceActionTooltip.vue
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+ {{ label }}
+
+
diff --git a/src/components/ui/WorkspaceExportButton.vue b/src/components/ui/WorkspaceExportButton.vue
index cebd522..9164476 100644
--- a/src/components/ui/WorkspaceExportButton.vue
+++ b/src/components/ui/WorkspaceExportButton.vue
@@ -1,6 +1,7 @@
-
- 制作前检查
+
+
+ 制作前检查
+
diff --git a/tests/features/breakdown/BreakdownPage.test.ts b/tests/features/breakdown/BreakdownPage.test.ts
index f2765c2..c64cd95 100644
--- a/tests/features/breakdown/BreakdownPage.test.ts
+++ b/tests/features/breakdown/BreakdownPage.test.ts
@@ -369,7 +369,7 @@ function diagnosisResultsResponse() {
/**
* 提供完整结构化校验响应,通过证据数量区分当前与迟到结果。
- * @param evidenceShotCount 具有有效动作证据的镜头数量
+ * @param evidenceShotCount 具有手部记录覆盖的镜头数量
* @returns 后端结构化校验响应
*/
function handDiagnosticsResponse(evidenceShotCount: number) {
@@ -595,8 +595,9 @@ describe('拆解页内容滚动', () => {
const provided = mountPage([record])
await selectTab('分镜')
const toolbar = wrapper!.get('.breakdown-storyboard-toolbar')
- expect(toolbar.get('.breakdown-episode-picker > span').text()).toBe('选择剧集')
+ expect(toolbar.find('.breakdown-episode-picker > span').exists()).toBe(false)
const select = toolbar.getComponent(NSelect)
+ expect(select.attributes('aria-label')).toBe('选择分镜剧集')
expect(select.props('value')).toBe(1)
expect(toolbar.text()).toContain('长剧集')
expect(toolbar.get('.breakdown-storyboard-summary').text()).toContain('25 个节拍 · 25 个镜头')
@@ -627,11 +628,11 @@ describe('拆解页内容滚动', () => {
expect(wrapper!.find('.breakdown-storyboard router-link-stub').exists()).toBe(false)
})
- it('分镜顶部无叠加操作行,选择标签保持单行且统计操作垂直居中', () => {
+ it('分镜顶部无叠加操作行,下拉框可收缩且统计操作垂直居中', () => {
// 仅保护样式契约,DOM 环境不提供真实布局坐标。
const css = readAllStyles()
expect(css).toMatch(/\.breakdown-result-pad\s*\{[^}]*padding:\s*0(?:px)?/)
- expect(css).toMatch(/\.breakdown-episode-picker > span\s*\{[^}]*flex-shrink:\s*0;[^}]*white-space:\s*nowrap;/)
+ expect(css).toMatch(/\.breakdown-episode-picker\s*\{[^}]*min-width:\s*0(?:px)?;/)
expect(css).toMatch(/\.breakdown-storyboard-summary\s*\{[^}]*align-items:\s*center;/)
})
@@ -747,7 +748,7 @@ describe('拆解页内容滚动', () => {
expect(issues?.textContent).toContain('读取修复清单')
})
- it('诊断摘要与弹窗按需读取,展开结构化校验后展示证据不足', async () => {
+ it('诊断摘要与弹窗按需读取,保留通用检查但不展示旧手部统计', async () => {
const fetcher = vi.fn().mockImplementation(async input => {
const url = String(input)
if (url.includes('storyboard-legacy-action-diagnosis-results')) return diagnosisResultsResponse()
@@ -767,12 +768,12 @@ describe('拆解页内容滚动', () => {
expect(panel.get('.storyboard-diagnosis-dialog').attributes('aria-busy')).toBe('false')
const footer = panel.get('.n-drawer-footer')
expect(footer.text()).toContain('预览诊断范围')
- expect(footer.text()).toContain('启动 AI 诊断')
+ expect(footer.text()).toContain('启动 AI 复查')
expect(footer.text()).toContain('关闭')
await panel.get('.n-collapse-item__header-main').trigger('click')
await flushPromises()
- expect(panel.text()).toContain('有效动作证据 0 / 25 镜')
- expect(panel.text()).toContain('证据不足,暂无法判断冲突情况')
+ expect(panel.text()).not.toContain('手部记录覆盖')
+ expect(panel.text()).toContain('未填写记录不代表镜头有误')
expect(panel.get('.n-collapse-item__header-extra button').text()).toBe('刷新校验')
await panel.get('.n-collapse-item__header-main').trigger('click')
await flushPromises()
@@ -832,7 +833,7 @@ describe('拆解页内容滚动', () => {
expect(panel.get('.diagnosis-dialog-content').element).toBe(content)
})
- it('刷新已加载的结构化校验保留证据正文和图标占位,不触发整窗遮罩', async () => {
+ it('刷新通用动作检查保留高级摘要和图标占位,不触发整窗遮罩', async () => {
let handRequests = 0
let resolveRefresh: ((value: Response) => void) | undefined
const fetcher = vi.fn().mockImplementation(async input => {
@@ -856,14 +857,14 @@ describe('拆解页内容滚动', () => {
const panel = qualityDialog()
await panel.get('.n-collapse-item__header-main').trigger('click')
await flushPromises()
- const evidence = panel.findAll('p').find(item => item.text().includes('有效动作证据'))!.element
+ const evidence = panel.get('.diagnosis-inspection-details').element
const refreshButton = panel.findAll('button').find(button => button.text() === '刷新校验')!
const refreshIcon = refreshButton.find('.n-button__icon')
await refreshButton.trigger('click')
await flushPromises()
try {
- expect(panel.text()).toContain('有效动作证据 0 / 25 镜')
- expect(panel.findAll('p').find(item => item.text().includes('有效动作证据'))!.element).toBe(evidence)
+ expect(panel.text()).not.toContain('手部记录覆盖')
+ expect(panel.get('.diagnosis-inspection-details').element).toBe(evidence)
const spin = wrapper!
.findAllComponents(NSpin)
.find(item => item.classes().includes('storyboard-diagnosis-dialog'))!
@@ -876,7 +877,7 @@ describe('拆解页内容滚动', () => {
await flushPromises()
}
expect(refreshButton.classes()).not.toContain('n-button--loading')
- expect(panel.findAll('p').find(item => item.text().includes('有效动作证据'))!.element).toBe(evidence)
+ expect(panel.get('.diagnosis-inspection-details').element).toBe(evidence)
expect(panel.get('.n-collapse-item__header-extra button').element).toBe(refreshButton.element)
})
@@ -918,7 +919,10 @@ describe('拆解页内容滚动', () => {
expect((close.element as HTMLButtonElement).disabled).toBe(false)
await close.trigger('click')
await flushPromises()
- resolveFirst!(handDiagnosticsResponse(25))
+ const late = await handDiagnosticsResponse(25).json()
+ late.data.warningCount = 1
+ late.data.diagnostics = [{ episodeNo: 1, beatNo: 1, shotNo: 1, phaseNo: 1, characterRef: '@CH0001', actionIds: ['a1', 'a2'], code: 'hand_occupancy_conflict', severity: 'warning', suggestion: '已失效的动作检查问题' }]
+ resolveFirst!(new Response(JSON.stringify(late), { status: 200, headers: { 'Content-Type': 'application/json' } }))
await flushPromises()
await wrapper!.get('.storyboard-diagnosis-summary button').trigger('click')
await flushPromises()
@@ -926,8 +930,8 @@ describe('拆解页内容滚动', () => {
expect(panel.get('.storyboard-diagnosis-dialog').attributes('aria-busy')).toBe('false')
await panel.get('.n-collapse-item__header-main').trigger('click')
await flushPromises()
- expect(panel.text()).not.toContain('有效动作证据 25 / 25')
- expect(panel.text()).toContain('有效动作证据 0 / 25 镜')
+ expect(panel.text()).not.toContain('已失效的动作检查问题')
+ expect(panel.text()).not.toContain('手部记录覆盖')
expect(handRequests).toBe(2)
})
diff --git a/tests/features/breakdown/candidate-panel.test.ts b/tests/features/breakdown/candidate-panel.test.ts
index f26eee8..c45fd8a 100644
--- a/tests/features/breakdown/candidate-panel.test.ts
+++ b/tests/features/breakdown/candidate-panel.test.ts
@@ -43,16 +43,21 @@ describe('候选预检查与最终提交门禁', () => {
openPanel()
expect(preview).not.toHaveBeenCalled()
expect(commit).not.toHaveBeenCalled()
+ expect(wrapper!.findAll('button').some(button => button.text() === '重新检查')).toBe(true)
+ await wrapper!.findAll('button').find(button => button.text() === '重新检查')!.trigger('click')
+ expect(wrapper!.emitted('refresh')).toHaveLength(1)
await checkCandidate()
expect(commit).not.toHaveBeenCalled()
expect(document.querySelector('.app-dialog')?.textContent).toContain('确认提交候选为正式结果')
await confirmCandidate()
expect(preview).toHaveBeenCalledTimes(2)
expect(commit).toHaveBeenCalledExactlyOnceWith('candidate-project')
- expect(wrapper!.emitted('refresh')).toHaveLength(1)
- expect(wrapper!.text()).toContain('候选已提交')
+ expect(wrapper!.emitted('refresh')).toHaveLength(2)
+ expect(wrapper!.text()).toContain('拆解结果已保存并采用')
+ expect(wrapper!.findAll('button').some(button => button.text() === '重新检查')).toBe(false)
await wrapper!.setProps({ state: candidateState({ storyboardPersisted: true, candidateCommitted: true }), quality: breakdownQuality(selectBreakdownSource([candidateCheckpoint(candidateState({ storyboardPersisted: true, candidateCommitted: true }))]), null) })
expect(wrapper!.findAll('button').some(button => button.text() === '提交候选为正式结果')).toBe(false)
+ expect(wrapper!.findAll('button').some(button => button.text() === '重新检查')).toBe(false)
})
it('ready=false 显示未通过项且不打开最终确认', async () => {
const result = commitPreview()
diff --git a/tests/features/breakdown/diagnosis-classification.test.ts b/tests/features/breakdown/diagnosis-classification.test.ts
new file mode 100644
index 0000000..b7d3312
--- /dev/null
+++ b/tests/features/breakdown/diagnosis-classification.test.ts
@@ -0,0 +1,36 @@
+import { describe, expect, it } from 'vitest'
+import { diagnosisHasAttention, diagnosisReason } from '@/features/breakdown/diagnosis'
+import type { LegacyActionDiagnosisResults } from '@/features/breakdown/types'
+
+/**
+ * 修订后的镜头尚未做额外 AI 复查,动作占用没有报告具体问题。
+ * @returns 与真实诊断列表一致的最小记录
+ */
+function repaired(): LegacyActionDiagnosisResults['shots'][number] {
+ return { shotId: 'repaired-shot', episodeNo: 1, beatNo: 7, shotNo: 1, title: '已修订镜头', diagnosisId: null,
+ status: 'not_diagnosed', issues: [], createdAt: null, repairStatus: 'repaired', requiresPostRepairDiagnosis: true,
+ resourceAudit: { status: 'insufficient_evidence', issueCount: 0, evidenceCount: 2, expectedActionCount: 0, coveredActionCount: 0, coverage: null } }
+}
+
+describe('实际修复问题与独立 AI 复查分类', () => {
+ it('已修订但没有额外 AI 诊断不算需要修复', () => {
+ expect(diagnosisHasAttention(repaired())).toBe(false)
+ })
+ it('过期的冲突或待核对建议不能当成当前动作问题', () => {
+ expect(diagnosisHasAttention({ ...repaired(), status: 'stale', shotStale: true,
+ bodyMotionFindings: [{ dimension: 'balance', status: 'conflict', description: '旧冲突', quote: '旧原文' }] })).toBe(false)
+ expect(diagnosisHasAttention({ ...repaired(), status: 'insufficient_evidence' })).toBe(false)
+ })
+ it('当前明确冲突和实时资源问题始终保留,不能因已经修订而隐藏', () => {
+ expect(diagnosisHasAttention({ ...repaired(), status: 'conflict_found', policyStatus: 'current', shotStale: false })).toBe(true)
+ expect(diagnosisHasAttention({ ...repaired(), resourceAudit: { ...repaired().resourceAudit!, status: 'conflict_found', issueCount: 1 } })).toBe(true)
+ expect(diagnosisHasAttention({ ...repaired(), status: 'no_conflict_found', policyStatus: 'current',
+ bodyMotionFindings: [{ dimension: 'balance', status: 'conflict', description: '当前冲突', quote: '原文' }] })).toBe(true)
+ })
+ it('可选 AI 复查受限不要求重新拆解或替用户放开模型请求', () => {
+ for (const code of ['QUALITY_POLICY_SNAPSHOT_UNKNOWN', 'QUALITY_POLICY_SNAPSHOT_INVALID']) {
+ expect(diagnosisReason(code)).toContain('AI 复查')
+ expect(diagnosisReason(code)).not.toContain('重新生成拆解候选')
+ }
+ })
+})
diff --git a/tests/features/breakdown/diagnosis-preflight.test.ts b/tests/features/breakdown/diagnosis-preflight.test.ts
index 8f87b88..9ca44a9 100644
--- a/tests/features/breakdown/diagnosis-preflight.test.ts
+++ b/tests/features/breakdown/diagnosis-preflight.test.ts
@@ -25,6 +25,44 @@ beforeEach(() => { vi.spyOn(preparationApi, 'revisions').mockResolvedValue({ pro
afterEach(() => { wrapper?.unmount(); wrapper = undefined; vi.restoreAllMocks(); vi.unstubAllGlobals(); document.body.innerHTML = '' })
describe('单镜头诊断收费前来源检查', () => {
+ it('高级检查保留复查记录与范围,隐藏旧手部统计且不改变诊断启动条件', async () => {
+ const start = mocks()
+ vi.spyOn(breakdownApi, 'diagnosisPreflight').mockResolvedValue(checked())
+ vi.mocked(breakdownApi.handOccupancyDiagnostics).mockResolvedValue({ projectId: 'diag-p', shotCount: 61, evidenceShotCount: 42,
+ warningCount: 0, assessment: 'partial_evidence', diagnostics: [] } as never)
+ wrapper = mount(StoryboardDiagnosis, { attachTo: document.body, props: { projectId: 'diag-p', episodeNo: 1, episodeNos: [1] } })
+ wrapper.getComponent(StoryboardDiagnosis).vm.open({ episodeNo: 1, beatNo: 1, shotNo: 1 }); await flushPromises()
+ const drawer = new DOMWrapper(document.querySelector('[aria-label="动作诊断"]')!)
+ expect(drawer.text()).toContain('高级检查详情')
+ expect(drawer.find('.diagnosis-counts').exists()).toBe(false)
+ expect(drawer.text()).not.toContain('42 / 61')
+ expect(drawer.text()).not.toContain('缺少结构化动作证据')
+ expect(drawer.find('.diagnosis-preview').exists()).toBe(false)
+ const disabledBefore = drawer.get('[aria-label="启动 AI 复查"]').attributes('disabled')
+ await drawer.get('.diagnosis-evidence-collapse .n-collapse-item__header-main').trigger('click')
+ await flushPromises()
+ expect(drawer.text()).not.toContain('手部记录覆盖')
+ expect(drawer.text()).not.toContain('全项目手部记录')
+ expect(drawer.find('.diagnosis-counts').exists()).toBe(true)
+ expect(drawer.text()).not.toContain('未填写手部记录')
+ expect(drawer.get('.diagnosis-evidence-collapse').text()).not.toContain('证据不足')
+ expect(drawer.get('.diagnosis-evidence-collapse').text()).toContain('当前复查范围')
+ expect(drawer.get('[aria-label="启动 AI 复查"]').attributes('disabled')).toBe(disabledBefore)
+ expect(start).not.toHaveBeenCalled()
+ })
+ it('确实检出的结构化冲突在普通区域可见,不随高级详情一起隐藏', async () => {
+ mocks()
+ vi.mocked(breakdownApi.handOccupancyDiagnostics).mockResolvedValue({ projectId: 'diag-p', shotCount: 1, evidenceShotCount: 1,
+ warningCount: 1, assessment: 'complete_evidence', diagnostics: [{ episodeNo: 1, beatNo: 1, shotNo: 1, phaseNo: 1,
+ characterRef: '@CH0001', actionIds: ['a1','a2'], code: 'hand_occupancy_conflict', severity: 'warning', suggestion: '右手同时执行了冲突动作' }] } as never)
+ wrapper = mount(StoryboardDiagnosis, { attachTo: document.body, props: { projectId: 'diag-p', episodeNo: 1, episodeNos: [1] } })
+ await flushPromises(); await wrapper.get('button').trigger('click'); await flushPromises()
+ const drawer = new DOMWrapper(document.querySelector('[aria-label="动作诊断"]')!)
+ expect(drawer.text()).toContain('右手同时执行了冲突动作')
+ expect(drawer.find('.diagnosis-evidence-collapse').text()).not.toContain('右手同时执行了冲突动作')
+ expect(drawer.findAll('.problem-surface').length).toBeGreaterThan(0)
+ })
+
it('规则缺失、跨项目、已可复用和不完整检查都不能进入新诊断', () => {
expect(diagnosisCanStart(checked(), 'diag-p', 'db-shot')).toBe(true)
for (const invalid of [{ projectId: 'other' }, { shotId: 'other' }, { existingValid: true }, { shouldDiagnose: false }, { policyRevision: null }, { policyFingerprint: null }, { errors: ['QUALITY_POLICY_SNAPSHOT_UNKNOWN'] }, { eligibleForFurtherValidation: false }])
@@ -38,7 +76,7 @@ describe('单镜头诊断收费前来源检查', () => {
expect(read).toHaveBeenCalledWith('diag-p', 'db-shot')
const drawer = new DOMWrapper(document.querySelector('[aria-label="动作诊断"]')!)
expect(drawer.text()).toContain('缺少可信的质量规则记录')
- expect(drawer.get('[aria-label="启动 AI 诊断"]').attributes('disabled')).toBeDefined()
+ expect(drawer.get('[aria-label="启动 AI 复查"]').attributes('disabled')).toBeDefined()
expect(start).not.toHaveBeenCalled()
})
it('费用确认后再次检查,规则变化时保留只读结果并撤销启动', async () => {
@@ -46,13 +84,13 @@ describe('单镜头诊断收费前来源检查', () => {
vi.spyOn(breakdownApi, 'diagnosisPreflight').mockResolvedValueOnce(checked()).mockResolvedValue({ ...checked(), policyRevision: 4, policyFingerprint: 'b'.repeat(64) })
wrapper = mount(StoryboardDiagnosis, { attachTo: document.body, props: { projectId: 'diag-p', episodeNo: 1, episodeNos: [1] } })
wrapper.getComponent(StoryboardDiagnosis).vm.open({ episodeNo: 1, beatNo: 1, shotNo: 1 }); await flushPromises()
- await new DOMWrapper(document.querySelector('[aria-label="动作诊断"]')!).get('[aria-label="启动 AI 诊断"]').trigger('click')
+ await new DOMWrapper(document.querySelector('[aria-label="动作诊断"]')!).get('[aria-label="启动 AI 复查"]').trigger('click')
await flushPromises()
const confirmation = new DOMWrapper(document.querySelector('.app-dialog')!)
- await confirmation.findAll('button').find(button => button.text() === '确认启动 AI 诊断')!.trigger('click')
+ await confirmation.findAll('button').find(button => button.text() === '确认启动 AI 复查')!.trigger('click')
await flushPromises()
expect(start).not.toHaveBeenCalled()
- expect(new DOMWrapper(document.querySelector('[aria-label="动作诊断"]')!).get('[aria-label="启动 AI 诊断"]').attributes('disabled')).toBeDefined()
+ expect(new DOMWrapper(document.querySelector('[aria-label="动作诊断"]')!).get('[aria-label="启动 AI 复查"]').attributes('disabled')).toBeDefined()
})
it('镜头描述在费用确认期间变化时必须重新预览,不能直接诊断新内容', async () => {
const start = mocks()
@@ -60,8 +98,8 @@ describe('单镜头诊断收费前来源检查', () => {
vi.mocked(breakdownApi.legacyActionDiagnosisPreview).mockResolvedValueOnce(preview()).mockResolvedValue({ ...preview(), candidates: [{ ...preview().candidates[0]!, description: '已更改的新镜头' }] })
wrapper = mount(StoryboardDiagnosis, { attachTo: document.body, props: { projectId: 'diag-p', episodeNo: 1, episodeNos: [1] } })
wrapper.getComponent(StoryboardDiagnosis).vm.open({ episodeNo: 1, beatNo: 1, shotNo: 1 }); await flushPromises()
- await new DOMWrapper(document.querySelector('[aria-label="动作诊断"]')!).get('[aria-label="启动 AI 诊断"]').trigger('click'); await flushPromises()
- await new DOMWrapper(document.querySelector('.app-dialog')!).findAll('button').find(button => button.text() === '确认启动 AI 诊断')!.trigger('click'); await flushPromises()
+ await new DOMWrapper(document.querySelector('[aria-label="动作诊断"]')!).get('[aria-label="启动 AI 复查"]').trigger('click'); await flushPromises()
+ await new DOMWrapper(document.querySelector('.app-dialog')!).findAll('button').find(button => button.text() === '确认启动 AI 复查')!.trigger('click'); await flushPromises()
expect(start).not.toHaveBeenCalled()
})
it('修订条件与历史按需读取,跨项目响应不显示为可修订', async () => {
diff --git a/tests/features/breakdown/diagnosis-updates.test.ts b/tests/features/breakdown/diagnosis-updates.test.ts
index cf95aa7..c6e2baa 100644
--- a/tests/features/breakdown/diagnosis-updates.test.ts
+++ b/tests/features/breakdown/diagnosis-updates.test.ts
@@ -1,6 +1,9 @@
import { afterEach, describe, expect, it, vi } from 'vitest'
import { flushPromises, mount, DOMWrapper, type VueWrapper } from '@vue/test-utils'
+import { NSelect } from 'naive-ui'
import StoryboardDiagnosis from '@/features/breakdown/components/StoryboardDiagnosis.vue'
+import { projectContextKey } from '@/features/projects/context'
+import { testProjectContext } from '@/testing/project-context'
import WorkflowExecutionPanel from '@/features/workflows/WorkflowExecutionPanel.vue'
import { breakdownApi } from '@/features/breakdown/api'
import type { LegacyActionDiagnosisResults } from '@/features/breakdown/types'
@@ -15,16 +18,71 @@ let wrapper: VueWrapper | undefined
afterEach(() => { wrapper?.unmount(); wrapper = undefined; vi.restoreAllMocks(); vi.unstubAllGlobals(); document.body.innerHTML = '' })
describe('诊断版本及复查展示', () => {
+ it('顶部摘要优先表达正式审核通过,不因没有额外 AI 记录提示分镜尚未诊断', async () => {
+ const current = { ...shot, status: 'not_diagnosed' as const, policyStatus: 'not_diagnosed' as const, shotStale: false, bodyMotionFindings: [] }
+ vi.spyOn(breakdownApi, 'legacyActionDiagnosisResults').mockResolvedValue({ projectId: 'diag-update', episodeNo: 1,
+ counts: { total: 1, conflict: 0, clear: 0, insufficient: 0, invalid: 0, stale: 0, pending: 1 }, shots: [current] })
+ const context = testProjectContext('diag-update')
+ wrapper = mount(StoryboardDiagnosis, { props: { projectId: 'diag-update', episodeNo: 1, episodeNos: [1] },
+ global: { provide: { [projectContextKey as symbol]: context } } })
+ await flushPromises()
+ expect(wrapper.text()).toContain('分镜校验与审核已通过')
+ expect(wrapper.text()).not.toContain('尚未诊断')
+ context.data.value!.stageReadiness.breakdown = { ready: false, reason: '审核已失效' }
+ await flushPromises()
+ expect(wrapper.text()).not.toContain('分镜校验与审核已通过')
+ expect(wrapper.text()).toContain('正式分镜检查待确认')
+ context.data.value!.stageReadiness.projectId = 'other-project'
+ context.data.value!.stageReadiness.breakdown.ready = true
+ await flushPromises()
+ expect(wrapper.text()).not.toContain('分镜校验与审核已通过')
+ })
+ it('有当前真实问题时摘要仍明确提示处理,不被正式审核状态盖住', async () => {
+ const current = { ...shot, status: 'conflict_found' as const, policyStatus: 'current' as const, shotStale: false, bodyMotionFindings: [] }
+ vi.spyOn(breakdownApi, 'legacyActionDiagnosisResults').mockResolvedValue({ projectId: 'diag-update', episodeNo: 1,
+ counts: { total: 1, conflict: 1, clear: 0, insufficient: 0, invalid: 0, stale: 0, pending: 0 }, shots: [current] })
+ wrapper = mount(StoryboardDiagnosis, { props: { projectId: 'diag-update', episodeNo: 1, episodeNos: [1] },
+ global: { provide: { [projectContextKey as symbol]: testProjectContext('diag-update') } } })
+ await flushPromises()
+ expect(wrapper.text()).toContain('1 个镜头有实际问题待处理')
+ expect(wrapper.text()).not.toContain('分镜校验与审核已通过')
+ })
+
+ it('已修订并审核通过默认不列入需处理,可在可选复查中查看且没有修复按钮', async () => {
+ const current = { ...shot, status: 'not_diagnosed' as const, policyStatus: 'not_diagnosed' as const,
+ shotStale: false, bodyMotionFindings: [], handAudit: undefined,
+ resourceAudit: { status: 'insufficient_evidence' as const, issueCount: 0, evidenceCount: 2, expectedActionCount: 0, coveredActionCount: 0, coverage: null } }
+ vi.spyOn(breakdownApi, 'legacyActionDiagnosisResults').mockResolvedValue({ projectId: 'diag-update', episodeNo: 1,
+ counts: { total: 1, conflict: 0, clear: 0, insufficient: 0, invalid: 0, stale: 0, pending: 1 }, shots: [current] })
+ vi.spyOn(breakdownApi, 'handOccupancyDiagnostics').mockResolvedValue({ projectId: 'diag-update', shotCount: 1, evidenceShotCount: 0, diagnostics: [] } as never)
+ const start = vi.spyOn(breakdownApi, 'startLegacyActionDiagnosis')
+ wrapper = mount(StoryboardDiagnosis, { attachTo: document.body, props: { projectId: 'diag-update', episodeNo: 1, episodeNos: [1] },
+ global: { provide: { [projectContextKey as symbol]: testProjectContext('diag-update') } } })
+ await flushPromises(); await wrapper.get('button').trigger('click'); await flushPromises()
+ const dialog = new DOMWrapper(document.querySelector('[aria-label="动作诊断"]')!)
+ expect(dialog.findAll('.diagnosis-result-item')).toHaveLength(0)
+ expect(dialog.text()).toContain('当前正式分镜已审核通过')
+ expect(dialog.findAll('button').some(item => item.text() === '查看可选 AI 复查')).toBe(false)
+ wrapper!.getComponent(NSelect).vm.$emit('update:value', 'review')
+ await flushPromises()
+ expect(dialog.findAll('.diagnosis-result-item')).toHaveLength(1)
+ expect(dialog.text()).toContain('已修订并审核通过')
+ expect(dialog.text()).not.toContain('动作占用证据不足')
+ expect(dialog.find('[aria-label="查看并修订动作"]').exists()).toBe(false)
+ expect(start).not.toHaveBeenCalled()
+ })
+
it('修订完成不显示全部通过,展示规则和镜头过期、手部覆盖及全身疑点', async () => {
vi.spyOn(breakdownApi, 'legacyActionDiagnosisResults').mockResolvedValue({ projectId: 'diag-update', episodeNo: 1, counts: { total: 1, conflict: 0, clear: 0, insufficient: 0, invalid: 0, stale: 1, pending: 0 }, shots: [shot] })
vi.spyOn(breakdownApi, 'handOccupancyDiagnostics').mockResolvedValue({ projectId: 'diag-update', shotCount: 1, evidenceShotCount: 0, diagnostics: [] } as never)
wrapper = mount(StoryboardDiagnosis, { attachTo: document.body, props: { projectId: 'diag-update', episodeNo: 1, episodeNos: [1] } })
await flushPromises(); await wrapper.get('button').trigger('click'); await flushPromises()
const dialog = new DOMWrapper(document.querySelector('[aria-label="动作诊断"]')!)
- expect(dialog.text()).toContain('镜头已修订,AI 待复查')
+ wrapper!.getComponent(NSelect).vm.$emit('update:value', 'review'); await flushPromises()
+ expect(dialog.text()).toContain('镜头已修订,可按需进行 AI 复查。')
expect(dialog.text()).toContain('镜头内容已变化')
expect(dialog.text()).toContain('质量规则已变化')
- expect(dialog.text()).toContain('手部动作证据 1 / 2')
+ expect(dialog.text()).not.toContain('手部动作证据 1 / 2')
expect(dialog.text()).toContain('重心需要核对')
expect(dialog.text()).not.toContain('全部通过')
})
diff --git a/tests/features/breakdown/storyboard-location.test.ts b/tests/features/breakdown/storyboard-location.test.ts
new file mode 100644
index 0000000..acf2029
--- /dev/null
+++ b/tests/features/breakdown/storyboard-location.test.ts
@@ -0,0 +1,32 @@
+import { afterEach, describe, expect, it, vi } from 'vitest'
+import { flushPromises, mount, type VueWrapper } from '@vue/test-utils'
+import StoryboardList from '@/features/breakdown/components/StoryboardList.vue'
+import type { EpisodePlan, EpisodeShots } from '@/features/breakdown/types'
+
+/** 一条不涉及实际服务的正式分镜,用于验证定位语义。 */
+const plan: EpisodePlan = { episodeNo: 1, episodeTitle: '第一集', storyGoal: '', centralConflict: '', emotionalArc: '', pacing: '', endingHook: '',
+ beats: [{ beatNo: 1, title: '场景', purpose: 'establish', description: '内容', visualFocus: '', narrativeGoal: '', emotionalTone: '', estimatedDurationSeconds: 5, subjectRefs: [], isKeyBeat: false }] }
+/** 当前正式镜头正文。 */
+const episode: EpisodeShots = { episodeNo: 1, episodePlan: plan, beatShots: [{ beatNo: 1, shots: [{ shotNo: 1, title: '无问题镜头', description: '正文', visualFocus: '', subjectRefs: [], durationSeconds: 5 }] }] }
+let wrapper: VueWrapper | undefined
+afterEach(() => { wrapper?.unmount(); vi.restoreAllMocks() })
+
+describe('分镜定位与问题状态分离', () => {
+ it('只有从当前实际问题定位时使用错误标记,普通定位会清除旧错误标记', async () => {
+ wrapper = mount(StoryboardList, { props: { plans: [plan], episodes: [episode] } })
+ const target = wrapper.get('[data-shot-position="1-1-1"]')
+ await wrapper.getComponent(StoryboardList).vm.locate({ episodeNo: 1, beatNo: 1, shotNo: 1 }, { problem: true })
+ expect(target.classes()).toContain('diagnosis-problem-located')
+ await wrapper.getComponent(StoryboardList).vm.locate({ episodeNo: 1, beatNo: 1, shotNo: 1 })
+ expect(target.classes()).toContain('diagnosis-located')
+ expect(target.classes()).not.toContain('diagnosis-problem-located')
+ })
+ it('正式数据刷新后清除旧定位,不让已处理的问题继续标红', async () => {
+ wrapper = mount(StoryboardList, { props: { plans: [plan], episodes: [episode] } })
+ await wrapper.getComponent(StoryboardList).vm.locate({ episodeNo: 1, beatNo: 1, shotNo: 1 }, { problem: true })
+ await wrapper.setProps({ episodes: [structuredClone(episode)] })
+ await flushPromises()
+ expect(wrapper.find('.diagnosis-problem-located').exists()).toBe(false)
+ expect(wrapper.find('.diagnosis-located').exists()).toBe(false)
+ })
+})
diff --git a/tests/features/create-drama/EpisodeReader.test.ts b/tests/features/create-drama/EpisodeReader.test.ts
index 9725573..299db49 100644
--- a/tests/features/create-drama/EpisodeReader.test.ts
+++ b/tests/features/create-drama/EpisodeReader.test.ts
@@ -93,10 +93,10 @@ describe('连续剧本阅读器', () => {
/\.reader-chapter-heading\s*\{[^}]*position:\s*sticky;[^}]*top:\s*0;[^}]*z-index:\s*2;[^}]*background:\s*var\(--reader-background\)/
)
expect(css).toMatch(
- /\.reader-chapter-heading\s*\{[^}]*margin-inline:\s*calc\(var\(--reader-gutter\) \* -1\);[^}]*padding:\s*14px var\(--reader-gutter\) 18px;/
+ /\.reader-chapter-heading\s*\{[^}]*margin-inline:\s*calc\(var\(--reader-gutter\) \* -1\);[^}]*padding:\s*0 var\(--reader-gutter\) 18px;/
)
- expect(css).toMatch(/@media \(max-width: 800px\)[\s\S]*?\.reader-content\s*\{[^}]*padding-inline:\s*18px/)
- expect(css).toMatch(/@media \(max-width: 800px\)[\s\S]*?\.reader-content\s*\{[^}]*--reader-gutter:\s*18px/)
+ expect(css).toMatch(/@media \(max-width: 1023px\)[\s\S]*?\.reader-content\s*\{[^}]*padding:\s*24px/)
+ expect(css).toMatch(/@media \(max-width: 1023px\)[\s\S]*?\.reader-content\s*\{[^}]*--reader-gutter:\s*24px/)
})
it('按编号连续渲染全部剧集、元数据和空正文,标题不截断,模型内容只按文本显示', () => {
diff --git a/tests/features/projects/access.test.ts b/tests/features/projects/access.test.ts
index 5448b1f..2f7ee2b 100644
--- a/tests/features/projects/access.test.ts
+++ b/tests/features/projects/access.test.ts
@@ -217,11 +217,14 @@ describe('剧本完成前的下游访问限制', () => {
expect(wrapper!.get(skeleton).attributes('aria-busy')).toBe('true')
expect(wrapper!.find('.workspace-loading').exists()).toBe(false)
expect(wrapper!.get('.project-title').text()).toBe('')
+ expect(wrapper!.findAll('.project-header-action-placeholder')).toHaveLength(2)
+ expect(wrapper!.find('.project-header .n-button').exists()).toBe(false)
expect(mounted).not.toHaveBeenCalled()
resolveDetail(project('skeleton-first', 'completed'))
await flushPromises()
expect(wrapper!.find(skeleton).exists()).toBe(false)
+ expect(wrapper!.find('.project-header-action-placeholder').exists()).toBe(false)
expect(wrapper!.get('.workspace-probe').text()).toBe(section)
pending = new Promise(resolve => {