From 90cf12c319007d8a8039bd0492251679e03a6a81 Mon Sep 17 00:00:00 2001 From: khaira777 <777gurkirat@gmail.com> Date: Sat, 7 Nov 2026 13:03:27 -0500 Subject: [PATCH 1/2] fix(pos): close the payment queue drawer on Escape onDismissModalOrBlur handled the scheduled orders drawer but not the payment queue drawer, so Escape left it open. Close it after the payment and refund modals that can open above it. --- frontend/e2e/pos-keyboard-shortcuts.spec.ts | 21 +++++++++++++++++++++ frontend/src/app/(dashboard)/pos/page.tsx | 4 ++++ 2 files changed, 25 insertions(+) diff --git a/frontend/e2e/pos-keyboard-shortcuts.spec.ts b/frontend/e2e/pos-keyboard-shortcuts.spec.ts index 88f0adf26..eceec7f5e 100644 --- a/frontend/e2e/pos-keyboard-shortcuts.spec.ts +++ b/frontend/e2e/pos-keyboard-shortcuts.spec.ts @@ -649,6 +649,27 @@ test.describe('POS Keyboard Shortcuts & Rapid Cashier Ergonomics', () => { await page.getByRole('button', { name: 'Remove', exact: true }).first().click(); }); + test('Escape closes the payment queue drawer', async ({ page }) => { + await page.route('**/api/settings/multi_counter_enabled', async (route) => { + await route.fulfill({ json: { setting: { key: 'multi_counter_enabled', value: 'true' } } }); + }); + await page.route('**/api/counters*', async (route) => { + await route.fulfill({ json: { counters: [] } }); + }); + await page.reload(); + await expect(page.getByTestId('pos-product-grid')).toBeVisible(); + + await page.getByTestId('pos-payment-queue-btn').click(); + const drawer = page.getByTestId('payment-queue-drawer'); + await expect(drawer).toBeVisible(); + + await page.getByTestId('payment-queue-search').focus(); + await page.keyboard.press('Escape'); + await expect(drawer).toBeVisible(); + await page.keyboard.press('Escape'); + await expect(drawer).toHaveCount(0); + }); + test('PrepaidCheckoutModal focused buttons are not hijacked by global Space/Enter quick-pay', async ({ page, }) => { diff --git a/frontend/src/app/(dashboard)/pos/page.tsx b/frontend/src/app/(dashboard)/pos/page.tsx index 0bb1aa8f3..59c7becbe 100644 --- a/frontend/src/app/(dashboard)/pos/page.tsx +++ b/frontend/src/app/(dashboard)/pos/page.tsx @@ -3621,6 +3621,10 @@ export default function POSPage() { setShowScheduledOrders(false); return true; } + if (showPaymentQueue) { + setShowPaymentQueue(false); + return true; + } if (cashDrawer.open) { cashDrawer.setOpen(false); return true; From 54c0df084e15891375a6d558a443091668baa3cf Mon Sep 17 00:00:00 2001 From: khaira777 <777gurkirat@gmail.com> Date: Sat, 7 Nov 2026 13:38:19 -0500 Subject: [PATCH 2/2] fix(pos): restore focus to payment queue button on Escape close --- frontend/e2e/pos-keyboard-shortcuts.spec.ts | 1 + frontend/src/app/(dashboard)/pos/page.tsx | 3 +++ 2 files changed, 4 insertions(+) diff --git a/frontend/e2e/pos-keyboard-shortcuts.spec.ts b/frontend/e2e/pos-keyboard-shortcuts.spec.ts index eceec7f5e..9db3a22d5 100644 --- a/frontend/e2e/pos-keyboard-shortcuts.spec.ts +++ b/frontend/e2e/pos-keyboard-shortcuts.spec.ts @@ -668,6 +668,7 @@ test.describe('POS Keyboard Shortcuts & Rapid Cashier Ergonomics', () => { await expect(drawer).toBeVisible(); await page.keyboard.press('Escape'); await expect(drawer).toHaveCount(0); + await expect(page.getByTestId('pos-payment-queue-btn')).toBeFocused(); }); test('PrepaidCheckoutModal focused buttons are not hijacked by global Space/Enter quick-pay', async ({ diff --git a/frontend/src/app/(dashboard)/pos/page.tsx b/frontend/src/app/(dashboard)/pos/page.tsx index 59c7becbe..93a1b62db 100644 --- a/frontend/src/app/(dashboard)/pos/page.tsx +++ b/frontend/src/app/(dashboard)/pos/page.tsx @@ -3623,6 +3623,9 @@ export default function POSPage() { } if (showPaymentQueue) { setShowPaymentQueue(false); + setTimeout(() => { + document.querySelector('[data-testid="pos-payment-queue-btn"]')?.focus(); + }, 0); return true; } if (cashDrawer.open) {