Skip to content
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

Change experiments table circle to radio button #2553

Merged
merged 18 commits into from
Oct 15, 2022
Merged

Change experiments table circle to radio button #2553

merged 18 commits into from
Oct 15, 2022

Conversation

mattseddon
Copy link
Member

@mattseddon mattseddon commented Oct 10, 2022

1/2 main <- this <- #2567

Related to #2373

This PR updates the experiments table and replaces the existing circles with a radio button. In the follow-up PR I have tried to improve the tooltip displayed when hovering over the radio button. Although not perfect I think this change is an improvement and good enough to ship.

Demo

Screen.Recording.2022-10-12.at.12.51.46.pm.mov

Previous attempts:

Demo

Screen.Recording.2022-10-10.at.12.59.55.pm.mov

With the sub-row indicator moved

Screen.Recording.2022-10-10.at.4.48.45.pm.mov

Left in draft and asked for reviews because I would like everyone to take a look at the idea.

I think we should move the eye + circle to the LHS with the other row action indicators and put any required whitespace between the circle and chevron. Like this:

image

Demo of the above

Screen.Recording.2022-10-10.at.6.52.23.pm.mov

@mattseddon mattseddon added the product PR that affects product label Oct 10, 2022
@mattseddon mattseddon self-assigned this Oct 10, 2022
@maxagin
Copy link
Contributor

maxagin commented Oct 10, 2022

What is going to be displayed in the exps sidebar section?

@mattseddon
Copy link
Member Author

What is going to be displayed in the exps sidebar section?

No change

@julieg18
Copy link
Contributor

Adding the eye definitely makes things more clear for me!

I think we should move the eye + circle to the LHS with the other row action indicators and put any required whitespace between the circle and chevron.

➕ on this idea!

@sroy3
Copy link
Contributor

sroy3 commented Oct 11, 2022

I think this make it more obvious that there is an action to be done or, but I don't think this would solve the problem by itself.

  1. I don't see anymore relation between the eye and the plots than between the circle and plots.
  2. The eye + circle feels like duplicated information
  3. It starting to be a little crowded on the row

Maybe if there was a new column header that says "Plot/Unplot" and make the bullets a clear column? One downside I'm seeing from this is that the other actions won't be labeled in the same way (star, select).

@mattseddon mattseddon changed the title Add eye to experiments table to connect to plots view Change experiments table circle to radio button Oct 12, 2022
@mattseddon mattseddon marked this pull request as ready for review October 12, 2022 01:59
Copy link
Contributor

@sroy3 sroy3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that we are having more actions to the left, would it make sense to move the label of the column to something like this?
Screen Shot 2022-10-12 at 9 05 33 AM

Or even move the name to the right?
Screen Shot 2022-10-12 at 9 08 13 AM
(this would need to make that column be able to resize smaller than it possible at the moment)

testId={'row-action-plot'}
tooltipContent={getTooltipContent(!!bulletColor, 'Plot')}
>
<span
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine for now, but we definitely could change that for a button like we said. We could then have toggleExperiment on click only and accessibility would be built in the component. There must be some default styles to the button that need to be overwritten, but other than that it should be a simple change.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


align-items: center;
justify-content: center;
align-self: center;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this still needed? I vaguely remember us adding the property and it not doing anything.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

border: calc(var(--border-width) * 1px) solid $checkbox-border;
box-sizing: border-box;
cursor: pointer;
height: calc(var(--design-unit) * 4px);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could make a variable out of that and use it for height, width and border-radius

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pulled out variable

box-sizing: border-box;
cursor: pointer;
height: calc(var(--design-unit) * 4px);
outline: none;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is useful if we transform the span to a button. Otherwise, it doesn't do anything. For transforming the element to a <button />, the only other styles needed is padding: 0 and border: none I think. We'll be able to remove box-sizing: border-box too as its already the default on a button.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed to a button

Copy link
Contributor

@julieg18 julieg18 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, Matt!

Now that we are having more actions to the left, would it make sense to move the label of the column to something like this?

Or even move the name to the right?

(this would need to make that column be able to resize smaller than it possible at the moment)

Personally, I find the Experiments label being in the "center" to look like of buggy. As for the second option, I believe it is recommended that we keep text left-aligned instead of right-aligned for readability. No strong opinion on this though :)

@@ -51,11 +59,17 @@ export const CellRowAction: React.FC<CellRowActionProps> = ({
)
}

