From f2bcbe07b6fb022128ee8a78b4d9fe52e9664aa0 Mon Sep 17 00:00:00 2001 From: agent Date: Mon, 9 Nov 2026 14:07:59 -0500 Subject: [PATCH] fix(client): clarify login form styling - Add spacing for the session-expired notice and distinguish login inputs. - Assert those surfaces in expired-session light and dark stories. --- .../.storybook/stories/LoginForm.stories.tsx | 20 ++++++++++++++++++- client/src/pages/auth/LoginForm.module.css | 8 ++++++++ client/src/pages/auth/LoginForm.tsx | 2 ++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/client/.storybook/stories/LoginForm.stories.tsx b/client/.storybook/stories/LoginForm.stories.tsx index 0c63311..22684de 100644 --- a/client/.storybook/stories/LoginForm.stories.tsx +++ b/client/.storybook/stories/LoginForm.stories.tsx @@ -21,13 +21,30 @@ const meta: Meta = { export default meta; type Story = StoryObj; +async function expectLoginSurfaces(canvasElement: HTMLElement) { + const canvas = within(canvasElement); + const card = canvasElement.querySelector('section'); + const notice = canvas.getByText('Your session has expired. Sign in again to continue.'); + const username = canvas.getByRole('textbox', { name: 'Username' }); + if (!card) throw new Error('Login card was not rendered.'); + + await expect(window.getComputedStyle(notice).marginBottom).not.toBe('0px'); + await expect(window.getComputedStyle(username).backgroundColor).not.toBe( + window.getComputedStyle(card).backgroundColor, + ); +} + export const Initial: Story = {}; -export const ExpiredSession: Story = { args: { expired: true } }; +export const ExpiredSession: Story = { + args: { expired: true }, + play: async ({ canvasElement }) => expectLoginSurfaces(canvasElement), +}; export const SignedOut: Story = { args: { signedOut: true } }; export const DarkTheme: Story = { + args: { expired: true }, decorators: [ (Story) => (
@@ -35,6 +52,7 @@ export const DarkTheme: Story = {
), ], + play: async ({ canvasElement }) => expectLoginSurfaces(canvasElement), }; export const NarrowViewport: Story = { diff --git a/client/src/pages/auth/LoginForm.module.css b/client/src/pages/auth/LoginForm.module.css index 32f150d..d8664d2 100644 --- a/client/src/pages/auth/LoginForm.module.css +++ b/client/src/pages/auth/LoginForm.module.css @@ -31,6 +31,14 @@ font-size: var(--font-size-sm); } +.notice { + margin-bottom: var(--space-4); +} + +.form .loginInput { + background: var(--color-bg-subtle); +} + .form { display: flex; flex-direction: column; diff --git a/client/src/pages/auth/LoginForm.tsx b/client/src/pages/auth/LoginForm.tsx index e9d3f0e..38ed75f 100644 --- a/client/src/pages/auth/LoginForm.tsx +++ b/client/src/pages/auth/LoginForm.tsx @@ -81,6 +81,7 @@ export function LoginForm({ expired = false, signedOut = false, onSubmit }: Logi >