Skip to content

armgit / dbx

Public Imported from GitHub
0

25 MB lightweight cross-platform database client for 100+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 100+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP。

fix(ui): scope legacy WebView fallbacks

t8y2512f46a8357d
diff --git a/apps/desktop/src/styles/__tests__/legacyWebviewFallback.spec.ts b/apps/desktop/src/styles/__tests__/legacyWebviewFallback.spec.ts
new file mode 100644
index 0000000000..5ca13e43cb
--- /dev/null
+++ b/apps/desktop/src/styles/__tests__/legacyWebviewFallback.spec.ts
@@ -0,0 +1,27 @@
+import { readFileSync } from "node:fs";
+import { describe, expect, it } from "vitest";
+
+const globalsCss = readFileSync(new URL("../globals.css", import.meta.url), "utf8");
+
+describe("legacy WebView CSS fallbacks", () => {
+ it("scopes component overrides to WebViews without OKLCH support", () => {
+ const fallbackStart = globalsCss.indexOf("@supports not (color: oklch(0.5 0.1 180))");
+ const tabsOverride = globalsCss.indexOf('[data-slot="tabs-trigger"]');
+ const splitpanesStart = globalsCss.indexOf("/* Splitpanes */");
+
+ expect(fallbackStart).toBeGreaterThan(-1);
+ expect(tabsOverride).toBeGreaterThan(fallbackStart);
+ expect(splitpanesStart).toBeGreaterThan(tabsOverride);
+
+ let nestingDepth = 0;
+ let tabsNestingDepth = 0;
+ for (let index = globalsCss.indexOf("{", fallbackStart); index < splitpanesStart; index++) {
+ if (globalsCss[index] === "{") nestingDepth++;
+ if (globalsCss[index] === "}") nestingDepth--;
+ if (index === tabsOverride) tabsNestingDepth = nestingDepth;
+ }
+
+ expect(tabsNestingDepth).toBeGreaterThan(0);
+ expect(nestingDepth).toBe(0);
+ });
+});
diff --git a/apps/desktop/src/styles/globals.css b/apps/desktop/src/styles/globals.css
index 3cd2c5582b..b6937da96d 100644
--- a/apps/desktop/src/styles/globals.css
+++ b/apps/desktop/src/styles/globals.css
@@ -1345,6 +1345,9 @@ body.dbx-table-reference-dragging * {
font-size: 12.5px;
}
+/* Tailwind CSS v4 targets Safari 16.4+. Keep these legacy WebKit fallbacks
+ * isolated so supported WebViews continue using the generated component CSS. */
+@supports not (color: oklch(0.5 0.1 180)) {
@media (min-width: 640px) {
.sm\:flex-row {
flex-direction: row !important;
@@ -1809,6 +1812,7 @@ body.dbx-table-reference-dragging * {
max-width: min(920px, calc(100vw - 48px)) !important;
}
}
+}
/* Splitpanes */
.splitpanes--horizontal .splitpanes__pane {