From 63b12b92ecee6b6fd2231153ffda42aba3733949 Mon Sep 17 00:00:00 2001 From: ochenstarik Date: Fri, 11 Sep 2026 10:25:20 +0700 Subject: [PATCH] fix(mobile): enforce strict >= 44x44px touch targets on topbar, drawer close, and form builder controls --- e2e/11-modules-catalog.spec.ts | 5 ++--- e2e/12-mobile-first.spec.ts | 14 ++++++++++---- src/app/shell/MobileMenuDrawer.tsx | 2 +- src/app/shell/Topbar.tsx | 8 ++++---- src/features/settings/entities/FormBuilder.tsx | 8 ++++---- 5 files changed, 21 insertions(+), 16 deletions(-) diff --git a/e2e/11-modules-catalog.spec.ts b/e2e/11-modules-catalog.spec.ts index dd59aac..0538b05 100644 --- a/e2e/11-modules-catalog.spec.ts +++ b/e2e/11-modules-catalog.spec.ts @@ -1,9 +1,8 @@ -import { test, expect } from '@playwright/test'; +import { test, expect } from '@playwright/test'; test.describe('Scenario 11: Universal Modules Catalog & Profiles', () => { test.beforeEach(async ({ page }) => { - await page.goto('/'); - await page.waitForLoadState('domcontentloaded'); + await page.goto('/', { waitUntil: 'domcontentloaded' }); }); test('1. First open immediately displays all 18 modules with "Все модули" active by default', async ({ page }) => { diff --git a/e2e/12-mobile-first.spec.ts b/e2e/12-mobile-first.spec.ts index 7786719..4060a7f 100644 --- a/e2e/12-mobile-first.spec.ts +++ b/e2e/12-mobile-first.spec.ts @@ -2,8 +2,7 @@ import { test, expect } from '@playwright/test'; test.describe('Scenario 12: Mobile-First and Tablet Architecture Overhaul', () => { test.beforeEach(async ({ page }) => { - await page.goto('/'); - await page.waitForLoadState('domcontentloaded'); + await page.goto('/', { waitUntil: 'domcontentloaded' }); }); test('1. Mobile viewport (< 768px) automatically displays bottom navigation', async ({ page, viewport }) => { @@ -88,6 +87,12 @@ test.describe('Scenario 12: Mobile-First and Tablet Architecture Overhaul', () = // Close drawer const closeBtn = page.locator('[data-testid="close-mobile-menu"]'); + const closeBox = await closeBtn.boundingBox(); + expect(closeBox).not.toBeNull(); + if (closeBox) { + expect(closeBox.height).toBeGreaterThanOrEqual(44); + expect(closeBox.width).toBeGreaterThanOrEqual(44); + } await closeBtn.click(); await expect(drawer).not.toBeVisible(); }); @@ -139,11 +144,12 @@ test.describe('Scenario 12: Mobile-First and Tablet Architecture Overhaul', () = if (await moveDownBtn.isVisible()) { await expect(moveDownBtn).toBeVisible(); - // Verify button has accessible touch target + // Verify button has accessible touch target >= 44x44px const box = await moveDownBtn.boundingBox(); expect(box).not.toBeNull(); if (box) { - expect(box.height).toBeGreaterThanOrEqual(28); + expect(box.height).toBeGreaterThanOrEqual(44); + expect(box.width).toBeGreaterThanOrEqual(44); } } }); diff --git a/src/app/shell/MobileMenuDrawer.tsx b/src/app/shell/MobileMenuDrawer.tsx index 909e884..3162655 100644 --- a/src/app/shell/MobileMenuDrawer.tsx +++ b/src/app/shell/MobileMenuDrawer.tsx @@ -97,7 +97,7 @@ export const MobileMenuDrawer: React.FC = ({ isOpen, onCl