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(dialog): reduce overlay close jank

t8y213b1bba7ee99
diff --git a/apps/desktop/src/components/ui/dialog/DialogOverlay.vue b/apps/desktop/src/components/ui/dialog/DialogOverlay.vue
index b852a63cac..9a699166aa 100644
--- a/apps/desktop/src/components/ui/dialog/DialogOverlay.vue
+++ b/apps/desktop/src/components/ui/dialog/DialogOverlay.vue
@@ -16,7 +16,7 @@ const delegatedProps = reactiveOmit(props, "class");
v-bind="delegatedProps"
:class="
cn(
- 'data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-50',
+ 'data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-open:supports-backdrop-filter:backdrop-blur-xs bg-black/10 duration-100 fixed inset-0 isolate z-50',
props.class,
)
"
diff --git a/apps/desktop/src/components/ui/dialog/DialogScrollContent.vue b/apps/desktop/src/components/ui/dialog/DialogScrollContent.vue
index d7a6536f36..7add07a9d7 100644
--- a/apps/desktop/src/components/ui/dialog/DialogScrollContent.vue
+++ b/apps/desktop/src/components/ui/dialog/DialogScrollContent.vue
@@ -22,7 +22,7 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits);
<template>
<DialogPortal>
<DialogOverlay
- class="fixed inset-0 z-50 grid place-items-center overflow-y-auto bg-black/10 supports-backdrop-filter:backdrop-blur-xs data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"
+ class="fixed inset-0 z-50 grid place-items-center overflow-y-auto bg-black/10 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=open]:supports-backdrop-filter:backdrop-blur-xs"
>
<DialogContent
:class="
diff --git a/packages/app-tests/dialogOverlayPerformance.test.ts b/packages/app-tests/dialogOverlayPerformance.test.ts
new file mode 100644
index 0000000000..e496a7f49b
--- /dev/null
+++ b/packages/app-tests/dialogOverlayPerformance.test.ts
@@ -0,0 +1,13 @@
+import { readFileSync } from "node:fs";
+import { strict as assert } from "node:assert";
+import test from "node:test";
+
+test("dialog overlays scope backdrop filters to the open state", () => {
+ const overlaySource = readFileSync("apps/desktop/src/components/ui/dialog/DialogOverlay.vue", "utf8");
+ const scrollContentSource = readFileSync("apps/desktop/src/components/ui/dialog/DialogScrollContent.vue", "utf8");
+
+ assert.match(overlaySource, /data-open:supports-backdrop-filter:backdrop-blur-xs/);
+ assert.match(scrollContentSource, /data-\[state=open\]:supports-backdrop-filter:backdrop-blur-xs/);
+ assert.doesNotMatch(overlaySource, /\sbg-black\/10 duration-100 supports-backdrop-filter:backdrop-blur-xs/);
+ assert.doesNotMatch(scrollContentSource, /\sbg-black\/10 supports-backdrop-filter:backdrop-blur-xs/);
+});