From 01ceba34ecb96aef59f04d2250efbe4d3ebcd001 Mon Sep 17 00:00:00 2001 From: Eva Marco Date: Wed, 18 Nov 2026 09:22:07 +0100 Subject: [PATCH] :recycle: Give the team hero and recovery page links a real href (#12708) * :recycle: Give the Team management link in the team hero a real href "Team management" in the "Team up!" notice of a team's Projects page was an without href. It now links to the team Members page; a plain click still runs the in-app navigation (prevent default), and Ctrl/Cmd-click opens the link in a new tab. New visual test "Shows the Team management link": 0 px of difference at rest and on hover. AI-assisted-by: claude-opus-5-5 * :recycle: Give the Go to login link of the recovery page a real href "Go to login" on the password recovery page was an without href. It now links to the login page; a plain click still runs the in-app navigation (prevent default), and Ctrl/Cmd-click opens the link in a new tab. New visual test "Shows the Go to login link": 0 px of difference at rest and on hover. AI-assisted-by: claude-opus-5-5 --- .../ui/visual-specs/visual-dashboard.spec.js | 21 ++++++++++++ .../ui/visual-specs/visual-login.spec.js | 15 +++++++++ frontend/src/app/main/ui/auth/recovery.cljs | 32 +++++++++++++------ .../src/app/main/ui/dashboard/projects.cljs | 15 +++++++-- 4 files changed, 70 insertions(+), 13 deletions(-) diff --git a/frontend/playwright/ui/visual-specs/visual-dashboard.spec.js b/frontend/playwright/ui/visual-specs/visual-dashboard.spec.js index 94985dfeee..522363eacb 100644 --- a/frontend/playwright/ui/visual-specs/visual-dashboard.spec.js +++ b/frontend/playwright/ui/visual-specs/visual-dashboard.spec.js @@ -1103,3 +1103,24 @@ test.describe("Team settings organization", () => { await expect(add).toHaveScreenshot(shot); }); }); + +test.describe("Team hero link", () => { + test("Shows the Team management link", async ({ page }) => { + const shot = { maxDiffPixelRatio: 0, threshold: 0 }; + const dashboardPage = new DashboardPage(page); + await dashboardPage.setupDashboardFull(); + await dashboardPage.mockRPC( + `get-projects?team-id=${DashboardPage.secondTeamId}`, + "dashboard/get-projects-second-team.json", + ); + await dashboardPage.goToSecondTeamDashboard(); + await expect(page.getByText("Team Up")).toBeVisible(); + + const link = page.getByText("Team management", { exact: true }); + await page.mouse.move(10, 700); + await expect(link).toHaveScreenshot(shot); + + await link.hover(); + await expect(link).toHaveScreenshot(shot); + }); +}); diff --git a/frontend/playwright/ui/visual-specs/visual-login.spec.js b/frontend/playwright/ui/visual-specs/visual-login.spec.js index 7c9650d656..797d215ea6 100644 --- a/frontend/playwright/ui/visual-specs/visual-login.spec.js +++ b/frontend/playwright/ui/visual-specs/visual-login.spec.js @@ -108,3 +108,18 @@ test.describe("Login dialog section links", () => { await expect(loginHere).toHaveScreenshot(shot); }); }); + +test.describe("Password recovery page", () => { + test("Shows the Go to login link", async ({ page }) => { + const shot = { maxDiffPixelRatio: 0, threshold: 0 }; + await page.goto("/?screen=auth-recovery&token=fake-token"); + + const link = page.getByText("Go to login", { exact: true }); + await expect(link).toBeVisible(); + await page.mouse.move(10, 10); + await expect(link).toHaveScreenshot(shot); + + await link.hover(); + await expect(link).toHaveScreenshot(shot); + }); +}); diff --git a/frontend/src/app/main/ui/auth/recovery.cljs b/frontend/src/app/main/ui/auth/recovery.cljs index 3a772b79af..6ca6f6b2d0 100644 --- a/frontend/src/app/main/ui/auth/recovery.cljs +++ b/frontend/src/app/main/ui/auth/recovery.cljs @@ -10,10 +10,13 @@ [app.common.schema :as sm] [app.main.data.notifications :as ntf] [app.main.data.profile :as du] + [app.main.refs :as refs] [app.main.router :as rt] [app.main.store :as st] [app.main.ui.components.forms :as fm] + [app.util.dom :as dom] [app.util.i18n :as i18n :refer [tr]] + [app.util.keyboard :as kbd] [rumext.v2 :as mf])) (def ^:private schema:recovery-form @@ -88,16 +91,25 @@ ;; --- Recovery Request Page +(defn- on-go-to-login + [event] + ;; Ctrl/Cmd-click opens the href in a new tab, as any link. + (when-not (kbd/mod? event) + (dom/prevent-default event) + (st/emit! (rt/nav :auth-login)))) + (mf/defc recovery-page* [{:keys [params]}] - [:div {:class (stl/css :wrapper)} - [:h1 {:class (stl/css :title)} (tr "auth.recovery-request-title")] - [:div {:class (stl/css :subtitle)} (tr "auth.recovery-request-subtitle")] - [:hr {:class (stl/css :separator)}] - [:> recovery-form* {:params params}] + (let [router (mf/deref refs/router)] + [:div {:class (stl/css :wrapper)} + [:h1 {:class (stl/css :title)} (tr "auth.recovery-request-title")] + [:div {:class (stl/css :subtitle)} (tr "auth.recovery-request-subtitle")] + [:hr {:class (stl/css :separator)}] + [:> recovery-form* {:params params}] - [:div {:class (stl/css :links)} - [:div {:class (stl/css :go-back-row)} - [:a {:on-click #(st/emit! (rt/nav :auth-login)) - :class (stl/css :go-back-link)} - (tr "profile.recovery.go-to-login")]]]]) + [:div {:class (stl/css :links)} + [:div {:class (stl/css :go-back-row)} + [:a {:href (rt/resolve-uri router :auth-login {}) + :on-click on-go-to-login + :class (stl/css :go-back-link)} + (tr "profile.recovery.go-to-login")]]]])) diff --git a/frontend/src/app/main/ui/dashboard/projects.cljs b/frontend/src/app/main/ui/dashboard/projects.cljs index 2371fb89ef..ad0e95e233 100644 --- a/frontend/src/app/main/ui/dashboard/projects.cljs +++ b/frontend/src/app/main/ui/dashboard/projects.cljs @@ -69,9 +69,16 @@ (mf/defc team-hero* {::mf/wrap [mf/memo]} [{:keys [team on-close]}] - (let [on-nav-members-click + (let [router (mf/deref refs/router) + members-href (rt/resolve-uri router :dashboard-members {:team-id (:id team)}) + + on-nav-members-click (mf/use-fn - #(st/emit! (dcm/go-to-dashboard-members))) + (fn [event] + ;; Ctrl/Cmd-click opens the href in a new tab, as any link. + (when-not (kbd/mod? event) + (dom/prevent-default event) + (st/emit! (dcm/go-to-dashboard-members))))) on-invite (mf/use-fn @@ -95,7 +102,9 @@ [:div {:class (stl/css :title)} (tr "dasboard.team-hero.title")] [:div {:class (stl/css :info)} [:span (tr "dasboard.team-hero.text")] - [:a {:on-click on-nav-members-click} (tr "dasboard.team-hero.management")]] + [:a {:href members-href + :on-click on-nav-members-click} + (tr "dasboard.team-hero.management")]] [:> button* {:variant "primary" :on-click on-invite} (tr "onboarding.choice.team-up.invite-members")]]