-
Notifications
You must be signed in to change notification settings - Fork 12
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
Proof of concept: Take column logic out of QueryTable #2110
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
The same test failed twice in a row in Safari, so that’s significant. Will take a look. |
The test has now passed multiple times in a row in Safari in CI. Running it one more time to be sure. I wasn't able to repro the failure locally. |
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.
Good sleuthing on this. No concerns I can come up with; stoked it's addressing the issue. We might extract some of the common columns from different tables into helper functions, though I also get it if the benefits there are minimal. Regardless, this is good.
Thanks for the quick review. Definitely with you on cleaner helper functions. I did a bit of that with |
The test passed in Safari but now flaked in Firefox and in the same spot. Very interesting.... |
oxidecomputer/console@c0dd895...156c082 * [156c082c](oxidecomputer/console@156c082c) oxidecomputer/console#2110 * [cfdb3aae](oxidecomputer/console@cfdb3aae) oxidecomputer/console#2106 * [63d8156f](oxidecomputer/console@63d8156f) Revert "Change all uses of RHF `<Controller>` to `useController` (oxidecomputer/console#2102)" * [44c646f9](oxidecomputer/console@44c646f9) update API client gen script to use tsx directly * [f5245ab4](oxidecomputer/console@f5245ab4) oxidecomputer/console#2104 * [e2a7bcd7](oxidecomputer/console@e2a7bcd7) oxidecomputer/console#2102 * [56a00488](oxidecomputer/console@56a00488) oxidecomputer/console#2101
oxidecomputer/console@c0dd895...156c082 * [156c082c](oxidecomputer/console@156c082c) oxidecomputer/console#2110 * [cfdb3aae](oxidecomputer/console@cfdb3aae) oxidecomputer/console#2106 * [63d8156f](oxidecomputer/console@63d8156f) Revert "Change all uses of RHF `<Controller>` to `useController` (oxidecomputer/console#2102)" * [44c646f9](oxidecomputer/console@44c646f9) update API client gen script to use tsx directly * [f5245ab4](oxidecomputer/console@f5245ab4) oxidecomputer/console#2104 * [e2a7bcd7](oxidecomputer/console@e2a7bcd7) oxidecomputer/console#2102 * [56a00488](oxidecomputer/console@56a00488) oxidecomputer/console#2101
Closes #2107
Supersedes #2109
In #2109 I had a big outstanding mystery:
To investigate, I tried to reproduce the #2107 problem on StackBlitz with a very minimal setup:
But it did not have the issue, so I had to go back to our code and ask myself what we're doing to cause it. The breakthrough came when I replaced the IP pools table with this and the problem went away.
So most likely it was
QueryTable
causing theUtilizationCell
to unmount and remount at a weird time. Then I remembered:QueryTable
is full of shenanigans, it would totally do that. The culprit was my least favorite part ofQueryTable
:console/app/table/QueryTable.tsx
Lines 132 to 167 in 44c646f
Turning
QueryTable
inside out and getting rid of all theany
bits has been a long-term goal of mine, but it is pretty hard to untangle. What hadn't occurred to me until now is that we can pretty easily stop doing thecolumns
part altogether, passing in a native React Tablecolumns
array as a prop instead of doing the<Column />
business.So in this PR, I've introduced
useQueryTable2
, which is the same asuseQueryTable
but with the badcolumns
thing deleted.I think we should convert all existing
useQueryTable
calls touseQueryTable2
, then delete the original and renameuseQueryTable2
back touseQueryTable
. There are 21useQueryTable
calls (not including the IP pools one I changed here), and some will be pretty involved, so we probably don't want to do them all in one PR.