From f65009a2546d4820e83b3a0da6cd567c48e94529 Mon Sep 17 00:00:00 2001 From: Eva Marco Date: Thu, 26 Nov 2026 09:41:35 +0100 Subject: [PATCH] :recycle: Use a DS secondary button in the request access dialog (#13284) * :recycle: Use a DS secondary button in the request access dialog The "Go to Personal Projects" button of the request access dialog (no permission to a file or team, SSO error) was a raw button styled by hand. It is now a DS secondary button next to the primary one. The space between them moves from the button margin to a gap on the actions row. A zero-tolerance visual test covers both buttons at rest and on hover. AI-assisted-by: claude-opus-5-5 * :recycle: Drop the unused cancel button styles of the request dialog The request access dialog uses a DS button now, so its hand-made button styles go away. Removed (no use left in frontend/src): .cancel-button inside .overlay .dialog .sign-info and .overlay .dialog-login .sign-info. AI-assisted-by: claude-opus-5-5 --- .../ui/visual-specs/visual-dashboard.spec.js | 36 +++++++++++++++++++ frontend/src/app/main/ui/static.cljs | 5 +-- frontend/src/app/main/ui/static.scss | 20 +---------- 3 files changed, 40 insertions(+), 21 deletions(-) diff --git a/frontend/playwright/ui/visual-specs/visual-dashboard.spec.js b/frontend/playwright/ui/visual-specs/visual-dashboard.spec.js index 522363eacb..ac57d851f4 100644 --- a/frontend/playwright/ui/visual-specs/visual-dashboard.spec.js +++ b/frontend/playwright/ui/visual-specs/visual-dashboard.spec.js @@ -1065,6 +1065,42 @@ test.describe("Download report", () => { }); }); +test.describe("Request access dialog controls", () => { + test("Go to Personal Projects and Ask buttons", async ({ page }) => { + const shot = { maxDiffPixelRatio: 0, threshold: 0 }; + await DashboardPage.mockConfigFlags(page, ["disable-onboarding"]); + const dashboardPage = new DashboardPage(page); + await dashboardPage.setupDashboardFull(); + await page.route("**/api/main/methods/get-projects?*", (route) => + route.fulfill({ + status: 404, + contentType: "application/transit+json", + body: '["^ ","~:type","~:not-found","~:code","~:object-not-found"]', + }), + ); + await page.route("**/api/main/methods/get-team-info?*", (route) => + route.fulfill({ + status: 200, + contentType: "application/transit+json", + body: `["^ ","~:id","~u${DashboardPage.anyTeamId}","~:is-default",false]`, + }), + ); + await page.goto( + `/?screen=dashboard-recent&team-id=${DashboardPage.anyTeamId}`, + ); + + const actions = page.locator("[class*='static__sign-info']"); + const goToDashboard = actions.getByText("Go to Personal Projects", { + exact: true, + }); + await expect(goToDashboard).toBeVisible(); + await page.mouse.move(10, 10); + await expect(actions).toHaveScreenshot(shot); + await goToDashboard.hover(); + await expect(actions).toHaveScreenshot(shot); + }); +}); + test.describe("Team settings organization", () => { test("Shows the Add to an organization link", async ({ page }) => { const shot = { maxDiffPixelRatio: 0, threshold: 0 }; diff --git a/frontend/src/app/main/ui/static.cljs b/frontend/src/app/main/ui/static.cljs index 2b58bb8db2..f1cad5cae3 100644 --- a/frontend/src/app/main/ui/static.cljs +++ b/frontend/src/app/main/ui/static.cljs @@ -240,8 +240,9 @@ [:div {:key index} content]) [:div {:class (stl/css :sign-info)} (when cancel-text - [:button {:class (stl/css :cancel-button) - :on-click on-close} + [:> button* {:variant "secondary" + :type "button" + :on-click on-close} cancel-text]) [:> button* {:variant "primary" :on-click on-click} button-text]]]])) diff --git a/frontend/src/app/main/ui/static.scss b/frontend/src/app/main/ui/static.scss index d53ae93f87..22ef517513 100644 --- a/frontend/src/app/main/ui/static.scss +++ b/frontend/src/app/main/ui/static.scss @@ -324,28 +324,10 @@ .overlay .dialog-login .sign-info { display: flex; justify-content: flex-end; + gap: var(--sp-l); margin-block-start: var(--sp-xxxl); } -.overlay .dialog .sign-info, -.overlay .dialog-login .sign-info { - .cancel-button { - background: none; - cursor: pointer; - display: flex; - justify-content: center; - align-items: center; - border-radius: $br-8; - background-color: var(--color-background-tertiary); - border: $b-1 solid var(--color-background-tertiary); - color: var(--color-foreground-secondary); - padding: var(--sp-s) var(--sp-l); - font-size: 0.688rem; - text-transform: uppercase; - margin-inline-end: var(--sp-l); - } -} - .overlay .dialog { gap: var(--sp-m); }