fix(web): enforce single brand icon asset
This commit is contained in:
@@ -48,6 +48,18 @@ const html = readFileSync('index.html', 'utf8')
|
||||
if (!html.includes('<html lang="zh-CN">')) failures.push('index language must be zh-CN')
|
||||
if (!html.includes('<title>森林AI</title>')) failures.push('document title must be 森林AI')
|
||||
if (!existsSync('public/senlinai-icon.svg')) failures.push('missing public/senlinai-icon.svg')
|
||||
if (!html.includes('href="/senlinai-icon.svg"')) failures.push('index must use senlinai-icon.svg as the canonical favicon')
|
||||
if (existsSync('public/favicon.svg')) failures.push('legacy public/favicon.svg must be removed; senlinai-icon.svg is the only brand asset')
|
||||
if (existsSync('public/senlinai-icon.svg')) {
|
||||
const icon = readFileSync('public/senlinai-icon.svg', 'utf8')
|
||||
if (icon.includes('<text') || icon.includes('<title')) failures.push('brand SVG must not include text or title metadata')
|
||||
if (icon.includes('role=') || icon.includes('aria-labelledby=')) failures.push('brand SVG must not expose presentation ARIA')
|
||||
}
|
||||
const appStyles = readFileSync('src/App.css', 'utf8')
|
||||
if (!appStyles.includes('.brand-icon {')) failures.push('brand-icon must have an explicit base size')
|
||||
if (!appStyles.includes('.brand-lockup.large .brand-icon')) failures.push('login brand icon must have an explicit size')
|
||||
if (!appStyles.includes('.rail-brand {')) failures.push('rail brand button must have explicit layout')
|
||||
if (appStyles.includes('.brand-symbol')) failures.push('legacy brand-symbol styles must be removed')
|
||||
for (const file of ['src/pages/login.tsx', 'src/pages/projects/project-topbar.tsx', 'src/pages/projects/project-rail.tsx']) {
|
||||
const source = readFileSync(file, 'utf8')
|
||||
if (!source.includes('/senlinai-icon.svg')) failures.push(`${file} must use the brand icon`)
|
||||
|
||||
Reference in New Issue
Block a user