Repository navigation
Table frame refactor - #3456
Open
benjaminleonard wants to merge 4 commits into
Open
Table frame refactor#3456benjaminleonard wants to merge 4 commits into
benjaminleonard wants to merge 4 commits into
Conversation
The table's outer border used to be painted by the edge cells, with ::after overlays faking the rounded corners. When a table without a sticky actions column overflowed, its right edge scrolled away and the border was left open. - Draw the border with a frame element pinned to the visible part of the scroller (sticky, sized with 100cqw), so it stays closed at any scroll position. Edge cells keep transparent 1px borders so column widths match. - Replace simplebar-react with a native scrollbar styled to match (::-webkit-scrollbar, scrollbar-color in Firefox), keeping 16px below the table whether or not it overflows. - Remove the corner overlays and !important overrides from table.css. - Draw row selection as one outline per row, merging adjacent rows with :has(), instead of box-shadow hacks on every cell. Removes the cloneElement pass in Table.Body. - Fade sticky column shadows in and out with scroll-state container queries where supported, falling back to the scroll-driven animations. Tables with no actions column get a matching shadow at the right edge while there's more to scroll to. - Table's className now applies to the outer box, so sizing classes like max-w-lg size the frame too. - Add narrow-viewport overflow cases to the visual regression suite. Not pixel-identical to before: two old quirks (no left border on the bottom-left cell, -m-px on last-column cells) skewed column widths, so some columns shift by a fraction of a pixel, and two-column tables are 1px taller.
- Set overscroll-behavior-y: none on html as well as body so the app shell never rubber-bands, whichever element the browser treats as the viewport - Use overscroll-contain on side modal, modal and sidebar scrollers so they keep their native end-of-content bounce without chaining to the page - Disable overscroll entirely on menus, dropdowns and popovers, where a bounce on a small floating panel looks broken
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some of the previous table logic was pretty awkward. In particular the outer border was drawn by the edge cells, with ::after overlays faking the rounded corners.. The downside of that is for tables without a sticky leading and trailing cell we were missing a border at the overflow.
Before:

After:

The outer border is now a sticky element sized to the scroller's visible width (100cqw), so it stays closed at any scroll position. Edge cells keep 1px transparent borders under it so column widths don't change.
Other refactoring
Overscroll
I adjusted because the overscroll behaviour messes with sticky table cells and the surrounding border. Should feel a bit more "app-like" now.
If we want to keep this PR more pure, we could probably just include the table overscroll behaviour?
@david-crespo I have dropped the shadow a little, I think we pushed it a little too far in #3440 but I'm open to being convinced otherwise since this is sort of screen dependant.