Repository navigation
DataViews: Fade the table's scroll edges with CSS - #86829
Conversation
🤖 PR meta 🤖🎉 PropsUnlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @lucasmendes-design. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. 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. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
Updated as activity occurs, without notifying anyone named here. Add the 📦 Bundle sizeSize Change: +3.72 kB (+0.04%) Total Size: 8.68 MB 📦 View Changed
⚡ PerformanceShow the resultsClient side metrics exclude the server response time. front-end-block-theme
front-end-classic-theme
media-processing
media-upload
post-editor
site-editor
|
|
cc @verofasulo |
|
In general, seems fine to me, but I appreciate you making a connection to the effort here, which is conceptually the same, so I defer to Miklic on details. |
|
Thanks for the ping, @oandregal! I like the idea, but I'm not sure it fully solves the issue. This is a good example where I have many columns enabled, but I don't have any visual clues that they are hidden.
It seems like a mix of issues: 3 primary actions appearing on hover, weird column width/spacing, and a fading effect that is nice and subtle but not always effective. Looping in @lucasmendes-design since I know he's explored this. 🙂 |
|
In this PR, I'd like to focus on using fading as I understand that's the direction we want to pursue (see wp-admin's approach and the design system reserves shadow for elevation, if I understand the rational correctly). Happy to explore shadow separately if that's the agreed upon direction we want to follow. I've pushed a change so the divider is visible when there's horizontal scroll which addresses Veronica's point (what happens when there's no actual content to fade but there's still horizontal scroll?). The divider is hidden when there's no h scroll. How does it look now? Screen.Recording.2026-11-16.at.10.36.12.mov |
|
I've done a few changes as per @mattmiklic suggestions: reduced the fade width and added a leading edge fade as well. This PR is using 24px for fading (both leading and trailing) while wp-admin approach uses 32px. 24 is the amount of padding we have at the leading edge and so it was a natural fit (the column is faded away when it is scrolled out of view, if that makes sense). Using 32px was also a bit tricky/complex. Happy to take another look at this if design folks think 32 is a better fit. Screen.Recording.2026-11-16.at.11.07.33.mov |
|
@verofasulo you should see a stroke on the actions column when the table scrolls. It's not perfect, but as @oandregal says shadows should be reserved for elevation and not applied arbitrarily. |
|
There are many cases where we don't have the Action column and the table scroll is impossible to notice. The worst case is when the card ends exactly between two columns. The table looks complete and the user never finds the rest. |
|
I'd suggest the fade treatment here since it is an elevation. The action column is above the others. But I defer to you and design system folks to tackle that. |
a03d3be to
cca887c
Compare
This is what I have now:
Screen.Recording.2026-11-17.at.14.00.03.mov
Screen.Recording.2026-11-17.at.13.58.00.mov |
|
Thanks for trying that. I think fading the row strokes helps. Less sure about the double-column-stroke. Let's see what others think. One small tweak worth considering; when you reach the end of the scroll I wonder if the actions column stroke should disappear to resemble the appearance when there's no scrolling. |
Echoing this, the double-column stroke looks off, but the fade helps. Possibly the fade is slightly aggressive, but not a strong opinion.. I want to note I like the white fade because for me it makes the table a single surface. Nevertheless I wanted to note that in some cases, @mattmiklic has preferred a shadow instead. I think the broader context is the zebra striping that list tables have, but I also think he solved it in his patch. Zebra stripes or not is a conversation to have at some point, by the way. Here's an experiment of slight CSS-only changes to classic list tables that I've made: not to distract from the current work, but simply to connect some dots with future explorations I'd like to make:
|
Set the padding of the first and last columns to zero where it is defined, since the fade cells take its place, instead of overriding it later with selectors repeated only to win on specificity. The sticky actions column, which ends the row in place of the trailing fade cell, now sets its own 24px end padding. Moving these rules to logical properties also fixes RTL tables with actions, where the physical end padding of the last column gave the actions 12px at their end and no gap after the fade divider. Point the three fade gradients at custom properties for the start and end directions, flipped once for RTL, instead of a `:dir(rtl)` rule per fade. Drop the tests that repeated the stylesheet as computed values, keeping one for the direction of the fades in both writing directions, and check the actions column's padding in RTL too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replace the 1px divider before the sticky actions column with a double rule, and show it whenever the columns scroll, including at the end of the scroll range. The actions column sits outside the scroll region, and the rule marks that edge like a frozen pane, without a shadow. The rule also covers the space of the line between rows, so it is not broken at each row. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The lines between rows ran solid through the scroll fades, so the fades read as washed-out patches rather than edges. Each cell now draws its share of the line, and a fade hides its own share while it is active, so the lines of the columns scrolling under it fade out with their content. The fades are now active only while there are more columns to scroll to on their side, using the same scroll-driven animations as the divider. At rest a fade cell covers only its own space, so it stays opaque and keeps its line, and the lines still reach the edges of the table. Browsers without scroll-driven animations always fade, as before. The rows keep a transparent border, so their height does not change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A vertical scrollbar over the end of the table, as overlay scrollbars are, covered the outer part of the end fade, where it is most opaque, so the columns looked cut off rather than faded. Without actions, the end fade is now 32px wide and opaque over its outer 16px, so the columns have faded out before they reach the scrollbar. The start fade stays 24px, so the first column keeps lining up with the components above the table. With actions, the scrollbar covers the end padding of the actions column instead, so its fade is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The fades sat in the 24px padding at the edges of the rows, and their linear gradient left most of it see-through: text 12px from the edge was still half visible, so the fade only read over the last few pixels. While there are more columns to scroll to, the cells at the edges now cover their whole padding, and an outline in the row's background reaches 24px over the columns next to them, fading those out instead. The mask is sized to the row and stops at its edge, so only that part of the outline shows, and at rest it hides the outline, so the columns do not move or get covered. The outline stands in for a box shadow, which Chrome does not paint on these cells. The rows carry their background in a custom property, which the outline uses, since it cannot inherit it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
At rest, the cells at the edges of the rows were opaque, and the one at the start sits above the columns, so it covered the part of the first column's focus ring that reaches into the padding, like the checkbox's. At rest these cells only need to draw their share of the row line, so their mask now keeps just that line, intersecting it with the mask that hides the outline. While the columns scroll under them, they still cover them as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replace the double rule before the sticky actions column with the 1px divider from trunk, as light as the lines between rows and hidden at the end of the scroll range. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fade by default, and switch to the rest mask only where a scroll timeline drives the fade. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The row background property already follows selection, so the rules that repainted the actions column for selected and hovered rows are no longer needed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Firefox and iOS Safari 18 do not support scroll timelines, so the fades and the divider before the actions always showed there, covering the start of the first column at rest. The fades now rest by default, and where the browser has no scroll timeline the table sets `has-columns-before` and `has-columns-after` from its scroll position, which apply the same styles as the animations. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… test Firefox lists a `mask-composite` value once when it repeats for every mask layer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Safari clips a mask to the element's box even with `mask-clip: no-clip`, so the outline that fades the columns next to a covering cell was hidden, and the columns were cut off at its edge. Chrome and Safari now mask the outline with a mask border whose outset reaches over the columns; Firefox keeps the mask that is not clipped to the box. The outline is now only there while a fade is active, so nothing needs to hide it at rest: the covering cells have no mask at rest, and the cells that only keep the row line mask everything else. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…croll range in Safari Safari keeps a scroll-driven animation applied at the end of the scroll range, past the end of its own range, so the fade before the actions stayed active there: the row lines stopped short of the actions, and the divider stayed. A second animation, over the last pixel of the range, puts the fades and the divider back at rest. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
While scrolling, Firefox moves the mask of the sticky actions column behind the column, so it cut off the end of the actions, or let the columns show through its start. The actions column now has no mask: a pseudo-element covers the strip at its start, with its share of the row line, and fades out the columns next to it with a gradient in the row's background. It shows while there are columns to scroll to, like the divider. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nd end Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ry browser The table already set its `has-columns-before` and `has-columns-after` classes from the scroll position where scroll-driven animations are not supported. Use them in every browser, so the cues have a single code path, and drop the scroll-driven animations along with the reset animations that worked around Safari keeping them applied at the end of the scroll range. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The fade cells are stuck to the edges of the scroll container, which clips anything beyond them, so a mask that fades out on both sides of the cell works for either edge in either direction. This drops the per-side and right-to-left mask variables and the mixins that picked between them, and the row line no longer needs a position, as it spans the whole cell. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…mask Firefox misplaces the mask of a sticky cell while scrolling with a trackpad, so the fade at the start of the rows showed the columns under it, or none of its fade. The fade cells now paint the row's background and its ramp in a gradient, doubled in width from the edge of the row while they are active, so they reach over the columns without a mask or an outline. At rest they are transparent apart from their share of the row line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3e1e612 to
db07651
Compare
|
Pushed a new version that keeps the existing scroll hook in place (for browser support) and simplifies a bit everything. It's now working nicely across browsers: Chrome Screen.Recording.2026-11-19.at.12.35.10.movSafari Screen.Recording.2026-11-19.at.12.36.20.movFirefox Screen.Recording.2026-11-19.at.12.51.56.mov |
|
I read this is ready: it has design support and we're aligned with wp-admin tables work as well, so in lieu of more feedback, I'll merge once tests pass. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>






What?
Closes #85898
Alternative to #85949: fades both edges of the table while there are more columns to scroll to on that side. Following the suggestions in the issue, it matches the approach of the wp-admin list tables (WordPress/wordpress-develop#13866): a fade at the leading and trailing edges. The divider before the sticky actions column stays as on trunk.
While there are more columns to scroll to, the cell at each edge covers the 24px padding at the end of the rows, and the columns next to it fade out over another 24px. Without actions, the trailing cell is 32px wide, so a vertical overlay scrollbar does not cut the columns off before they fade.
Recordings
Chrome
Screen.Recording.2026-11-19.at.12.35.10.mov
Safari
Screen.Recording.2026-11-19.at.12.36.20.mov
Firefox
Screen.Recording.2026-11-19.at.12.51.56.mov
Why?
Today only the trailing edge has a cue, and only in tables with actions. The fades are drawn in CSS, so each row fades into its own background, including selected rows, and RTL needs no extra rules. JS only reports whether there are columns before and after the visible ones, which works the same in every browser.
How?
useScrollStatenow always tracks both horizontal edges, and the table getshas-columns-beforeandhas-columns-afterclasses from it (plushas-actions). It handles RTL's negativescrollLeft, and aResizeObserveron the container and the table replaces the windowresizelistener, since showing, hiding or loading columns changes the scroll range without firingscroll.tr::beforecell at the start of each row, with its own column in thecolgroup. It takes the place of the first column's start padding, so the first column does not move. The header button of the first column pulls back by its own padding, so its label stays lined up with the cells.::beforestrip at the start of the sticky actions column covers the columns that scroll under it and fades out the ones next to it. The actions column paints the row's background.tr::aftercell at the end of each row, taking the place of the last column's end padding.tbodynow inherits the table's background, so rows without their own background have a color to fade into.Adds browser tests (
table-scroll-fade.browser.test.tsx) for the fades, the divider and the alignment, in both directions.Breaking changes
The
dataviews-view-table__actions-column--stuckanddataviews-view-table__actions-column--stickyclasses are removed.--stickywas applied everywheredataviews-view-table__actions-columnwas, so custom styles should target that class instead.Testing Instructions
Use of AI Tools
Claude Code (Claude Opus 5.5) wrote the implementation and tests, which I reviewed.