Repository navigation
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. |
charliepark
left a comment
There was a problem hiding this comment.
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
QueryTablecausing theUtilizationCellto unmount and remount at a weird time. Then I remembered:QueryTableis 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
QueryTableinside out and getting rid of all theanybits 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 thecolumnspart altogether, passing in a native React Tablecolumnsarray as a prop instead of doing the<Column />business.So in this PR, I've introduced
useQueryTable2, which is the same asuseQueryTablebut with the badcolumnsthing deleted.I think we should convert all existing
useQueryTablecalls touseQueryTable2, then delete the original and renameuseQueryTable2back touseQueryTable. There are 21useQueryTablecalls (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.