Skip to content

Group table body styles #3681

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

Merged
merged 4 commits into from
Apr 19, 2023
Merged

Conversation

julieg18
Copy link
Contributor

@julieg18 julieg18 commented Apr 13, 2023

3/4 main <= #3667 <= #3674 <= this <= #3707

  • move all selectors to one place
  • delete unused code
  • remove unneeded nesting

Part of #3597

@julieg18 julieg18 self-assigned this Apr 13, 2023
This was referenced Apr 13, 2023
@@ -22,7 +22,7 @@ export const AddStage: React.FC<AddStageProps> = ({ hasValidDvcYaml }) => (
disabled={!hasValidDvcYaml}
/>
{!hasValidDvcYaml && (
<p className={styles.error}>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Similiar to the previous pr, renamed some classes to better explain what they're doing :)

}

.experimentCellContentsContainer {
@extend .cellContents;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Personally, I don't think it's the best practice to extend regular classes because someone could update the class not realizing they're effecting other classes. Created another one of our "Extendable Silent Rules" for this.

@@ -804,13 +748,18 @@ td {
.experimentCellSecondaryName {
color: $meta-cell-color;
font-size: 0.75em;
display: flex;
align-items: center;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Noticed that the text-overflow wasn't working. Fixed now:

image


&:not(.experimentCell)::before {
@extend %cellBorderLeft;
}

.rowSelected & {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it's a little better but the way we update backgrounds/borders for cells is still kind of complex. I think there are some better ways to go about this but I've already spent quite a bit of time on updating table styles, so will look at it at a later date!


.innerCell {
padding: 5px 10px;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I noticed that we have the workspace cells slightly misaligned with the other rows. I assumed it wasn't intentional and deleted the line.

@@ -80,17 +80,9 @@ $badge-size: 0.85rem;
background-color: $header-border-color;
Copy link
Contributor Author

@julieg18 julieg18 Apr 13, 2023

Choose a reason for hiding this comment

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

Looked at storybook, and apparently, storybook applies selectors from table/styles.module.scss. to the plots stories. With the code outside of the .experiments wrapper, the plots stories are now breaking.

Are we already aware of this issue in storybook? I'm not sure why it's happening yet, but if it's hard to fix, we could:

  • move everything back into an experiments wrapper. While annoying to have another wrapper around everything, it would be the quickest way to fix the problem.
  • Don't select elements at all, just rely on classes. We'd need to add some extra classes like .td and .th and update the file accordingly.

Copy link
Contributor

Choose a reason for hiding this comment

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

Discuss this on our call. Need to understand why these were being applied (seems like a bug in the way we've setup the stories). What is shown in the extension should be what is shown in Storybook.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with Matt, this looks like a bug in how we setup the stories. Couldn't find where we directly import the table styles, but we directly import the plots one. We should probably clean that up and find out where these styles are coming from. That said, I think relying on classes instead of elements is good practices. I'm the one to blame here for that. During the react-table upgrade I changed all the divs to table elements and removed the .td, .th classes because they weren't on the right elements. I should have moved them instead.

@julieg18 julieg18 marked this pull request as ready for review April 13, 2023 20:47
@julieg18 julieg18 merged commit c27a778 into group-table-head-styles Apr 19, 2023
@julieg18 julieg18 deleted the group-table-body-styles branch April 19, 2023 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants