Repository navigation
DataViews: Hide table headers when nothing is returned. - #75269
StevenDufresne wants to merge 1 commit into
Conversation
|
@andrewserong I know you had some concerns about flickering. Can you produce that on this branch? I'm not certain I totally understand the state we're concerned about. |
|
Size Change: +7 B (0%) Total Size: 2.99 MB
ℹ️ View Unchanged
|
|
Thanks for the ping! Yes, I can reproduce it here, but only in an environment that goes slow enough in the loading state. A good place to test this out is the Pages list in the site editor, and switch to the Table layout: 2026-02-06.14.02.06.mp4The flickering state I was (mildly) concerned about is going from the loading state to no results and back again. It feels a little jumpy to me, but not necessarily a blocker if folks don't mind it! Note that there are also other flickering issues with this layout (i.e. the popping in and out of the select checkbox). In the long-term, I think it'd feel more polished if each of these areas of the layout could feel a little more solid and not pop in and out so much. But again, not a blocker at all IMO as these things can always continue to be iterated on as we get a sense for how they feel. The only other thing I'd note is that it'd be good to implement the same change for the very similar |
|
Nice thanks. That experience is bad. Let me think. |
|
Short of forcing restrictive APIs for the DataViews, there's no consistent and logical way to do this without hiding the table headings while loading as well (based on my understanding :)). I've made a change here to hide them when there is no data. You can play around with it. This is a very opinionated route to take. @andrewserong, since you've been helpful in pointing out use cases to consider.... do you see any scenarios where this approach would obviously fail? If not, I'll open a ticket proposing this change. If I'm missing an important use case, which is a possibility, I'd like to change the framing of how I present it. Any help is appreciated! |
|
Super briefly, I'm going to pitch that table in DataViews is just one layout option. The search bar, filters, and data controls exist independently of the layout. Comparing us to data tables that don't hide headings isn't apples-to-apples since we let users control display settings. Showing nothing when there are no results is a consistent approach and could/should be uniform across all layouts. There are some compromises that will be needed though. |
I find it a little hard to conceptualise these sorts of things, I mostly find edge cases by putting things through their paces / throttling network speed, etc, to see how things feel. But I think each of the ideas are worth trying to see which feels the least janky. While not necessarily the right approach, another possibility could be to hide via opacity rather then removing from the markup. I.e. via injecting an additional classname or something. That then opens up the possibility of either fading or delaying setting opacity to |
Also a good point 👍 |
|
I've opened an issue to discuss! DataViews: Hide table layout content (including headers) when there is no data. |
|
Going with #74572. |
What?
Closes: {none yet, experiment}
Why?
Previously, table headers were always rendered regardless of data state. This created an awkward empty state where column headers sat above a "No results" message. This PR hides the headers when we have no data.
How?
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast
Video
Screen.Recording.on.2026-02-06.at.11-49-02.1.mp4