Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

Fix click/hover behavior for "Install in Cursor" link (#74259)

Timofey Kachalovdfdc6063e71a
diff --git a/e2e/test/scenarios/metabot/mcp-apps-settings.cy.spec.ts b/e2e/test/scenarios/metabot/mcp-apps-settings.cy.spec.ts
index 0d0f2c64c1d..1057cb3ac24 100644
--- a/e2e/test/scenarios/metabot/mcp-apps-settings.cy.spec.ts
+++ b/e2e/test/scenarios/metabot/mcp-apps-settings.cy.spec.ts
@@ -43,6 +43,35 @@ describe("admin > MCP apps settings > Cursor install link", () => {
expect(decoded.url).to.eq(`${Cypress.config("baseUrl")}/api/mcp`);
});
+ cy.log(
+ "link is hoverable — pointer events reach it (not the switch track)",
+ );
+ const hoverState = { mouseEntered: false };
+ cy.findByRole("link", { name: "Install in Cursor" })
+ .then(($link) => {
+ $link[0].addEventListener("mouseenter", () => {
+ hoverState.mouseEntered = true;
+ });
+ })
+ .realHover()
+ // If the switch track is covering the link, the pointer hits the track
+ // and `mouseenter` never fires on the link.
+ .should(() => {
+ expect(hoverState.mouseEntered).to.be.true;
+ });
+
+ cy.log("clicking the link does not toggle the parent switch");
+ cy.findByRole("link", { name: "Install in Cursor" })
+ .then(($link) => {
+ // Prevent the cursor:// deeplink from being followed during the test
+ $link.on("click", (event) => event.preventDefault());
+ })
+ .click();
+
+ cy.findByRole("switch", { name: /cursor and vs code/i }).should(
+ "be.checked",
+ );
+
cy.log("disable Cursor and VS Code");
cy.findByRole("switch", { name: /cursor and vs code/i }).click({
force: true,
diff --git a/frontend/src/metabase/admin/ai/CursorInstallLink.tsx b/frontend/src/metabase/admin/ai/CursorInstallLink.tsx
index dbfb45b5d1b..553c1811c7d 100644
--- a/frontend/src/metabase/admin/ai/CursorInstallLink.tsx
+++ b/frontend/src/metabase/admin/ai/CursorInstallLink.tsx
@@ -30,6 +30,7 @@ export const CursorInstallLink = () => {
href={buildCursorInstallUrl(mcpUrl)}
fz="sm"
w="fit-content"
+ pos="relative"
onClick={(event) => event.stopPropagation()}
>
{t`Install in Cursor`}