FIX Improve mobile touch targets#2258
Open
romanlutz wants to merge 2 commits into
Open
Conversation
Apply shared mobile-only 44px hit areas across the verified frontend controls and add responsive bounding-box coverage. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 7c18414c-86c8-49b5-9557-c6e93c29c02c
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves mobile usability in the PyRIT frontend by enforcing a minimum 44×44px touch target size for key interactive controls at widths ≤600px, while preserving existing compact desktop sizing. It does this via shared style primitives and applies them across Home, Labels, Configuration, Tour, Chat, and History, with Playwright coverage verifying mobile geometry/reflow and representative desktop behavior.
Changes:
- Introduces shared mobile-only touch target style primitives (
mobileTouchTarget,mobileTouchTargetHeight) and constants infrontend/src/styles/touchTargets.ts. - Applies those primitives to numerous buttons/inputs across the UI (Home, Labels, Configuration, Tour actions, Chat controls, History controls).
- Adds a new Playwright E2E suite to validate minimum hit areas on mobile, no horizontal overflow, and preserved compact sizing on desktop.
Reviewed changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/styles/touchTargets.ts | Adds shared mobile breakpoint + minimum touch target size primitives for reuse across components. |
| frontend/src/components/Tour/TourTooltip.tsx | Applies mobile touch target styling to Joyride tour action buttons. |
| frontend/src/components/Tour/TourTooltip.styles.ts | Introduces actionButton style using shared mobile touch target primitive. |
| frontend/src/components/Labels/LabelsBar.styles.ts | Ensures the labels icon button meets minimum touch size on mobile. |
| frontend/src/components/Home/Home.tsx | Applies touch-target class to key Home CTA buttons. |
| frontend/src/components/Home/Home.styles.ts | Adds reusable touchTarget and applies minimum touch height to operation rows on mobile. |
| frontend/src/components/History/HistoryPagination.tsx | Ensures pagination buttons meet minimum touch height on mobile. |
| frontend/src/components/History/HistoryFiltersBar.tsx | Ensures “Reset all filters” button meets minimum touch height on mobile. |
| frontend/src/components/History/AttackTable.tsx | Ensures “Open attack” icon button meets minimum touch size on mobile. |
| frontend/src/components/History/AttackHistory.tsx | Ensures refresh/retry actions meet minimum touch height on mobile. |
| frontend/src/components/History/AttackHistory.styles.ts | Applies shared primitives to filter dropdowns and adds touch target utility styles. |
| frontend/src/components/Config/TargetTable.tsx | Ensures target table row action buttons meet minimum touch target size on mobile. |
| frontend/src/components/Config/TargetTable.styles.ts | Applies shared primitives to select/action elements and refines mobile sizing. |
| frontend/src/components/Config/TargetConfig.tsx | Ensures “New Target” CTA meets minimum touch target size on mobile. |
| frontend/src/components/Config/TargetConfig.styles.ts | Uses shared breakpoint/size constants and adds a touch-target style helper. |
| frontend/src/components/Chat/MessageList.tsx | Moves inline styles to a class to support mobile touch target sizing for message action buttons. |
| frontend/src/components/Chat/MessageList.styles.ts | Adds message action button styling and wraps actions on mobile for better touch usability. |
| frontend/src/components/Chat/ConversationPanel.tsx | Ensures panel header/retry/star controls meet mobile touch target sizing. |
| frontend/src/components/Chat/ConversationPanel.styles.ts | Adds shared touch target styling for header/star buttons and retry button height. |
| frontend/src/components/Chat/ChatWindow.tsx | Ensures ribbon action button meets minimum mobile touch target sizing. |
| frontend/src/components/Chat/ChatWindow.styles.ts | Applies shared touch target primitive to ribbon and “New attack” controls. |
| frontend/src/components/Chat/ChatInputArea.tsx | Adds optional buttonClassName to status banners to apply touch target sizing to banner CTAs. |
| frontend/src/components/Chat/ChatInputArea.styles.ts | Applies mobile touch target sizing to input area controls and adds a reusable touchTarget class. |
| frontend/e2e/touch-targets.spec.ts | Adds Playwright coverage for mobile touch target geometry, no horizontal overflow, and preserved desktop compact sizing. |
ValbuenaVC
reviewed
Jul 23, 2026
- touchTargets: key the mobileTouchTarget helpers off @media (pointer: coarse) instead of viewport width, and use 2.75rem (was 44px) so the minimum target scales with the user's text-zoom preference - Apply the touch-target helper to previously uncovered buttons in the same flows: ConverterPanel close, ConverterParams chevron toggle and Browse, and the CreateTargetDialog row delete button - Document the touch-target convention in the frontend style guide Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 1a26c899-a856-4e2e-bf8f-24de153c0154
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.
Description
At a 390x844 viewport, several reachable frontend controls exposed hit areas below the recommended 44x44 size, making them harder to activate reliably on touch devices.
This change adds shared mobile-only touch-target primitives and applies them across Home and Labels, Configuration, tour actions, Chat, and History. The sizing activates only at widths up to 600px, preserving desktop density and the existing 44x44 sidebar controls. Focused geometry coverage verifies each adjusted control group, mobile reflow without document-level horizontal overflow, and representative desktop behavior.
Tour viewport containment and clipping remain intentionally unchanged because they are outside this fix's scope.
N/A - this change is not breaking.
Tests and Documentation
JupyText: N/A; this is a frontend-only change.