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(ssh): clear focus ring clipping in the host key prompt

YingNing89ea786e623d
diff --git a/apps/desktop/src/components/ssh/SshHostKeyPromptDialog.vue b/apps/desktop/src/components/ssh/SshHostKeyPromptDialog.vue
index ca99b31713..d34f3ffc83 100644
--- a/apps/desktop/src/components/ssh/SshHostKeyPromptDialog.vue
+++ b/apps/desktop/src/components/ssh/SshHostKeyPromptDialog.vue
@@ -327,7 +327,10 @@ watch(
</DialogDescription>
</DialogHeader>
- <div v-if="current" class="min-h-0 flex-1 space-y-3 overflow-y-auto py-1">
+ <!-- px-1 leaves room for the 2px focus ring (focus:ring-2) of the inputs
+ below: `overflow-y-auto` clips the horizontal axis too, and without
+ padding the ring would be cut off on the left/right edges. -->
+ <div v-if="current" class="min-h-0 flex-1 space-y-3 overflow-y-auto px-1 py-1">
<div v-if="isHostKeyChanged" class="space-y-3">
<div class="flex items-start gap-2 rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive">
<TriangleAlert class="mt-0.5 h-4 w-4 shrink-0" aria-hidden="true" />
diff --git a/apps/desktop/src/components/ssh/__tests__/SshHostKeyPromptDialog.spec.ts b/apps/desktop/src/components/ssh/__tests__/SshHostKeyPromptDialog.spec.ts
index 329ebdcdbb..98067e6bab 100644
--- a/apps/desktop/src/components/ssh/__tests__/SshHostKeyPromptDialog.spec.ts
+++ b/apps/desktop/src/components/ssh/__tests__/SshHostKeyPromptDialog.spec.ts
@@ -474,6 +474,35 @@ describe("SshHostKeyPromptDialog web bridge", () => {
});
});
+ it("pads the prompt scroll container so the input focus ring is not clipped", async () => {
+ // Regression: the container had no horizontal padding, so the 2px focus
+ // ring of the `w-full` input was clipped on the left/right edges even
+ // though `overflow-y-auto` also clips the horizontal axis.
+ await mountDialog();
+
+ const eventSource = MockEventSource.instances[0];
+ eventSource?.emit({
+ type: "prompt",
+ request: {
+ id: "ring-clip-1",
+ kind: "UserInput",
+ host: "",
+ port: 0,
+ prompt: "Please enter 6 digits.",
+ title: "Dynamic token",
+ source: "Terminal",
+ echo: false,
+ },
+ });
+ await nextTick();
+
+ const input = document.body.querySelector<HTMLInputElement>("input");
+ if (!input) throw new Error("plugin prompt input was not rendered");
+ const scroller = input.closest(".overflow-y-auto");
+ expect(scroller).not.toBeNull();
+ expect(scroller?.classList.contains("px-1")).toBe(true);
+ });
+
it("answers a fixed-choice plugin question by picking an option", async () => {
await mountDialog();