-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add sticky-csv-header
feature
#6020
Conversation
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 opening the PR! The feature is reasonable, CSS-only, short and you already wrote it, tested and documented it.
Hard to reject it for #5892 🤭
Co-authored-by: Federico Brigante <me@fregante.com>
@@ -0,0 +1,33 @@ | |||
.markdown-body .csv-data { |
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.
Does this apply only to CSV data and other tabular data?
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.
I think it does.
@@ -0,0 +1,33 @@ | |||
.markdown-body .csv-data { | |||
max-height: 100vh; |
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.
On second thought… nested scroll areas aren't my favorite and this only works well if you perfectly align the scroll area to the viewport. It shouldn't be necessary
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.
It is necessary, since that element is already scrolling horizontally.
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.
I think the nested scroll-area makes this unusable :(
Achieving your screenshot means carefully scrolling the main document to fit the table.
Overscrolling means that the headers are sticky, but outside the viewport, so still not visible; underscrolling means that the headers are sticky, but in the middle of the viewport. Fixing the main scroll means having to find a corner of the viewport outside this nested scroll area.
And I don't even wanna think of how impossible this is on mobile.
We can only merge it if there's a way to have the sticky headers without using max-height: 100vh
How about only making the row headers sticky? That would be an improvement already, even if not complete |
I've changed it to make only the row headers sticky. |
source/features/github-bugs.css
Outdated
/* Restore zebra-colored rows in CSV files */ | ||
.blob-wrapper.type-csv table tr:nth-child(2n) { | ||
background-color: var(--color-canvas-subtle); | ||
} |
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.
sticky-csv-header
CSS-only featuresticky-csv-header
feature
Browsing big CSV files in GitHub's UI is difficult, because the table header scrolls away. This CSS-only feature makes the first line and the row numbers sticky.
Unfortunately, there are double vertical scrollbars now, but I think this still improves the usability.
Test URLs
.tsv
file: https://github.com/4dcu-be/GitHub-Actions-KeyForge/blob/8d53ec2/data/keyforge_decks.tsvScreenshots
Before
After