-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fix and standardize multiple table UI inconsistencies #4727
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.
I simplified the breakpoint code a bit, yet still found several issues in the app that I'll gladly pass on :)
-
Feature flags do not display well, no matter how I open the page. The key is always cut for me, and the description area is needlessly huge:
-
Events page (zoomed out to simulate a wide screen) won't let me resize things like I expect:
Probably outside the scope, or maybe not:
- If the widths auto-update while resizing, my dragging cursor is "let go" and I need to start resizing again:
- There's no way to make the last column of any table wider or shorter, plus the whitespace that's at the end of the table:
PS, my most common PR review comment is "simplify!", so feel free to always do that automatically :D. The logic here is that code is not written for computers to read, but for other humans to read. Computers can read your code no matter how you well you write it, but the human reading it will be caught off guard by clever code that's hard to parse. So always optimise code clarity for the cognitively lowest life form in the process: your fellow humans. Usually this means "make your code so simple it looks like a first year student wrote it".
The breaking cypress tests seem relevant as well. |
One more bug, this time in this cohorts table: |
Looks like @mariusandra already did a comprehensive review of this, tag me for a follow up review if needed @alexkim205 |
Fixed this by removing the arbitrary max column width I had set by default.
This one gets tricky because in order for the table to render correctly, one column needs to have an uncontrolled width set by the browser. But, because the size of the entire table and other columns update together, it works out such that this "uncontrolled" column appears to have a fixed width. Right now the last column is chosen for this unfortunate caveat, but maybe we could always push a blank column onto the end of the ones given to us via props. |
Why? :) |
@mariusandra If every column has a set width, the browser will just decide what it thinks appropriate width values are in order to fill the horizontal space of the Antd's docs have a similar warning:
When I was working on ResizableTable it was very hard to keep the resizable column headers in sync with the table's actual columns. I don't mean to suggest it's impossible but it might get hacky! |
Yeah, this sounds tricky. I don't know the nitty gritty details of antd's tables, and those tradeoffs probably make sense. Yet it's funny how "resizable table headers" is still an unsolved computer science problem :). Can't we just, after the table has fully loaded, capture all the flexibly set column widths, and then just keep them all in a controlled state as we start to resize? Not sure if this helps anything 😅 |
Thanks for the input everyone. Given the above discussion on ResizableTable, there're two more things I want to look into in this PR.
Please correct me if I'm wrong, but from my interpretation of today's code, we nix antd's table header, and prepend a custom header with columns that we keep in sync with the table's columns. If the above reading of the code is correct, this seems to bring a lot more pain than joy when dealing with edge cases like:
Have we previously considered the resizable columns implementation in the official antd documentation? If I'm not overlooking an obvious disadvantage with this option, I feel passing in our More on point 2: I'll put out a proof of concept about what I mean soon |
@alexkim205 The example in the Antd docs is a bit of a red herring. It's not an obvious disadvantage at first — it re-renders the entire table on each resize event, which happens every few milliseconds. It gets borked on very long tables like Events or Sessions. Even if the resizes are throttled to occur once every 60 or 100 ms, e.g. with This actually was my first approach, but then I settled on a CSS-based solution; updating the widths specified in |
Discussed some possible approaches during standup. Here are some notes for posterity:
|
|
Yup it's a headless utility library so it's pretty cool that you can pick and choose features you want to include. One feature I've been having a hard time playing nicely is expandability. Still trying to figure out a way to make rows expandable without breaking resizability and virtualization In summary, want to combine |
Demofeat.movBugs 2-5 happen on the events table and I think it requires a different implementation of the events table to fix this. I'll address this in another PR as it's out of the scope. |
I think this bug is fixed by my commit here that was merged in as part of @paolodamico's InsightsTableV2 update. But the fix hasn't been made in V1, so I'll bring my commit over here too. |
Whelp, should have merged instead of rebase from master. Please ignore all those commits that I brought in except the last one. I'll squash and clean up accordingly when I merge this PR in. |
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.
.
fc42eda
to
096f38b
Compare
Hey @mariusandra sorry about the commit cereal. I think this rev should be cleaner |
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'm not sure how annoying this feedback is to fix, but it's all given in the service of "let's have better UX". I'm also not sure if any of my comments override anything said before or not. :)
Some comments inline, some below.
- Let's remove the ellipsis from the feature flags table. I think There's no reason this table needs fixed heights. Looking at our own data, if we'd merge this, we'd have a sub-par experience... as we'll have mountains of whitespace all around the page, yet we won't be able to actually read any flag keys and descriptions. That sounds like a failure. So can we just make it look like this, but... uhm... work? :D
-
Similar comment for the annotations table. The annotation column is anyway in two lines sometimes if "last updated" pushes it so.... so why the ellipsis? Let's remove it. The whitespace is also very suboptimal in full screen.
Thanks for the hot fix, looks like a bad merge resolution on my part. Yeah the events table (and other tables that use our custom ResizableTable component) is a bit funky and has a few bugs that I think should be addressed in another PR. |
Changes
Wrapped up a bunch of table fixes in this PR.
A bunch of after pics (in no particular order)
Screen.Recording.2021-06-11.at.4.40.06.PM.mov
actions.mov
Checklist