From da73ee071795fedd2f499476f8361f2e6cb0c5a8 Mon Sep 17 00:00:00 2001 From: Anso Date: Mon, 29 Jun 2026 20:28:51 -0400 Subject: [PATCH] fix: scroll auth canvas when preflight content overflows (#1521) Cap the auth card height and scroll its body so setup preflight checks remain reachable on short viewports without clipping the Enter action. --- .../src/components/auth/AuthCanvas.test.tsx | 36 +++++++++++++++++++ frontend/src/components/auth/AuthCanvas.tsx | 8 ++--- 2 files changed, 40 insertions(+), 4 deletions(-) create mode 100644 frontend/src/components/auth/AuthCanvas.test.tsx diff --git a/frontend/src/components/auth/AuthCanvas.test.tsx b/frontend/src/components/auth/AuthCanvas.test.tsx new file mode 100644 index 00000000..e02a7b9a --- /dev/null +++ b/frontend/src/components/auth/AuthCanvas.test.tsx @@ -0,0 +1,36 @@ +import { describe, it, expect } from 'vitest'; +import { render, screen } from '@testing-library/react'; +import { AuthCanvas } from './AuthCanvas'; + +describe('AuthCanvas', () => { + it('caps card height and scrolls overflowing body content', () => { + render( + Footer copy}> +

Tall content

+
, + ); + + const card = screen.getByRole('group'); + expect(card.className).toContain('max-h-[calc(100svh-5rem)]'); + expect(card.className).toContain('flex-col'); + + const body = screen.getByText('Tall content').parentElement; + expect(body?.className).toContain('overflow-y-auto'); + expect(body?.className).toContain('min-h-0'); + expect(body?.className).toContain('flex-1'); + }); + + it('keeps header and footer outside the scroll region', () => { + render( + Footer copy}> +

Body

+
, + ); + + const header = screen.getByText('SENCHO').parentElement; + const footer = screen.getByText('Footer copy').parentElement; + + expect(header?.className).toContain('shrink-0'); + expect(footer?.className).toContain('shrink-0'); + }); +}); diff --git a/frontend/src/components/auth/AuthCanvas.tsx b/frontend/src/components/auth/AuthCanvas.tsx index 1a85cc52..f4a936ec 100644 --- a/frontend/src/components/auth/AuthCanvas.tsx +++ b/frontend/src/components/auth/AuthCanvas.tsx @@ -21,14 +21,14 @@ export function AuthCanvas({ children, className, footer, ...props }: AuthCanvas
-
+
SENCHO @@ -38,10 +38,10 @@ export function AuthCanvas({ children, className, footer, ...props }: AuthCanvas
-
{children}
+
{children}
{footer && ( -
+
{footer}
)}