Frontend: Accessibility Audit + SSE Real-time Payment Status#183
Merged
Pvsaint merged 3 commits intoMetroLogic:mainfrom Feb 26, 2026
Merged
Frontend: Accessibility Audit + SSE Real-time Payment Status#183Pvsaint merged 3 commits intoMetroLogic:mainfrom
Pvsaint merged 3 commits intoMetroLogic:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #116
Closes #129
Summary
This PR addresses two frontend issues:
Changes
Accessibility Improvements
Checkout components:
PaymentStatus.tsx-- Addedrole="status",aria-live="polite",aria-label, andaria-hiddenon decorative icons.PaymentTimer.tsx-- Addedrole="timer",aria-live="off", human-readablearia-label, andmin-h-[44px]touch target.PaymentQRCode.tsx-- Addedrole="img"with descriptivearia-labelon QR container,aria-labelledbylinking address to its label.pay/[payment_id]/page.tsx-- Addedrole="status"androle="alert"on state containers,aria-hiddenon all decorative icons,aria-labelon payment instructions, and responsive padding for mobile.Dashboard components:
Sidebar.tsx-- Addedaria-labelon sidebar and nav elements,aria-current="page"on active link,aria-label="Close menu"on mobile close button,aria-hiddenon icons, andmin-h-[44px]touch targets on all nav links.DashboardShell.tsx-- Addedrole="main"on main content area,aria-hiddenon overlay backdrop, and Escape key handler to close mobile sidebar.Modal.tsx-- Addedrole="dialog",aria-modal="true",aria-labelledbypointing to modal title, focus trap (Tab key cycling), Escape key to close, focus restoration on close, and 44px minimum close button touch target.SSE Real-time Payment Status
api/payments/[payment_id]/stream/route.ts-- SSE endpoint usingReadableStreamthat pushes payment status every 2 seconds. Automatically closes the stream on terminal states (confirmed, expired, failed). Cleans up on client disconnect viaAbortSignal.hooks/usePaymentStatus.ts-- Connects viaEventSourcefirst for instant updates. On SSE error or connection failure, automatically falls back to the existing 3-second polling. ExposesconnectionType('sse' | 'polling') for observability. Properly cleans up both EventSource and polling intervals on unmount or terminal state.Testing
All CI pipeline checks pass:
npx eslint . --max-warnings=0)npm run build)npm test)No new dependencies were added. All existing tests (PaymentStatus, StatsCards, LoginForm, SignUpForm) continue to pass without modification.
Files Changed (10 files, 1 new)
src/components/checkout/PaymentStatus.tsxsrc/components/checkout/PaymentTimer.tsxsrc/components/checkout/PaymentQRCode.tsxsrc/components/Modal.tsxsrc/app/pay/[payment_id]/page.tsxsrc/features/dashboard/components/Sidebar.tsxsrc/features/dashboard/layout/DashboardShell.tsxsrc/hooks/usePaymentStatus.tssrc/app/api/payments/[payment_id]/stream/route.ts[NEW]