sync: complete remaining files (source dhk-1)

This commit is contained in:
gozeros committed 2026-10-21 15:14:06 +08:00
1 parent 42f2a26fa8
commit da6521b6cb
79 files changed
+2468 -459

No files matched your search

+39 -2
View File
@@ -28,8 +28,8 @@ const requiredLegacyFallbacks = [
},
{
file: "src/components/ai-elements/prompt-input.tsx",
pattern: /<InputGroup className="h-auto min-h-16">/,
description: "Prompt textarea must not rely on :has() for its parent height",
pattern: /<InputGroup className="h-auto min-h-16 flex-col items-stretch">/,
description: "Prompt textarea must not rely on :has() for its layout",
},
{
file: "src/core/utils/mermaid.ts",
@@ -41,6 +41,43 @@ const requiredLegacyFallbacks = [
pattern: /export function downlevelModernColors[\s\S]*function injectLegacyChartShim/,
description: "Generated HTML charts must downlevel modern CSS colors for Chrome 109",
},
{
file: "src/pages/ChatPage.tsx",
pattern: /chat-landing-composer-offset[\s\S]*chat-landing-content-lift/,
description: "Chat landing layout must not rely on Tailwind's individual translate property",
},
{
file: "src/styles/globals.css",
pattern: /\.chat-landing-composer-offset\s*\{\s*position:\s*relative;\s*top:\s*calc\(96px\s*-\s*50vh\);\s*\}/,
description: "Chat landing composer must offset with top, not Tailwind translate",
},
{
file: "src/styles/globals.css",
pattern:
/\.legacy-dialog-viewport\s*\{[\s\S]*?display:\s*flex;[\s\S]*?align-items:\s*center;[\s\S]*?justify-content:\s*center;/,
description: "Dialog content must be flex-centered without Tailwind translate",
},
{
file: "src/components/ui/dialog.tsx",
pattern: /legacy-dialog-viewport[\s\S]*relative grid/,
description: "Dialog panel must not use fixed + translate centering",
},
{
file: "src/styles/globals.css",
pattern:
/\.legacy-dialog-viewport\s*>\s*\[data-slot="dialog-content"\]\s*\{[\s\S]*?min-height:\s*0;[\s\S]*?max-height:\s*100%;/,
description: "Flex-centered dialogs must keep min-height:0 so inner scroll works",
},
{
file: "src/styles/globals.css",
pattern: /\.legacy-floating-layer\s*\{\s*z-index:\s*300;/,
description: "Portaled select/dropdown layers must sit above dialog overlay z-index 200",
},
{
file: "src/components/workspace/skills/skill-file-preview-dialog.tsx",
pattern: /minHeight:[\s\S]*100vh[\s\S]*maxHeight:[\s\S]*100vh/,
description: "Skill file preview must size with vh, not dvh, for Chrome 102",
},
];
for (const file of cssFiles) {
@@ -0,0 +1,39 @@
import { spawnSync } from "node:child_process";
import { mkdirSync, mkdtempSync } from "node:fs";
import { createRequire } from "node:module";
import { dirname, join, resolve } from "node:path";
import { fileURLToPath, pathToFileURL } from "node:url";
const require = createRequire(import.meta.url);
const root = resolve(dirname(fileURLToPath(import.meta.url)), "..");
const { build } = await import(pathToFileURL(require.resolve("esbuild", {
paths: [dirname(require.resolve("vite"))],
})).href);
const output = join(root, ".runtime", "ui-boundary-check");
mkdirSync(output, { recursive: true });
await build({
absWorkingDir: root,
entryPoints: ["src/components/react-ui-error-boundary.browser-check.tsx"],
bundle: true,
platform: "browser",
format: "iife",
define: { "process.env.NODE_ENV": JSON.stringify("production") },
outfile: join(output, "check.js"),
});
const browser = process.env.CHROME_PATH || (process.platform === "win32"
? "C:/Program Files/Google/Chrome/Application/chrome.exe"
: "/usr/bin/chromium");
const response = spawnSync(browser, [
"--headless=new", "--disable-gpu", "--disable-background-networking", "--no-first-run",
`--user-data-dir=${mkdtempSync(join(output, "browser-profile-"))}`,
"--virtual-time-budget=3000", "--dump-dom",
pathToFileURL(join(root, "scripts", "react-ui-error-boundary-check.html")).href,
], { encoding: "utf8", windowsHide: true, timeout: 30_000 });
if (response.error) throw response.error;
const payload = response.stdout?.match(/<pre id="boundary-check-result">([^<]+)<\/pre>/)?.[1];
if (!payload || response.status !== 0) {
throw new Error(`Browser check did not finish: exit=${response.status}; ${response.stderr?.slice(-500)}`);
}
const result = JSON.parse(payload);
if (result.passed !== true) throw new Error(`Browser check failed: ${payload}`);
console.log("React production boundary browser check:", result);
@@ -0,0 +1,8 @@
<!doctype html>
<html lang="zh-CN">
<head><meta charset="utf-8"><title>Offline React UI boundary check</title></head>
<body>
<div id="root"></div>
<script src="../.runtime/ui-boundary-check/check.js"></script>
</body>
</html>