fix(desktop): prevent window drag from tab whitespace

Closes #10194
This commit is contained in:
t8y2 committed 2026-09-26 14:27:19 +00:00
1 parent b4f503e1f1
commit ed863e9e59
4 files changed
+67 -1

No files matched your search

@@ -22,6 +22,7 @@ const mocks = vi.hoisted(() => ({
removePluginTrustedKey: vi.fn(),
toast: vi.fn(),
isTauriRuntime: vi.fn(),
openExternal: vi.fn(),
refreshPluginWorkbenches: vi.fn(),
}));
@@ -31,6 +32,7 @@ vi.mock("@/stores/connectionStore", () => ({ useConnectionStore: () => ({ connec
vi.mock("@/stores/queryStore", () => ({ useQueryStore: () => ({}) }));
vi.mock("@/lib/backend/tauriRuntime", () => ({ isTauriRuntime: mocks.isTauriRuntime }));
vi.mock("@tauri-apps/api/event", () => ({ listen: vi.fn(async () => vi.fn()) }));
vi.mock("@tauri-apps/plugin-shell", () => ({ open: mocks.openExternal }));
vi.mock("vue-i18n", async () => {
const { ref } = await import("vue");
return { useI18n: () => ({ locale: ref("en"), t: (key: string, values = {}) => `${key}:${JSON.stringify(values)}` }) };
@@ -270,6 +272,33 @@ describe("PluginContributionsPanel batch source validation", () => {
});
});
describe("PluginContributionsPanel external links", () => {
it("hands GitHub and homepage clicks to the desktop shell without selecting the card", async () => {
const linkedCatalog = catalog("first", ["linked"]);
Object.assign(linkedCatalog.catalog!.plugins[0], {
source: "https://github.com/dbxio/linked",
homepage: "https://dbxio.com/plugins/linked",
});
state.catalogResults = [linkedCatalog];
state.marketplaceViewMode = "grid";
mocks.isTauriRuntime.mockReturnValue(true);
await nextTick();
const sourceButton = host.querySelector<HTMLButtonElement>('[aria-label^="pluginPlatform.sourceRepository"]')!;
const homepageButton = host.querySelector<HTMLButtonElement>('[aria-label^="pluginPlatform.pluginHomepage"]')!;
const cardClick = vi.fn();
sourceButton.closest("article")!.addEventListener("click", cardClick);
sourceButton.click();
await vi.waitFor(() => expect(mocks.openExternal).toHaveBeenCalledTimes(1));
homepageButton.click();
await vi.waitFor(() => expect(mocks.openExternal).toHaveBeenCalledTimes(2));
expect(mocks.openExternal.mock.calls).toEqual([["https://github.com/dbxio/linked"], ["https://dbxio.com/plugins/linked"]]);
expect(cardClick).not.toHaveBeenCalled();
});
});
describe("PluginContributionsPanel update center synchronization", () => {
it("notifies after a single marketplace update without duplicating per batch item", async () => {
const listener = vi.fn();