refactor(*): 稳定期治理 - 收敛核心架构、错误语义并修复跨项目数据竞态

This commit is contained in:
ddCat
2026-09-09 22:02:10 +08:00
parent 83d9622fd0
commit bf41ef3172
298 changed files with 12681 additions and 26428 deletions

View File

@@ -3,15 +3,16 @@ import { readFileSync } from "node:fs";
import { resolve } from "node:path";
describe("asset library header buttons", () => {
test("only forces white header buttons in light mode", () => {
test("only restyles header buttons in light mode and uses outline tokens", () => {
const css = readFileSync(resolve(import.meta.dir, "../src/styles/globals.css"), "utf8");
const headerButtonRule = css.match(/html:not\(\.dark\) \.library-page \.app-page-header \.ant-btn,[\s\S]*?transition: all 180ms ease-out !important;\s*}/)?.[0] || "";
const headerButtonHoverRule = css.match(/html:not\(\.dark\) \.library-page \.app-page-header \.ant-btn:hover,[\s\S]*?transform: translateY\(-1px\);\s*}/)?.[0] || "";
expect(headerButtonRule).toContain("background: #ffffff !important;");
expect(headerButtonRule).toContain("color: #171717 !important;");
expect(headerButtonHoverRule).toContain("background: #ffffff !important;");
expect(headerButtonHoverRule).toContain("color: #171717 !important;");
expect(headerButtonRule).toContain("html:not(.dark) .canvas-library-page .app-page-header .ant-btn");
expect(headerButtonRule).toContain("background: transparent !important;");
expect(headerButtonRule).toContain("color: var(--foreground) !important;");
expect(headerButtonHoverRule).toContain("background: var(--btn-outline-hover-bg) !important;");
expect(headerButtonHoverRule).toContain("color: var(--foreground) !important;");
expect(css).not.toContain("\n .library-page .app-page-header .ant-btn,\n");
});
});