fix(short-drama-agent-front): 统一全屏布局与问题处理交互

This commit is contained in:
GJ committed 2026-10-17 17:40:39 +08:00
1 parent db91a4b871
commit cc27d463e0
25 files changed
+838 -316

No files matched your search

+50 -9
View File
@@ -528,7 +528,7 @@ describe('拆解页内容滚动', () => {
await flushPromises()
expect(drawerPanel().element.closest('.workspace-split')).toBeNull()
await drawerPanel().get('#group-size').setValue('2')
await drawerPanel().get('.n-card-header__close').trigger('click')
await drawerPanel().get('.n-drawer-header__close').trigger('click')
provided.data.value!.checkpoints = [checkpoint()]
await flushPromises()
expect(wrapper!.get('.breakdown-results-scroll .n-scrollbar-container').element).toBe(results)
@@ -544,7 +544,7 @@ describe('拆解页内容滚动', () => {
expect(fetcher).not.toHaveBeenCalled()
})
it('问题入口打开独立错误弹窗,拆解设置不再包含详细错误', async () => {
it('问题窗口集中查看、修订和恢复,拆解设置只保留生成与候选流程', async () => {
const record = checkpoint()
record.state.workflowExecution!.status = 'failed'
record.state.workflowExecution!.errorMessage = '工作流中断'
@@ -555,21 +555,55 @@ describe('拆解页内容滚动', () => {
mountPage([record])
expect(wrapper!.find('.workspace-feedback').exists()).toBe(false)
expect(wrapper!.text()).not.toContain('缺少形态绑定')
const action = wrapper!.findAll('button').find(item => item.text() === '查看拆解问题')!
const action = wrapper!.get('button.breakdown-desktop-issues')
await action.trigger('click')
await flushPromises()
const issues = document.querySelector<HTMLElement>('.app-dialog[aria-label="拆解问题"]')
const issues = document.querySelector<HTMLElement>('.app-drawer[aria-label="拆解问题"]')
expect(issues?.textContent).toContain('缺少形态绑定')
expect(issues?.textContent).toContain('工作流中断')
expect(issues?.textContent).not.toContain('重试失败抽取')
await new DOMWrapper(issues!).get('.n-card-header__close').trigger('click')
expect(issues?.textContent).toContain('重试失败抽取')
expect(issues?.textContent).toContain('读取修复清单')
expect(issues?.textContent).not.toContain('预览分组')
expect(issues?.textContent).not.toContain('提交候选为正式结果')
await new DOMWrapper(issues!).get('.n-drawer-header__close').trigger('click')
await flushPromises()
await wrapper!.get('[data-workspace-tools]').trigger('click')
await flushPromises()
expect(drawerPanel().text()).not.toContain('缺少形态绑定')
expect(drawerPanel().text()).not.toContain('工作流中断')
expect(drawerPanel().text()).toContain('查看问题')
expect(drawerPanel().text()).toContain('重试失败抽取')
expect(drawerPanel().text()).toContain('预览分组')
expect(drawerPanel().text()).not.toContain('查看问题')
expect(drawerPanel().text()).not.toContain('重试失败抽取')
expect(drawerPanel().text()).not.toContain('读取修复清单')
})
it('问题窗口在任务执行期间仅可查看,修订与恢复继续受活动锁保护', async () => {
const record = checkpoint()
record.state.workflowExecution!.status = 'running'
record.state.breakdownResult!.storyboardShotValidation = {
valid: false,
issues: [{ episodeNo: 1, message: '待修复问题' }]
}
mountPage([record])
await wrapper!.get('button.breakdown-desktop-issues').trigger('click')
await flushPromises()
const issues = new DOMWrapper(document.querySelector<HTMLElement>('.app-drawer[aria-label="拆解问题"]')!)
expect(issues.text()).toContain('待修复问题')
for (const label of ['读取修复清单', '重试失败抽取', '补齐缺失镜头', '修复分镜绑定']) {
const action = issues.findAll('button').find(button => button.text() === label)!
expect((action.element as HTMLButtonElement).disabled).toBe(true)
}
})
it('质量待审核但没有结构错误时仍可进入问题窗口读取修复清单', async () => {
const record = checkpoint()
record.state.storyboardPendingQualityEpisodeNos = [1]
record.state.breakdownResult!.storyboardShotValidation = { valid: true, issues: [] }
mountPage([record])
await wrapper!.get('button.breakdown-desktop-issues').trigger('click')
await flushPromises()
const issues = document.querySelector<HTMLElement>('.app-drawer[aria-label="拆解问题"]')
expect(issues?.textContent).toContain('读取修复清单')
})
it('诊断摘要与弹窗按需读取,展开结构化校验后展示证据不足', async () => {
@@ -593,6 +627,7 @@ describe('拆解页内容滚动', () => {
const footer = panel.get('.n-card__footer')
expect(footer.text()).toContain('预览诊断范围')
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 镜')
@@ -732,9 +767,15 @@ describe('拆解页内容滚动', () => {
qualityDialog()
.get('.n-card__footer')
.findAll('button')
.filter(button => button.text() !== '关闭')
.every(button => (button.element as HTMLButtonElement).disabled)
).toBe(true)
await qualityDialog().get('.n-card-header__close').trigger('click')
const close = qualityDialog()
.get('.n-card__footer')
.findAll('button')
.find(button => button.text() === '关闭')!
expect((close.element as HTMLButtonElement).disabled).toBe(false)
await close.trigger('click')
await flushPromises()
resolveFirst!(handDiagnosticsResponse(25))
await flushPromises()
@@ -1,17 +1,17 @@
import { afterEach, describe, expect, it } from 'vitest'
import { flushPromises, mount, type VueWrapper } from '@vue/test-utils'
import BreakdownIssuesDialog from '@/features/breakdown/components/BreakdownIssuesDialog.vue'
import AppDialog from '@/components/ui/AppDialog.vue'
import AppDrawer from '@/components/ui/AppDrawer.vue'
/** 独立问题弹窗实例,验证后移除 Teleport。 */
/** 独立全屏问题抽屉实例,验证后移除 Teleport。 */
let wrapper: VueWrapper | undefined
afterEach(() => {
wrapper?.unmount()
document.body.innerHTML = ''
})
describe('拆解问题弹窗', () => {
it('同镜头问题合并展示并去重,定位等待弹窗离场后发出', async () => {
describe('拆解问题抽屉', () => {
it('同镜头问题合并展示并去重,定位等待抽屉离场后发出', async () => {
wrapper = mount(BreakdownIssuesDialog, {
attachTo: document.body,
props: {
@@ -34,7 +34,7 @@ describe('拆解问题弹窗', () => {
button.click()
await flushPromises()
expect(wrapper.emitted('locate')).toBeUndefined()
wrapper.getComponent(AppDialog).vm.$emit('closed')
wrapper.getComponent(AppDrawer).vm.$emit('closed')
expect(wrapper.emitted('locate')?.[0]?.[0]).toMatchObject({ episodeNo: 1, beatNo: 2, shotNo: 3 })
})
})