Skip to content

A one-of-a-kind resume builder that keeps your privacy in mind. Completely secure, customizable, portable, open-source and free forever. Try it out today!

fix(web): prevent auth layout clipping and scrollbar overflow on long pages (#3685)

Hoàng Anh Tuấn9deea144370f
diff --git a/apps/web/src/features/auth/layout.tsx b/apps/web/src/features/auth/layout.tsx
index b8e83ac0e..3954c573d 100644
--- a/apps/web/src/features/auth/layout.tsx
+++ b/apps/web/src/features/auth/layout.tsx
@@ -3,7 +3,7 @@ import { BrandIcon } from "@reactive-resume/ui/components/brand-icon";
export function AuthLayout() {
return (
- <div className="xs:px-0 mx-auto flex h-svh w-dvw max-w-sm flex-col justify-center gap-y-6 px-4">
+ <div className="xs:px-0 mx-auto flex min-h-svh w-full max-w-sm flex-col justify-center gap-y-6 px-4 py-8">
<BrandIcon className="mb-4 size-20 self-center [view-transition-name:auth-brand]" />
<Outlet />
diff --git a/tests/e2e/specs/auth.spec.ts b/tests/e2e/specs/auth.spec.ts
index e26dd07ed..8f128cca5 100644
--- a/tests/e2e/specs/auth.spec.ts
+++ b/tests/e2e/specs/auth.spec.ts
@@ -1,6 +1,36 @@
import { loginViaUi, logoutViaUi, registerViaUi } from "../fixtures/auth";
import { expect, test } from "../fixtures/test";
+test.use({ launchOptions: { ignoreDefaultArgs: ["--hide-scrollbars"] } });
+
+test("keeps long auth pages reachable without horizontal overflow", async ({ page }) => {
+ for (const width of [320, 1280]) {
+ await page.setViewportSize({ width, height: 400 });
+ await page.goto("/auth/register");
+ await expect(page.getByRole("button", { name: "Sign up", exact: true })).toBeVisible();
+ // An explicit scrollbar width forces classic scrollbars on macOS too.
+ await page.evaluate(() => {
+ document.styleSheets[0]?.insertRule("::-webkit-scrollbar { width: 16px; }");
+ window.scrollTo(0, 0);
+ });
+ await expect
+ .poll(() => page.evaluate(() => window.innerWidth - document.documentElement.clientWidth))
+ .toBeGreaterThan(0);
+
+ const logo = page.getByRole("img", { name: "Reactive Resume", exact: true });
+ await expect(logo).toBeInViewport();
+ expect(await logo.evaluate((element) => element.getBoundingClientRect().top)).toBeGreaterThanOrEqual(16);
+ expect(
+ await page.evaluate(() => document.documentElement.scrollWidth - document.documentElement.clientWidth),
+ ).toBeLessThanOrEqual(0);
+
+ await page.evaluate(() => window.scrollTo(0, document.documentElement.scrollHeight));
+ const submit = page.getByRole("button", { name: "Sign up", exact: true });
+ await expect(submit).toBeInViewport();
+ expect(await submit.evaluate((element) => element.getBoundingClientRect().bottom)).toBeLessThanOrEqual(384);
+ }
+});
+
test("registers and logs in with email credentials", async ({ page, account }) => {
let documentRequests = 0;
page.on("request", (request) => {