-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Conversation
22d0500
to
38c18ec
Compare
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Edit: Fixed! |
5a8f807
to
1d52063
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review, @t-hamano! I've tried to minimize the visual diff as much as possible in the latest commit. TrunkThis PRVisual DiffMinimizing the diff further may not be feasible due to existing issues in trunk:
These issues are addressed in this PR.
|
fd14c65
to
0c377d5
Compare
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. |
There was a problem hiding this 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 |
---|---|
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 🤔
There was a problem hiding this 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:
gutenberg/packages/dataviews/src/dataviews-layouts/table/style.scss
Lines 82 to 88 in f23eaaa
@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; | |
} | |
} |
However, this could be addressed as a follow-up 👍
…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>
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
Testing Instructions for Keyboard
Same
Screencast