From acc0a1e9add0849796166c8a6e8635ce00dfb354 Mon Sep 17 00:00:00 2001 From: GouJ Date: Fri, 4 Sep 2026 11:21:39 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=BB=9F=E4=B8=80=E5=9B=BE=E5=BA=93?= =?UTF-8?q?=E6=BB=9A=E5=8A=A8=E5=8C=BA=E5=9F=9F=E5=B9=B6=E5=90=B8=E9=A1=B6?= =?UTF-8?q?=E9=95=9C=E5=A4=B4=E7=AD=9B=E9=80=89=E6=A0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/admin.css | 31 +- src/components/ui/flatTheme.test.ts | 16 + .../subject-images/SubjectImagesPage.vue | 295 ++++++++++-------- .../subject-images/asset-impact.test.ts | 62 ++++ 4 files changed, 265 insertions(+), 139 deletions(-) diff --git a/src/admin.css b/src/admin.css index 7db73fb..e1441eb 100644 --- a/src/admin.css +++ b/src/admin.css @@ -455,8 +455,19 @@ body { .production-pipeline-card > .confirm-action { margin-block: 16px 4px; } +.gallery-workspace-page .workspace-scroll-content { + padding-top: 8px; +} +/* 图库只使用正文纵向滚动;筛选栏在同一滚动上下文吸顶,不再被头部高度限制。 */ .gallery-workspace-page .form-image-filter-region { - margin-block: 10px 0; + position: sticky; + top: 0; + z-index: 10; + background: var(--app-subtle); + margin-block: 10px 12px; +} +.gallery-workspace-page .workspace-scroll > .n-scrollbar-container { + overflow-anchor: none; } .workspace-heading h2 { font-size: 16px; @@ -1501,6 +1512,24 @@ body { padding: 14px 16px; background: var(--app-subtle); margin-bottom: 12px; + min-width: 0; +} +/* 关联素材始终单行横向浏览,数量和长名称不会撑高定位区或压缩图片区域。 */ +.asset-impact-links-scroll.n-scrollbar { + height: auto; + min-width: 0; + max-width: 100%; +} +.asset-impact-links { + display: flex; + align-items: center; + gap: 12px; + width: max-content; + white-space: nowrap; + padding-bottom: 8px; +} +.asset-impact-links > * { + flex-shrink: 0; } .asset-impact-select { min-width: 0; diff --git a/src/components/ui/flatTheme.test.ts b/src/components/ui/flatTheme.test.ts index 0858b47..978ec08 100644 --- a/src/components/ui/flatTheme.test.ts +++ b/src/components/ui/flatTheme.test.ts @@ -141,6 +141,22 @@ describe('全站平面主题', () => { expect(tools).not.toContain(':focusable="false"') }) + it('图库筛选吸顶,关联内容横向单行滚动,不给头部和图片区制造双重滚动边界', () => { + // 静态保护吸顶和横向尺寸规则;真实视口滚动与位置仍需浏览器验收。 + const css = readFileSync('src/admin.css', 'utf8') + expect(css).toMatch( + /\.gallery-workspace-page \.form-image-filter-region\s*\{[^}]*position:\s*sticky;[^}]*top:\s*0;[^}]*z-index:\s*10;[^}]*background:\s*var\(--app-subtle\);/ + ) + expect(css).toMatch( + /\.gallery-workspace-page \.workspace-scroll > \.n-scrollbar-container\s*\{[^}]*overflow-anchor:\s*none;/ + ) + expect(css).toMatch(/\.asset-impact-links\s*\{[^}]*width:\s*max-content;[^}]*white-space:\s*nowrap;/) + 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( + /]*>\s*