const getTooltipContent = (determiner: boolean, text: string): string =>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great idea for creating the text!

testId={'row-action-plot'}
tooltipContent={getTooltipContent(!!bulletColor, 'Plot')}
>
<span
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shcheklein
Copy link
Member

One caveat (not critical for now) is checkpoints (and resume / continue logic) when line breaks between the checkpoints. In this case line gives a hint.

LGTM otherwise, let's proceed with this. I would say though that I don't think this is enough. I think we need more explicit things, buttons, etc to connect both webviews.

@mattseddon
Copy link
Member Author

mattseddon commented Oct 14, 2022

Now that we are having more actions to the left, would it make sense to move the label of the column to something like this? Screen Shot 2022-10-12 at 9 05 33 AM

Or even move the name to the right? Screen Shot 2022-10-12 at 9 08 13 AM (this would need to make that column be able to resize smaller than it possible at the moment)

@sroy3 this is good. I managed to move "Experiment" to the right but failed with the experiment names. Can you help me out with the code?

Edit: I have "fixed" the problem but in order to do so I've changed the behaviour of the row

Screen.Recording.2022-10-14.at.7.16.15.pm.mov
Screen.Recording.2022-10-14.at.7.20.10.pm.mov

This is what things look like spreading the line from the opposite direction:

Screen.Recording.2022-10-14.at.7.21.44.pm.mov

The last idea that I had is to always keep the display name on the second line as per:

Screen.Recording.2022-10-14.at.8.33.20.pm.mov

The last one is probably my preferred option.

WDYT? Am I overthinking this?

@mattseddon
Copy link
Member Author

mattseddon commented Oct 14, 2022

@julieg18 @sroy3 for moving experiment names to the right of the first cell please take a look at the storybook and last commit. LMK what you think, thanks.

<button
className={styles.bullet}
style={{ color: bulletColor }}
{...clickAndEnterProps(toggleExperiment)}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can change this to a basic onClick event since all keyboard event are already handled by the button.

Copy link
Member Author

@mattseddon mattseddon Oct 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This ended up being a button inside a button so I had to move the action into <Indicator/> and changed it back to a <span/>

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will make the same change for the other row actions in a follow-up (the change is bigger than I anticipated).

@sroy3
Copy link
Contributor

sroy3 commented Oct 14, 2022

The last one is probably my preferred option.

WDYT? Am I overthinking this?

I think I'm with you on that one. The last option looks good. The first one is ok too and I wouldn't mind if it was what we finally went with.

@julieg18
Copy link
Contributor

julieg18 commented Oct 14, 2022

The last one is probably my preferred option.
WDYT? Am I overthinking this?

Last one is also my preferred option! The first one shows what appears to be secondary text (gray and small) before the primary text (white and large) and the second one looks kind of buggy to me with how the text jumps.

@codeclimate
Copy link

codeclimate bot commented Oct 15, 2022

Code Climate has analyzed commit 92be048 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.8% (0.0% change).

View more on Code Climate.

@mattseddon mattseddon enabled auto-merge (squash) October 15, 2022 01:11
@mattseddon mattseddon disabled auto-merge October 15, 2022 01:11
@mattseddon mattseddon merged commit 94f2497 into main Oct 15, 2022
@mattseddon mattseddon deleted the add-eye branch October 15, 2022 01:29
@shcheklein
Copy link
Member

Q: how will to look like with three commits? (my concern that we've completely flattened out the table - commit name, experiments (and checkpoints?) are all on the same level now? If that is the case, then we are loosing important information - hierarchy.

@mattseddon
Copy link
Member Author

Q: how will to look like with three commits? (my concern that we've completely flattened out the table - commit name, experiments (and checkpoints?) are all on the same level now? If that is the case, then we are loosing important information - hierarchy.

image

@shcheklein
Copy link
Member

Hmm, I prefer it way better the way it was before. It was more informative (in an important way - there is child-parent relationship). We've removed lines and hierarchy. It means either we'll have to implement something like in studio (sections per branch) or we need to go back and introduce the hierarchy back.

@mattseddon
Copy link
Member Author

Hmm, I prefer it way better the way it was before.

Which part of the change?

@shcheklein
Copy link
Member

Sorry, I meant the names. Buttons are fine and definitely an improvement!

@mattseddon
Copy link
Member Author

Sorry, I meant the names. Buttons are fine and definitely an improvement!

Ok, I will raise a PR to revert.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product PR that affects product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants