Skip to content

Conversation

joshfarrant
Copy link
Contributor

Summary

Increased the touch target size of SubNav.SubMenu toggle button to 24px × 24px.

The button was previously only 16px × 16px, and rather than add 4px to the left and right I've instead added 8px to the right (along with -8px of margin-right) so as to not cause any visual changes. You can see the touch target size change in the screenshots below.

What should reviewers focus on?

  • Check that you're happy with the focus styles, and that the touch target is indeed 24px × 24px.

Supporting resources (related issues, external links, etc):

Contributor checklist:

  • All new and existing CI checks pass
  • Tests prove that the feature works and covers both happy and unhappy paths
  • Any drop in coverage, breaking changes or regressions have been documented above
  • UI Changes contain new visual snapshots (generated by adding update snapshots label to the PR)
  • All developer debugging and non-functional logging has been removed
  • Related issues have been referenced in the PR description

Reviewer checklist:

  • Check that pull request and proposed changes adhere to our contribution guidelines and code of conduct
  • Check that tests prove the feature works and covers both happy and unhappy paths
  • Check that there aren't other open Pull Requests for the same update/change

Screenshots:

Before After

image

image

Copy link

changeset-bot bot commented May 20, 2025

🦋 Changeset detected

Latest commit: d4acd41

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 7 packages
Name Type
@primer/react-brand Patch
@primer/brand-docs Patch
@primer/brand-primitives Patch
@primer/brand-e2e Patch
@primer/brand-fonts Patch
@primer/brand-config Patch
@primer/brand-storybook Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@joshfarrant joshfarrant marked this pull request as ready for review May 20, 2025 10:54
Copy link
Contributor

github-actions bot commented May 20, 2025

🟢 No design token changes found

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Increases the touch target size of the SubNav.SubMenu toggle button from 16×16 to 24×24 without altering its visual position by adding height, inline padding, and compensating negative margin.

  • Adjusted .SubNav__sub-menu-toggle CSS to enforce a 24px height and expand clickable area.
  • Provided a changeset entry to document the patch release.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
packages/react/src/SubNav/SubNav.module.css Added height, padding-inline-end, and margin-inline-end to expand the toggle’s touch target
.changeset/tiny-bears-lick.md Introduced a changeset recording the UI adjustment
Comments suppressed due to low confidence (1)

packages/react/src/SubNav/SubNav.module.css:633

  • It looks like there isn’t an updated visual snapshot or test verifying the new 24×24 touch target; consider adding or updating a snapshot to catch regressions for this change.
height: var(--base-size-24);

@joshfarrant joshfarrant force-pushed the joshfarrant/subnav-submenu-touch-target branch from d4acd41 to 14f5f65 Compare May 20, 2025 10:57
Copy link
Contributor

github-actions bot commented May 20, 2025

🟢 No visual differences found

Our visual comparison tests did not find any differences in the UI.

Copy link
Contributor

@danielguillan danielguillan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@joshfarrant joshfarrant merged commit dd93551 into main May 20, 2025
18 checks passed
@joshfarrant joshfarrant deleted the joshfarrant/subnav-submenu-touch-target branch May 20, 2025 13:59
@primer-css primer-css mentioned this pull request May 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants