fix(short-drama-agent-front): 优化工作区提示与弹窗布局

This commit is contained in:
GJ committed 2026-10-09 18:31:09 +08:00
1 parent 5b134207b8
commit 72a86171dc
35 files changed
+586 -378

No files matched your search

@@ -0,0 +1,46 @@
import { describe, expect, it } from 'vitest'
import { productionMessage, productionIssueText } from '../../../src/features/production/production-messages'
/** 真实后端首帧问题改为中文处理建议,不暴露实现名称和内部编号。 */
describe('镜头生产用户提示', () => {
it('就绪问题和素材查询的质量失败使用同一中文提示,方便页面去重', () => {
const expected = '首帧画面检查未通过,请重新生成或修复首帧。'
expect(
productionIssueText({
code: 'failed_keyframe_quality',
reason: 'Primary Keyframe 最新视觉质量校验未通过,请先重新生成合格首帧'
})
).toBe(expected)
expect(
productionMessage(
'Storyboard Shot Primary Keyframe 最新视觉校验未通过,请先修复首帧: cmunpp5b7003hk6ldk2ekw3k5'
)
).toBe(expected)
})
it('提示词与新首帧不匹配时说明更新哪个内容', () => {
expect(
productionMessage(
'Storyboard Shot Video Prompt 未绑定当前 Primary Keyframe,请先重新生成 Video Prompt: cmunpp5b7003hk6ldk2ekw3k5'
)
).toBe('视频提示词与当前首帧不一致,请重新生成视频提示词。')
})
it('位置绑定变化说明需要更新首帧,不显示英文接口术语', () => {
expect(productionMessage('Primary Keyframe 的空间目标绑定已变化,需要重新生成并校验首帧')).toBe(
'镜头画面设置已调整,请重新生成并检查首帧。'
)
})
it('保留已有中文原因并移除内部镜头编号', () => {
expect(productionMessage('主体参考图已更新: cmunpp5b7003hk6ldk2ekw3k5')).toBe('主体参考图已更新')
})
it('英文连接失败转为可操作提示', () => {
expect(productionMessage('fetch failed')).toBe('暂时无法连接服务,请稍后重新获取。')
})
it('视频自己的检查问题保留视频对象,不误写成首帧问题', () => {
const message = '视频画面检查未通过,请重新生成视频。'
expect(productionMessage(message)).toBe(message)
})
it('后台状态不确定时保留不要重复提交的提醒', () => {
const message = '请求等待超时。后台任务可能仍在运行,请先刷新状态,不要重复提交。'
expect(productionMessage(message)).toBe(message)
})
})
+1 -2
View File
@@ -46,9 +46,8 @@ describe('镜头生产数据契约', () => {
expect(source).toMatch(/\.generation-input-mode-label\s*\{[^}]*mb-\[7px\][^}]*text-xs/)
})
it('首帧、素材引用和视频使用固定上限的正方形网格,不随少量记录撑满整行', () => {
it('主首帧、素材引用和视频使用固定上限的正方形网格,不随少量记录撑满整行', () => {
const source = readFileSync('src/features/production/components/ShotProductionAssets.vue', 'utf8')
expect(source).toContain('v-if="keyframeCandidates.length" class="keyframe-grid mt-4"')
expect(source).toContain('v-if="videos.length" class="video-grid mt-4"')
expect(source).toMatch(
/\.keyframe-grid\s*\{[^}]*grid-template-columns:\s*repeat\(auto-fill, minmax\(180px, 220px\)\)/
@@ -133,8 +133,10 @@ describe('精简公开资产回归', () => {
.find(item => item.text().includes('管理候选'))!
.trigger('click')
await flushPromises()
expect(document.body.textContent).toContain('模型输入变体')
expect(wrapper.findAll('button').some(button => button.text() === '设为主首帧')).toBe(false)
expect(document.body.textContent).toContain('视频参考图')
expect([...document.querySelectorAll('button')].some(button => button.textContent === '设为主首帧')).toBe(
false
)
} finally {
wrapper.unmount()
}