feat(short-drama-agent-front): 完善镜头定位与项目配置

This commit is contained in:
GJ committed 2026-10-08 19:45:26 +08:00
1 parent 470b52e26d
commit 5b134207b8
66 files changed
+2042 -984

No files matched your search

+16 -9
View File
@@ -169,7 +169,9 @@ describe('全站平面主题', () => {
expect(css).toMatch(/\.asset-impact-links\s*\{[^}]*width:\s*max-content;[^}]*white-space:\s*nowrap;/)
expect(css).toMatch(/\.gallery-sticky-controls > \.form-image-filter-region\s*\{[^}]*margin-block:\s*0;/)
// 间距归列表所有,吸顶时底部不留固定色带。
expect(css).toMatch(/\.gallery-workspace-page \.form-image-grid\s*\{[^}]*padding-top:\s*12px;/)
expect(css).toMatch(
/\.gallery-workspace-page \.form-image-grid\s*\{[^}]*padding-top:\s*var\(--app-content-gap\);/
)
const sticky = css.match(/\.gallery-workspace-page \.gallery-sticky-controls\s*\{([^}]*)\}/)?.[1]
expect(sticky).not.toMatch(/padding|border-bottom|::after/)
expect(css).toMatch(
@@ -177,7 +179,7 @@ describe('全站平面主题', () => {
)
expect(css).toMatch(/\.asset-impact-links-scroll\.n-scrollbar\s*\{[^}]*height:\s*auto;[^}]*max-width:\s*100%;/)
expect(readFileSync('src/features/subject-images/SubjectImagesPage.vue', 'utf8')).toMatch(
/<WorkspacePage\b[^>]*>\s*<template #default>/
/<WorkspacePage\b[^>]*>[\s\S]*?<template #default>/
)
})
@@ -205,10 +207,8 @@ describe('全站平面主题', () => {
const source = readFileSync('src/features/subject-images/SubjectImagesPage.vue', 'utf8')
expect(source).not.toContain('class="toolbar-summary"')
expect(source).toMatch(/<WorkspaceTools\s+triggerless/)
expect(source.match(/<NPopover trigger="hover" placement="top" :disabled="isMobile">/g)).toHaveLength(4)
expect(source).toMatch(/aria-label="网格布局"/)
expect(source).toMatch(/aria-label="瀑布流布局"/)
expect(source).toMatch(/aria-label="刷新图库"/)
expect(source).toMatch(/data-workspace-tools\s+aria-label="批量生图"/)
expect(source).not.toContain('title="网格布局"')
expect(source).not.toContain('title="瀑布流布局"')
@@ -239,7 +239,6 @@ describe('全站平面主题', () => {
expect(css).toMatch(
/\.gallery-layout-switch \.layout-option-button:not\(\.layout-option-active\),\s*\.gallery-layout-switch \.gallery-action-button\s*\{[^}]*background:\s*var\(--app-control-hover\);/
)
expect(source.match(/class="icon-button gallery-action-button"/g)).toHaveLength(2)
expect(css).toMatch(
/\.gallery-layout-switch\s*\{[^}]*display:\s*flex;[^}]*align-items:\s*center;[^}]*gap:\s*8px;/
)
@@ -262,15 +261,17 @@ describe('全站平面主题', () => {
for (const file of [
'src/App.vue',
'src/components/ui/ThemeToggle.vue',
'src/components/ui/WorkspaceTools.vue',
'src/features/projects/ProjectsPage.vue',
'src/features/subject-identity/SubjectIdentityPage.vue'
'src/features/subject-images/SubjectImagesPage.vue'
]) {
const source = readFileSync(file, 'utf8')
expect(source).toContain('icon-button')
expect(source).not.toMatch(/<NButton\b[^>]*\bcircle\b/)
}
expect(readFileSync('src/components/ui/DirectoryItem.vue', 'utf8')).not.toContain('icon-button')
expect(readFileSync('src/components/ui/WorkspaceTools.vue', 'utf8')).not.toContain('icon-button')
const projects = readFileSync('src/features/projects/ProjectsPage.vue', 'utf8')
expect(projects).not.toContain('aria-label="刷新项目"')
expect(projects).not.toMatch(/<NButton\b[^>]*\bcircle\b/)
})
it('风格参考图操作按钮与输入行对齐,缩略图在宽屏下保持紧凑', () => {
@@ -285,7 +286,13 @@ describe('全站平面主题', () => {
// happy-dom 不计算布局;此项保护 CSS 契约,不能替代浏览器视觉验收。
const css = readAllStyles()
expect(css).not.toMatch(/border-radius:\s*[1-9]/)
expect(css).not.toMatch(/border(?:-[\w]+)?:\s*1px (?:solid|dashed) var\(--(?:app-border|color-line)\)/)
// 主体身份的新流程用单条分隔线区分下一步操作,普通业务面板仍保持平面表面。
const separators = [...css.matchAll(/([^{}]+)\{([^{}]*)\}/g)]
.filter(([, , declarations]) =>
/border(?:-[\w]+)?:\s*1px (?:solid|dashed) var\(--(?:app-border|color-line)\)/.test(declarations!)
)
.map(([, selector]) => selector!.trim())
expect(separators).toEqual(['.identity-next-action'])
expect(css).toMatch(/\.surface-inset\s*\{[^}]*background:\s*var\(--app-subtle\)/)
expect(css).toMatch(/\.record-list > article:nth-child\(even\)\s*\{\s*background:/)
expect(css).toMatch(/\.directory-group-heading\s*\{[^}]*background:\s*var\(--app-control\)/)