Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure
TypeScript
fix(desktop-app): align chat-drawer Home/End with the announced ARIA bounds
Diego Zacarias844449f95d62
diff --git a/desktop-app/ui/src/hooks/__tests__/useChatDrawerResize.keyboard.test.tsx b/desktop-app/ui/src/hooks/__tests__/useChatDrawerResize.keyboard.test.tsxindex 3dfc7a785..95c2ce9d9 100644--- a/desktop-app/ui/src/hooks/__tests__/useChatDrawerResize.keyboard.test.tsx+++ b/desktop-app/ui/src/hooks/__tests__/useChatDrawerResize.keyboard.test.tsx@@ -39,12 +39,14 @@ describe('useChatDrawerResize keyboard resize', () => {expect(result.current.width).toBe(CHAT_DRAWER_DEFAULT_WIDTH - 24) // 396})- it('jumps to the max on Home and the min on End', () => {+ it('jumps to the min on Home and the max on End (matching aria-valuemin/valuemax)', () => {+ // The handle announces aria-valuenow = width, valuemin = 340, valuemax = 820,+ // so the separator/slider convention requires Home → valuemin, End → valuemax.const { result } = setup()press(result, 'Home')- expect(result.current.width).toBe(CHAT_DRAWER_MAX_ABSOLUTE) // 820- press(result, 'End')expect(result.current.width).toBe(CHAT_DRAWER_MIN_WIDTH) // 340+ press(result, 'End')+ expect(result.current.width).toBe(CHAT_DRAWER_MAX_ABSOLUTE) // 820})it('ignores unrelated keys and does not preventDefault them', () => {diff --git a/desktop-app/ui/src/hooks/useChatDrawerResize.ts b/desktop-app/ui/src/hooks/useChatDrawerResize.tsindex 9a018ffe4..4877daa6a 100644--- a/desktop-app/ui/src/hooks/useChatDrawerResize.ts+++ b/desktop-app/ui/src/hooks/useChatDrawerResize.ts@@ -218,7 +218,11 @@ export function useChatDrawerResize(// Keyboard resize for the focusable separator handle (WAI-ARIA window-splitter// pattern): with `aria-orientation="vertical"`, Left/Right move the splitter.// The drawer is right-docked, so ArrowLeft widens it (mirroring a leftward- // drag) and ArrowRight narrows it; Home/End jump to the drawer's max/min.+ // drag) and ArrowRight narrows it. Home/End jump to the handle's ANNOUNCED+ // bounds: the handle reports `aria-valuenow` = drawer width with+ // `aria-valuemin` = MIN and `aria-valuemax` = MAX, and the slider/separator+ // convention binds Home → valuemin and End → valuemax. So Home shrinks to MIN+ // and End grows to MAX — matching what a screen reader announces on each key.const onResizeHandleKeyDown = React.useCallback((event: React.KeyboardEvent<HTMLElement>) => {let requested: numberswitch (event.key) {@@ -229,10 +233,10 @@ export function useChatDrawerResize(requested = widthRef.current - CHAT_DRAWER_KEY_STEPbreakcase 'Home':- requested = CHAT_DRAWER_MAX_ABSOLUTE+ requested = CHAT_DRAWER_MIN_WIDTHbreakcase 'End':- requested = CHAT_DRAWER_MIN_WIDTH+ requested = CHAT_DRAWER_MAX_ABSOLUTEbreakdefault:return