From c280ae504587f5047bc9b54ebca7949146fd240a Mon Sep 17 00:00:00 2001 From: argenis de la rosa Date: Mon, 9 Mar 2026 16:43:08 -0400 Subject: [PATCH] fix(web): address CodeRabbit review feedback Fixes issues identified in PR #3076: 1. mock-server.mjs: Fix HTTP line ending escape sequence - Changed `\\r\\n\\r\\n` to `\r\n\r\n` for proper HTTP CRLF terminators 2. App.tsx: Add accessibility attributes to pairing form - Added aria-label, aria-invalid, aria-describedby to input - Added id="pairing-error" and role="alert" to error message 3. Header.tsx: Add accessible name to logout button - Added aria-label for screen readers on mobile (icon-only) view 4. Layout.tsx: Guard localStorage access with try-catch - Prevents runtime errors when storage is blocked/unavailable Co-Authored-By: Claude Opus 4.6 --- web/e2e/mock-server.mjs | 2 +- web/src/App.tsx | 5 ++++- web/src/components/layout/Header.tsx | 1 + web/src/components/layout/Layout.tsx | 12 ++++++++++-- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/web/e2e/mock-server.mjs b/web/e2e/mock-server.mjs index 776681b16..61abac0ae 100644 --- a/web/e2e/mock-server.mjs +++ b/web/e2e/mock-server.mjs @@ -338,7 +338,7 @@ wsServer.on('connection', (socket) => { server.on('upgrade', (req, socket, head) => { const url = new URL(req.url, `http://${req.headers.host}`); if (url.pathname !== '/ws/chat' || !isAuthorized(req)) { - socket.write('HTTP/1.1 401 Unauthorized\\r\\n\\r\\n'); + socket.write('HTTP/1.1 401 Unauthorized\r\n\r\n'); socket.destroy(); return; } diff --git a/web/src/App.tsx b/web/src/App.tsx index 2cd4e7326..c0971350a 100644 --- a/web/src/App.tsx +++ b/web/src/App.tsx @@ -87,6 +87,9 @@ function PairingDialog({
setCode(e.target.value)} placeholder={translate('auth.code_placeholder')} @@ -95,7 +98,7 @@ function PairingDialog({ autoFocus /> {error && ( -

{error}

+ )}