refactor(rdp): remove RDP hover information bar and update test assertions

This commit is contained in:
Kang committed 2026-09-11 13:43:35 +08:00
1 parent 707ce819d8
commit ffd989a6c5
2 files changed
+4 -12

No files matched your search

+3 -3
View File
@@ -113,11 +113,11 @@ describe("RdpPaneHost", () => {
});
});
it("keeps session metadata without rendering interactive hover actions", () => {
it("does not render the RDP hover information bar", () => {
render(<RdpPaneHost pane={rdpPane()} active visible />);
expect(screen.getByText("Windows Desktop")).not.toBeNull();
expect(screen.getByText("1920x1080")).not.toBeNull();
expect(screen.queryByText("Windows Desktop")).toBeNull();
expect(screen.queryByText("1920x1080")).toBeNull();
expect(screen.queryAllByRole("button")).toHaveLength(0);
});
});
+1 -9
View File
@@ -1,6 +1,6 @@
import { Channel } from "@tauri-apps/api/core";
import { listen } from "@tauri-apps/api/event";
import { Monitor, ShieldAlert } from "lucide-react";
import { ShieldAlert } from "lucide-react";
import {
memo,
type FocusEvent as ReactFocusEvent,
@@ -639,14 +639,6 @@ function RdpPaneHost({ pane, active, visible, onConnectionError }: RdpPaneHostPr
className="pointer-events-none absolute left-0 top-0 z-10 hidden"
/>
<div className="absolute left-2 top-2 flex items-center gap-1 rounded border border-white/15 bg-black/65 px-2 py-1 text-xs text-white opacity-0 transition-opacity group-hover:opacity-100">
<Monitor className="h-3.5 w-3.5" />
<span className="max-w-40 truncate">{pane.name}</span>
<span className="text-white/55">
{desktopSize.width}x{desktopSize.height}
</span>
</div>
{state !== "active" && (
<div className="absolute inset-0 flex items-center justify-center bg-black/45 text-white">
<div className="flex items-center gap-3 rounded border border-white/15 bg-black/70 px-4 py-3 text-sm">