Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Components: Remove unnecessary Tooltip component from linked button #68498

Merged
merged 7 commits into from
Jan 24, 2025

Conversation

im3dabasia
Copy link
Contributor

Fixes: #66271

What?

Quick code quality PR to remove unnecessary usage of the Tooltip component.

Why?

Improve on code quality

How?

Remove Tooltip component and leverage the built-in Button label prop.

Testing Instructions

border-box-control-linked button

  1. Select a Group block.
  2. In the block Settings panel, go to Styles > Border & Shadow
  3. Hover or focus the 'Unlink sides / Link sides' button.
  4. Observe the button tooltip is unchanged: 'Unlink sides' or 'Link sides' depending on the UI state.
  5. Observe the accessible name (aria-label) of the Button is unchanged and matches the tooltip.

spacing-sizes-control linked button

  1. Select a Spacer block.
  2. In the block Settings panel, go to Styles > Dimensions > Margin
  3. Hover or focus the 'Unlink sides / Link sides' button.
  4. Observe the button tooltip is unchanged: 'Unlink sides' or 'Link sides' depending on the UI state.
  5. Observe the accessible name (aria-label) of the Button is unchanged and matches the tooltip.

Screenshots

border-box-control-linked button

Screenshot 2025-01-06 at 11 40 32 AM

spacing-sizes-control linked button

Screenshot 2025-01-06 at 11 57 48 AM

box-control-linked-button (I tested in the in the boxcontrol story)

Screenshot 2025-01-06 at 12 02 44 PM

Copy link

github-actions bot commented Jan 6, 2025

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: im3dabasia <im3dabasia1@git.wordpress.org>
Co-authored-by: afercia <afercia@git.wordpress.org>
Co-authored-by: ciampo <mciampini@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@akasunil akasunil added [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Type] Code Quality Issues or PRs that relate to code quality [Package] Components /packages/components labels Jan 6, 2025
@im3dabasia
Copy link
Contributor Author

Hi @afercia,
When you have a moment, could you please review my PR?

Copy link
Contributor

@afercia afercia left a comment

Choose a reason for hiding this comment

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

@im3dabasia thanks for working on this.
I left a note about removing an apparently unnecessary View component.

Also, a changelog entry should be added to the 'Unreleased' section of the packages/components/CHANGELOG.md file referencing the changes in the BorderBoxControl and BoxControl components. For an example, see this entry that references two components.

@im3dabasia im3dabasia requested a review from afercia January 20, 2025 16:26
Copy link
Contributor

@afercia afercia left a comment

Choose a reason for hiding this comment

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

Looks good to me.
@im3dabasia can you please solve the merge conflict in packages/components/CHANGELOG.md when you have a chance?

@im3dabasia im3dabasia requested a review from afercia January 24, 2025 11:58
Copy link
Contributor

@afercia afercia left a comment

Choose a reason for hiding this comment

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

LGTM

@afercia afercia merged commit d516b23 into WordPress:trunk Jan 24, 2025
64 checks passed
@github-actions github-actions bot added this to the Gutenberg 20.2 milestone Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Package] Components /packages/components [Type] Code Quality Issues or PRs that relate to code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Audit usage of explicit aria-label on Button component implementations
3 participants