Skip to content

DataViews: Ensure consistent display of primary ellipsis in list layout #69846

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

Merged
merged 6 commits into from
Apr 9, 2025

Conversation

yogeshbhutkar
Copy link
Contributor

@yogeshbhutkar yogeshbhutkar commented Apr 7, 2025

What?

Closes #69570

This PR ensures the primary ellipsis in DataViews list items is always visible, regardless of interaction states such as hover, focus, or selection — or even when idle.

Why?

This improves accessibility, as noted here and addresses the linked issue.

How?

Corresponding CSS rules were updated and refactored for simplicity.

Testing Instructions

  1. Navigate to Appearance -> Editor -> Pages.
  2. Make sure that the data is displayed in List Layout.
  3. Click the Actions button and open the menu.
  4. Confirm that the primary ellipsis is always visible.

Testing Instructions for Keyboard

Same

Screencast

pr

@yogeshbhutkar yogeshbhutkar changed the title DataViews: Ensure Consistent Display of Primary Ellipsis in List Layout DataViews: Ensure consistent display of primary ellipsis in list layout Apr 7, 2025
@yogeshbhutkar yogeshbhutkar force-pushed the fix-69570/data-views branch from 22d0500 to 38c18ec Compare April 7, 2025 13:57
@yogeshbhutkar yogeshbhutkar marked this pull request as ready for review April 7, 2025 14:09
Copy link

github-actions bot commented Apr 7, 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: yogeshbhutkar <yogeshbhutkar@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: joedolson <joedolson@git.wordpress.org>

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

@Mamaduka Mamaduka added [Type] Bug An existing feature does not function as intended [Package] DataViews /packages/dataviews labels Apr 7, 2025
@yogeshbhutkar
Copy link
Contributor Author

yogeshbhutkar commented Apr 8, 2025

It looks like this PR is breaking the focus management in the data views list, as doing a display: none would remove the grid cell element. I'll be exploring some more ways to fix this!

Edit: Fixed!

@yogeshbhutkar yogeshbhutkar force-pushed the fix-69570/data-views branch from 5a8f807 to 1d52063 Compare April 8, 2025 05:29
@yogeshbhutkar
Copy link
Contributor Author

Hi @t-hamano,

Following up on our discussion here, I’ve opened this PR to address the issue. Can you please have a look at this PR when you get a moment? Thanks!

Copy link
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

I'm seeing some visual changes, so can you align these changes? However, if it is an intended change and it makes sense, I think the change is acceptable.

trunk

trunk

This PR

pr

Visual diff

image

@yogeshbhutkar
Copy link
Contributor Author

Thanks for the review, @t-hamano!

I've tried to minimize the visual diff as much as possible in the latest commit.

Trunk

trunk

This PR

after

Visual Diff

diff


Minimizing the diff further may not be feasible due to existing issues in trunk:

  1. Buttons overflow the hstack wrapper's width.

hstack

  1. The grid-cell width is smaller than the buttons.

gridcell

These issues are addressed in this PR.

HStack Gridcell
hstack-this-pr grid-cell-this-pr

@yogeshbhutkar yogeshbhutkar force-pushed the fix-69570/data-views branch from fd14c65 to 0c377d5 Compare April 9, 2025 04:48
@yogeshbhutkar
Copy link
Contributor Author

While working on this issue, I discovered a bug on Trunk. When navigating the data views list with the UP/DOWN arrow keys from the action buttons, starting from the Primary Action Button works as expected. However, starting from the Actions dropdown trigger in the Pages screen only allows traversal through the first two items. This doesn’t happen on the Templates screen.

Since this is unrelated to the current PR, I’d like to explore it separately and open a new PR to address it.

bug

Copy link
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

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

Thanks for the update! I noticed that this PR also fixed the vertical misalignment:

Before After
before after

If my understanding is correct, we should be able to delete some styles:

diff --git a/packages/dataviews/src/dataviews-layouts/list/style.scss b/packages/dataviews/src/dataviews-layouts/list/style.scss
index 0c4799539c..6c696b6ca4 100644
--- a/packages/dataviews/src/dataviews-layouts/list/style.scss
+++ b/packages/dataviews/src/dataviews-layouts/list/style.scss
@@ -34,10 +34,6 @@ div.dataviews-view-list {
                                flex: 0;
                                overflow: hidden;
                                width: 0;
-
-                               .components-button {
-                                       opacity: 0;
-                               }
                        }
                }
 
@@ -46,10 +42,6 @@ div.dataviews-view-list {
                                flex-basis: min-content;
                                width: auto;
                                overflow: unset;
-
-                               .components-button {
-                                       opacity: 1;
-                               }
                        }
                }

However, starting from the Actions dropdown trigger in the Pages screen only allows traversal through the first two items.

I can't reproduce this problem 🤔

@yogeshbhutkar yogeshbhutkar requested a review from t-hamano April 9, 2025 09:22
Copy link
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

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

LGTM!

I found another a11y issue. It would be better to show the primary button by default if the screen doesn't support the hover media query, such as the Table layout:

@media (hover: none) {
// Show checkboxes and quick-actions on devices that do not support hover.
.components-checkbox-control__input.components-checkbox-control__input,
.dataviews-item-actions .components-button:not(.dataviews-all-actions-button) {
opacity: 1;
}
}

image

However, this could be addressed as a follow-up 👍

@t-hamano t-hamano merged commit 87b3af7 into WordPress:trunk Apr 9, 2025
61 checks passed
@github-actions github-actions bot added this to the Gutenberg 20.7 milestone Apr 9, 2025
@yogeshbhutkar yogeshbhutkar deleted the fix-69570/data-views branch April 10, 2025 08:49
chriszarate pushed a commit to chriszarate/gutenberg that referenced this pull request Jul 1, 2025
…ut (WordPress#69846)

* fix: don't apply hover effect on primary ellipsis

* fix: don't use `display: none` to avoid focus loss

* fix: add gap to make it consistent with the previous layout

* fix: minimize diff with respect to previous layout

* fix: move gridcell selector outside

* chore: remove unused styles

Co-authored-by: yogeshbhutkar <yogeshbhutkar@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: joedolson <joedolson@git.wordpress.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] DataViews /packages/dataviews [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DataViews: Moving the cursor out of the window shifts the popover layout and hides the toggle icon in the list view.
3 participants