-
Notifications
You must be signed in to change notification settings - Fork 29
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
Show middle state badges for running, starred and checked sub-rows #2004
Conversation
[Q] Why are we not showing the middle state for experiments that have been selected for plotting? |
I missed it, but it's a relatively simple change now. I can include them in this PR |
)} ${actionAppliedLabel}.` | ||
} | ||
> | ||
{children} |
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] At the moment only the direct children are being aggregated. Here is a screen recording of an example:
Screen.Recording.2022-07-12.at.8.30.37.pm.mov
When we aggregate from checkpoints to experiments and then up to the current commit we are not taking the cumulative total into account.
Another example:
Screen.Recording.2022-07-12.at.8.35.31.pm.mov
I would not even try to include the top level indicator until we have more than one commit/branch in the table. Until that time we will be catering to an edge case.
However, if you feel that they are needed then they need to reflect the totals including all children.
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.
More complicated aggregation behaviour will also need some tests.
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'll add some tests for this current use-case now, but I want to defer this total aggregation for later if it's currently an edge case.
8d7c020
to
4a4e427
Compare
I just added the plots indicator and will add some tests for all of them now |
81af148
to
c2fd5b1
Compare
614ff4a
to
6f0e69f
Compare
It was 96.7% before I added more tests. Go figure |
f8f8882
to
bc9fb31
Compare
a6742b3
to
08b2e56
Compare
userEvent.click(collapseButtons()[1]) | ||
userEvent.click(collapseButtons()[2]) | ||
userEvent.click(collapseButtons()[3]) | ||
} |
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 thought this warranted its own storybook story
selected: true | ||
})) | ||
} | ||
export const setExperimentsAsRunning = setRowPropertyAsTrue('running') |
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 added these helpers to remove some of the friction I had with adding new tests. Hopefully this will make it way easier to setup table data scenarios for new tests.
} | ||
} | ||
|
||
.bullet { |
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 need to remove this, they are not used anymore
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.
Please remove this before merging
@@ -672,3 +714,26 @@ $badge-size: 0.85rem; | |||
.cellTooltip { | |||
padding: 2px 6px; | |||
} | |||
|
|||
.indicatorCount { | |||
&[aria-label='0'] { |
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 tried using only this style to not show the counter when the number is 0, because it would save a conditional test in the component and reduce its complexity.
It works on VSCode and Storybook, but for some reason these styles are not applied when running the jest tests.
So I kept the conditionals in the end.
subRows: experiment.subRows?.map(checkpoint => ({ | ||
...checkpoint, | ||
running: checkpoint.running || checkpoint.label === '23250b3' | ||
running: checkpoint.running || checkpoint.label === '23250b3', | ||
starred: checkpoint.starred || checkpoint.label === '22e40e1' |
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 can simplify this by using the helpers I mentioned above
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.
👍🏻
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.
Just one thing that I would recommend doing before you merge this. Adding an updated video in description would be handy for future reference too.
@@ -372,6 +373,129 @@ describe('App', () => { | |||
}) | |||
}) | |||
|
|||
describe('Sub-rows middle states indicators', () => { | |||
const renderWithAllRowsExpanded = () => { |
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] A more central location for these util will be helpful.
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.
Splitting out utils will help to start reducing the size of this file and would give a central location for people to look for test building blocks.
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.
fine to create a separate PR for that
role={'marquee'} | ||
aria-label={`${count ?? 0}`} | ||
> | ||
{count ?? 0} |
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.
[Q] How is ??
needed here when it can only be a truthy value?. Could you use a type guard here?
} | ||
} | ||
|
||
.bullet { |
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.
Please remove this before merging
subRows: experiment.subRows?.map(checkpoint => ({ | ||
...checkpoint, | ||
running: checkpoint.running || checkpoint.label === '23250b3' | ||
running: checkpoint.running || checkpoint.label === '23250b3', | ||
starred: checkpoint.starred || checkpoint.label === '22e40e1' |
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.
👍🏻
Add some stars to the Table stories data
08b2e56
to
84d777c
Compare
Code Climate has analyzed commit 84d777c and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 100.0% (85% is the threshold). This pull request will bring the total coverage in the repository to 96.7% (0.0% change). View more on Code Climate. |
This PR will introduce indicators for the state of sub-rows in the experiments table.
There will an indicator for selected, starred and running sub-rows.
See #1714 for context on the issue.
Screen.Recording.2022-07-18.at.10.34.09.mov