diff --git a/src/features/production/components/ShotProductionAssets.vue b/src/features/production/components/ShotProductionAssets.vue index 87096db..9c6d1d9 100644 --- a/src/features/production/components/ShotProductionAssets.vue +++ b/src/features/production/components/ShotProductionAssets.vue @@ -589,7 +589,7 @@ async function inspectSpecs() { @apply mt-4 flex min-h-[34px] flex-wrap items-center gap-3; } .keyframe-grid { - @apply grid grid-cols-[repeat(3,_minmax(0,_1fr))] gap-3; + @apply grid grid-cols-[repeat(auto-fill,_minmax(180px,_1fr))] gap-3; } .keyframe-card { @apply overflow-hidden rounded-none bg-(--app-subtle); diff --git a/tests/features/production/production.test.ts b/tests/features/production/production.test.ts index 930591d..d1eca65 100644 --- a/tests/features/production/production.test.ts +++ b/tests/features/production/production.test.ts @@ -38,6 +38,16 @@ describe('镜头生产数据契约', () => { ) }) + it('首帧候选使用紧凑的自动填充网格,不随少量图片撑满整行', () => { + const source = readFileSync('src/features/production/components/ShotProductionAssets.vue', 'utf8') + expect(source).toMatch( + /\.keyframe-grid\s*\{[^}]*grid-cols-\[repeat\(auto-fill,_minmax\(180px,_1fr\)\)\][^}]*gap-3/ + ) + expect(source).toMatch( + /@media \(max-width: 760px\)[\s\S]*?\.keyframe-grid\s*\{[^}]*grid-cols-\[repeat\(2,_minmax\(0,_1fr\)\)\]/ + ) + }) + it('可选尺寸必须成对留空或填写正整数', () => { expect(validOptionalSize('', '')).toBe(true) expect(validOptionalSize(1920, 1080)).toBe(true)