From b048c4f0e531b8f1b9766c61ec65b8b4778471d5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 29 Jul 2026 19:38:50 -0300 Subject: [PATCH 1/2] fix: a11y violations in toast/button/screen stories (#163) - Wrap toast stories in
landmark for a11y - Use navy #04145C for toast trigger buttons (color-contrast fix) - Add bg-navy border-navy to Button Primary story (color-contrast fix) - Wrap DataScreen story in ToastProvider +
(fixes useToast crash) - Add
decorator to SettingsScreen story (a11y landmark) Resolves #163 --- src/components/ui/button.stories.tsx | 6 ++- src/components/ui/toast.stories.tsx | 74 ++++++++++++++------------ src/screens/DataScreen.stories.tsx | 9 +++- src/screens/SettingsScreen.stories.tsx | 7 +++ 4 files changed, 59 insertions(+), 37 deletions(-) diff --git a/src/components/ui/button.stories.tsx b/src/components/ui/button.stories.tsx index aa17ad9c..81e48581 100644 --- a/src/components/ui/button.stories.tsx +++ b/src/components/ui/button.stories.tsx @@ -32,7 +32,11 @@ export default meta; type Story = StoryObj; /** Default primary button */ -export const Primary: Story = {}; +export const Primary: Story = { + args: { + className: 'bg-navy border-navy hover:bg-navy hover:border-navy', + }, +}; /** Secondary button — white surface with border */ export const Secondary: Story = { diff --git a/src/components/ui/toast.stories.tsx b/src/components/ui/toast.stories.tsx index b41169b8..263cef96 100644 --- a/src/components/ui/toast.stories.tsx +++ b/src/components/ui/toast.stories.tsx @@ -17,25 +17,27 @@ function ToastDemo({ autoTrigger?: boolean; }) { return ( - -
- -
-
+
+ +
+ +
+
+
); } @@ -69,7 +71,7 @@ function TriggerButton({ style={{ padding: '8px 16px', borderRadius: 12, - background: '#1F6FFF', + background: '#04145C', color: '#fff', border: 'none', fontSize: 14, @@ -84,20 +86,22 @@ function TriggerButton({ function StackedToastsDemo({ autoTrigger = false }: { autoTrigger?: boolean }) { return ( - -
- -
-
+
+ +
+ +
+
+
); } @@ -147,7 +151,7 @@ function StackedTriggerButton({ style={{ padding: '8px 16px', borderRadius: 12, - background: '#1F6FFF', + background: '#04145C', color: '#fff', border: 'none', fontSize: 14, diff --git a/src/screens/DataScreen.stories.tsx b/src/screens/DataScreen.stories.tsx index cda44d3f..8ec8bc4e 100644 --- a/src/screens/DataScreen.stories.tsx +++ b/src/screens/DataScreen.stories.tsx @@ -1,5 +1,6 @@ import type { Meta, StoryObj } from '@storybook/tanstack-react'; +import { ToastProvider } from '@/components/ui/toast'; import { useProjectStore } from '@/stores/project-store'; import { DataScreen } from './DataScreen'; @@ -89,7 +90,13 @@ const meta: Meta = { dataMode: context.args.dataMode, projectDataMode: context.args.projectDataMode, }); - return ; + return ( + +
+ +
+
+ ); }, ], // The screen takes no props — render it directly so the `selectedProjectId` diff --git a/src/screens/SettingsScreen.stories.tsx b/src/screens/SettingsScreen.stories.tsx index ed193bd8..7dcc840d 100644 --- a/src/screens/SettingsScreen.stories.tsx +++ b/src/screens/SettingsScreen.stories.tsx @@ -11,6 +11,13 @@ const meta: Meta = { parameters: { layout: 'fullscreen', }, + decorators: [ + (Story) => ( +
+ +
+ ), + ], }; export default meta; From 38567789b52a14e383d78f950a72c340d0783665 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 30 Jul 2026 05:08:59 -0300 Subject: [PATCH 2/2] fix(a11y): resolve toast and button story contrast --- src/components/ui/button.stories.tsx | 2 +- src/components/ui/toast.tsx | 6 +++--- tests/unit/components/ui/toast.test.tsx | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/ui/button.stories.tsx b/src/components/ui/button.stories.tsx index 81e48581..784ecda3 100644 --- a/src/components/ui/button.stories.tsx +++ b/src/components/ui/button.stories.tsx @@ -34,7 +34,7 @@ type Story = StoryObj; /** Default primary button */ export const Primary: Story = { args: { - className: 'bg-navy border-navy hover:bg-navy hover:border-navy', + className: '!bg-navy !border-navy hover:!bg-navy hover:!border-navy', }, }; diff --git a/src/components/ui/toast.tsx b/src/components/ui/toast.tsx index 88586c25..5f8a0417 100644 --- a/src/components/ui/toast.tsx +++ b/src/components/ui/toast.tsx @@ -22,9 +22,9 @@ interface ToastContextValue { const ToastContext = createContext(null); const variantClasses: Record = { - success: 'bg-success-soft text-success border-success', - error: 'bg-error-soft text-error border-error', - info: 'bg-info-soft text-info border-info', + success: 'bg-success-soft text-text border-success', + error: 'bg-error-soft text-text border-error', + info: 'bg-info-soft text-text border-info', }; function useToast() { diff --git a/tests/unit/components/ui/toast.test.tsx b/tests/unit/components/ui/toast.test.tsx index 4c6b4ec8..3d00fd3b 100644 --- a/tests/unit/components/ui/toast.test.tsx +++ b/tests/unit/components/ui/toast.test.tsx @@ -80,7 +80,7 @@ describe('Toast', () => { await user.click(screen.getByRole('button', { name: 'Show Toast' })); const toast = getVisibleToast(); expect(toast.className).toContain('bg-success-soft'); - expect(toast.className).toContain('text-success'); + expect(toast.className).toContain('text-text'); }); it('renders error variant with correct styling classes', async () => { @@ -91,7 +91,7 @@ describe('Toast', () => { await user.click(screen.getByRole('button', { name: 'Show Toast' })); const toast = getVisibleToast(); expect(toast.className).toContain('bg-error-soft'); - expect(toast.className).toContain('text-error'); + expect(toast.className).toContain('text-text'); }); it('renders info variant with correct styling classes', async () => { @@ -100,7 +100,7 @@ describe('Toast', () => { await user.click(screen.getByRole('button', { name: 'Show Toast' })); const toast = getVisibleToast(); expect(toast.className).toContain('bg-info-soft'); - expect(toast.className).toContain('text-info'); + expect(toast.className).toContain('text-text'); }); it('dismiss button closes toast', async () => {