功能修改

This commit is contained in:
npc0-hue
2026-07-20 16:42:33 +08:00
parent 48b8ad8d6c
commit a0e69417db
224 changed files with 22015 additions and 884 deletions
+36
View File
@@ -2,6 +2,16 @@ import { readFileSync } from "node:fs";
import { describe, expect, it } from "vitest";
describe("platform web shared theme CSS", () => {
it("keeps production lifecycle and alert controls bounded at narrow width", () => {
const themeCss = readFileSync(new URL("./base.css", import.meta.url), "utf8");
const narrow = themeCss.slice(themeCss.indexOf("@media (max-width: 640px)", themeCss.indexOf(".production-governance-panel")));
expect(narrow).toContain(".plugin-lifecycle-controls");
expect(narrow).toContain("grid-template-columns: minmax(0, 1fr)");
expect(narrow).toContain(".production-alert-actions button");
expect(themeCss).toContain("overflow-wrap: anywhere");
});
it("suppresses nested state frames inside shared framed surfaces", () => {
const themeCss = readFileSync(new URL("./base.css", import.meta.url), "utf8");
const nestedStateReset = themeCss.slice(themeCss.indexOf("A state view inside an already framed surface"));
@@ -76,4 +86,30 @@ describe("platform web shared theme CSS", () => {
expect(progressRule).toContain(".runtime-task-log");
expect(progressRule).toContain("prefers-reduced-motion");
});
it("styles operations surfaces with shared theme materials and narrow-screen collapse", () => {
const themeCss = readFileSync(new URL("./base.css", import.meta.url), "utf8");
const operationsRule = themeCss.slice(themeCss.indexOf("/* ---- operations console enrichment ---- */"));
expect(operationsRule).toContain("var(--panel-material)");
expect(operationsRule).toContain(".operations-tray-panel");
expect(operationsRule).toContain("@media (max-width: 760px)");
expect(operationsRule).toContain("grid-template-columns: 1fr");
expect(operationsRule).toContain("prefers-reduced-motion");
expect(operationsRule).toContain(".operations-job-row-failed");
});
it("keeps mobile navigation off-canvas with readable vertical labels", () => {
const themeCss = readFileSync(new URL("./base.css", import.meta.url), "utf8");
const mobileRule = themeCss.slice(themeCss.indexOf("/* ---- narrow screens ---- */"), themeCss.indexOf("/* A state view inside an already framed surface"));
expect(mobileRule).toContain(".mobile-sidebar-handle");
expect(mobileRule).toContain("position: fixed");
expect(mobileRule).toContain("padding: 14px 14px 14px 52px");
expect(mobileRule).toContain("transform: translateX(calc(-100% - 18px))");
expect(mobileRule).toContain(".app-sidebar-mobile-open");
expect(mobileRule).toContain("grid-template-columns: 40px minmax(0, 1fr)");
expect(mobileRule).toContain(".app-nav-copy strong");
expect(mobileRule).toContain("display: block");
});
});
File diff suppressed because it is too large Load Diff