test: define G01 v5 structural alignment

This commit is contained in:
rain
2026-07-13 09:39:16 +08:00
parent b078d70b7f
commit 00d4af2918
2 changed files with 12 additions and 11 deletions
+1 -1
View File
@@ -9,7 +9,7 @@ $assets = @(
'static/assets/icons/common/admin-v1.png', 'static/assets/icons/common/admin-v1.png',
'static/assets/icons/genealogy/seal-current-frame-v1.png', 'static/assets/icons/genealogy/seal-current-frame-v1.png',
'static/assets/icons/genealogy/seal-row-frame-v1.png', 'static/assets/icons/genealogy/seal-row-frame-v1.png',
'static/assets/icons/action/create-cloud-v1.png' 'static/assets/icons/action/create-cloud-v2.png'
) )
foreach ($asset in $assets) { foreach ($asset in $assets) {
+11 -10
View File
@@ -16,7 +16,7 @@ $requiredAssets = @(
'static/assets/icons/genealogy/seal-current-frame-v1.png', 'static/assets/icons/genealogy/seal-current-frame-v1.png',
'static/assets/icons/genealogy/seal-row-frame-v1.png', 'static/assets/icons/genealogy/seal-row-frame-v1.png',
'static/assets/icons/action/add-v2.png', 'static/assets/icons/action/add-v2.png',
'static/assets/icons/action/create-cloud-v1.png', 'static/assets/icons/action/create-cloud-v2.png',
'static/assets/icons/tab/genealogy-v4.png', 'static/assets/icons/tab/genealogy-v4.png',
'static/assets/icons/tab/genealogy-active-v4.png', 'static/assets/icons/tab/genealogy-active-v4.png',
'static/assets/icons/tab/family-v4.png', 'static/assets/icons/tab/family-v4.png',
@@ -46,13 +46,13 @@ if ($header -notmatch 'notice-v3\.png') { throw 'Header does not use the approve
if ($header -notmatch 'unreadCount\s*>\s*0') { throw 'Header badge is not conditional on unread count.' } if ($header -notmatch 'unreadCount\s*>\s*0') { throw 'Header badge is not conditional on unread count.' }
if ($header -notmatch 'class="header-hall"') { throw 'Header does not isolate the hall line-art as a low-contrast background layer.' } if ($header -notmatch 'class="header-hall"') { throw 'Header does not isolate the hall line-art as a low-contrast background layer.' }
if ($header -match 'background-image: url') { throw 'Header still applies hall line-art directly to the red header surface.' } if ($header -match 'background-image: url') { throw 'Header still applies hall line-art directly to the red header surface.' }
if ($header -notmatch 'opacity:\s*\.16') { throw 'Header hall line-art is not reduced to the approved background contrast.' } if ($header -notmatch 'opacity:\s*\.29') { throw 'Header hall line-art is not visible enough for the approved eave layer.' }
if ($header -notmatch 'header-cinnabar-texture-v2\.jpg') { throw 'Header does not use the approved cinnabar texture asset.' } if ($header -notmatch 'header-cinnabar-texture-v2\.jpg') { throw 'Header does not use the approved cinnabar texture asset.' }
if ($header -notmatch 'height:\s*184rpx') { throw 'Header height does not match the approved compact red-head proportion.' } if ($header -notmatch 'height:\s*164rpx') { throw 'Header height does not match the approved narrow red-head proportion.' }
if ($tabbar -match '/static/icons/tab-') { throw 'Tabbar still references rejected legacy tab assets.' } if ($tabbar -match '/static/icons/tab-') { throw 'Tabbar still references rejected legacy tab assets.' }
if ($tabbar -notmatch 'safe-area-inset-bottom') { throw 'Tabbar has no Android safe-area padding.' } if ($tabbar -notmatch 'safe-area-inset-bottom') { throw 'Tabbar has no Android safe-area padding.' }
if ($tabbar -notmatch 'font-size:\s*28rpx') { throw 'Tabbar label size is below the approved G-01 size.' } if ($tabbar -notmatch 'font-size:\s*30rpx') { throw 'Tabbar label size does not match the approved visual weight.' }
if ($tabbar -notmatch 'width:\s*56rpx') { throw 'Tabbar icon size is below the approved G-01 size.' } if ($tabbar -notmatch 'width:\s*64rpx') { throw 'Tabbar icon size does not match the approved visual weight.' }
$page = Get-Content -Raw -Encoding UTF8 (Join-Path $root 'pages/genealogy/index.vue') $page = Get-Content -Raw -Encoding UTF8 (Join-Path $root 'pages/genealogy/index.vue')
if ($page -match "from '@/utils/api\.js'") { throw 'G-01 visual phase must not call the remote API.' } if ($page -match "from '@/utils/api\.js'") { throw 'G-01 visual phase must not call the remote API.' }
@@ -63,7 +63,7 @@ foreach ($asset in @('tree-v2.png', 'members-v2.png', 'generation-poem-v2.png',
if ($page -notmatch [regex]::Escape($asset)) { throw "G-01 does not consume $asset" } if ($page -notmatch [regex]::Escape($asset)) { throw "G-01 does not consume $asset" }
} }
if ($page -notmatch 'genealogy-current-slip-frame\.png') { throw 'G-01 does not use the approved current genealogy frame asset.' } if ($page -notmatch 'genealogy-current-slip-frame\.png') { throw 'G-01 does not use the approved current genealogy frame asset.' }
foreach ($token in @('current-meta-item', 'current-seal-frame', 'location-v1.png', 'member-meta-v1.png', 'admin-v1.png', 'create-cloud-v1.png')) { foreach ($token in @('current-summary', 'current-meta-item', 'current-seal-frame', 'location-v1.png', 'member-meta-v1.png', 'admin-v1.png', 'create-cloud-v2.png')) {
if ($page -notmatch $token) { throw "G-01 current panel is missing $token" } if ($page -notmatch $token) { throw "G-01 current panel is missing $token" }
} }
if ($page -notmatch 'width:\s*82rpx') { throw 'G-01 shortcut icons remain below the reference visual size.' } if ($page -notmatch 'width:\s*82rpx') { throw 'G-01 shortcut icons remain below the reference visual size.' }
@@ -71,17 +71,17 @@ foreach ($asset in @('paper-rice-texture-v2.jpg', 'footer-mountain-bamboo.png',
if ($page -notmatch [regex]::Escape($asset)) { throw "G-01 does not consume the approved background asset: $asset" } if ($page -notmatch [regex]::Escape($asset)) { throw "G-01 does not consume the approved background asset: $asset" }
} }
if ($page -match 'footer-mountain-bamboo-v2\.png') { throw 'G-01 still uses the solid mountain footer asset instead of the translucent watercolor landscape.' } if ($page -match 'footer-mountain-bamboo-v2\.png') { throw 'G-01 still uses the solid mountain footer asset instead of the translucent watercolor landscape.' }
if ($page -notmatch '(?s)\.page-footer-landscape\s*\{.*?opacity:\s*\.48') { throw 'G-01 footer landscape does not use the approved visible watercolor contrast.' } if ($page -notmatch '(?s)\.page-footer-landscape\s*\{.*?opacity:\s*0\.5') { throw 'G-01 footer landscape does not use the approved expanded watercolor contrast.' }
if ($page -match 'background:\s*rgba\(255,\s*249,\s*238,\s*\.88\)') { throw 'G-01 current genealogy card retains a rectangular pale backing behind its transparent corners.' } if ($page -match 'background:\s*rgba\(255,\s*249,\s*238,\s*\.88\)') { throw 'G-01 current genealogy card retains a rectangular pale backing behind its transparent corners.' }
$card = Get-Content -Raw -Encoding UTF8 (Join-Path $root 'components/GenealogyCard.vue') $card = Get-Content -Raw -Encoding UTF8 (Join-Path $root 'components/GenealogyCard.vue')
if ($card -notmatch 'genealogy-list-slip-frame\.png') { throw 'G-01 list rows do not use the approved slip frame asset.' } if ($card -notmatch 'genealogy-list-slip-frame\.png') { throw 'G-01 list rows do not use the approved slip frame asset.' }
if ($card -match 'background:\s*rgba\(255,\s*249,\s*238,\s*\.(9|96)\)') { throw 'G-01 list cards retain a rectangular pale backing behind their transparent corners.' } if ($card -match 'background:\s*rgba\(255,\s*249,\s*238,\s*\.(9|96)\)') { throw 'G-01 list cards retain a rectangular pale backing behind their transparent corners.' }
foreach ($token in @('seal-row-frame-v1.png', 'card-detail-row', 'card-updated')) { foreach ($token in @('seal-row-frame-v1.png', 'card-main', 'card-title-row', 'card-detail-row', 'card-updated')) {
if ($card -notmatch $token) { throw "G-01 list card is missing $token" } if ($card -notmatch $token) { throw "G-01 list card is missing $token" }
} }
if ($card -match 'background:\s*#b93b2e') { throw 'G-01 list seal is still a plain CSS red block.' } if ($card -match 'background:\s*#b93b2e') { throw 'G-01 list seal is still a plain CSS red block.' }
foreach ($asset in @('location-v1.png', 'member-meta-v1.png', 'admin-v1.png', 'seal-current-frame-v1.png', 'seal-row-frame-v1.png', 'create-cloud-v1.png')) { foreach ($asset in @('location-v1.png', 'member-meta-v1.png', 'admin-v1.png', 'seal-current-frame-v1.png', 'seal-row-frame-v1.png', 'create-cloud-v2.png')) {
if ($page -notmatch [regex]::Escape($asset) -and $card -notmatch [regex]::Escape($asset)) { if ($page -notmatch [regex]::Escape($asset) -and $card -notmatch [regex]::Escape($asset)) {
throw "G-01 does not consume $asset" throw "G-01 does not consume $asset"
} }
@@ -102,6 +102,7 @@ foreach ($fixture in $fixtures) {
if ($page -notmatch 'current-info-divider') { throw 'G-01 current panel is missing the reference title-to-meta divider.' } if ($page -notmatch 'current-info-divider') { throw 'G-01 current panel is missing the reference title-to-meta divider.' }
if ($card -match 'calendar-v1\.png') { throw 'G-01 list shows a calendar icon that does not exist in the reference.' } if ($card -match 'calendar-v1\.png') { throw 'G-01 list shows a calendar icon that does not exist in the reference.' }
if ($card -match 'genealogy\.surname') { throw 'G-01 list seal still shows a surname instead of the fixed 家谱 seal.' } if ($card -match 'genealogy\.surname') { throw 'G-01 list seal still shows a surname instead of the fixed 家谱 seal.' }
if ($card -notmatch '(?s)\.card-side\s*\{.*?flex-direction:\s*row') { throw 'G-01 list role and chevron are not aligned on one horizontal baseline.' } if ($card -match 'card-copy') { throw 'G-01 list still retains the superseded split content column.' }
if ($card -notmatch '(?s)\.card-title-row\s*\{.*?justify-content:\s*space-between') { throw 'G-01 list title, role, and chevron do not share the required first row.' }
Write-Output 'PASS G-01 visual contract' Write-Output 'PASS G-01 visual contract'