-
Notifications
You must be signed in to change notification settings - Fork 28
Add multiple branches support inside the experiments table #3735
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
Conversation
| import tableStyles from '../../styles.module.scss' | ||
| import { ExperimentsState } from '../../../../store' | ||
|
|
||
| export const CommitsAndBranchesNavigation: React.FC = () => { |
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.
Function CommitsAndBranchesNavigation has 43 lines of code (exceeds 40 allowed). Consider refactoring.
| showPreviousRow?: boolean | ||
| } | ||
|
|
||
| export const TableBody: React.FC<TableBodyProps> = ({ |
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.
Similar blocks of code found in 3 locations. Consider refactoring.
mattseddon
left a comment
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.
Looks good. Left some comments. I do think we will need to provide a way for users to display selected rows from the table closer to each other. Also, need to consider how delta mode fits in with this as well.
I don't think it would hurt to add the Git-merge icon in with the other indicators (Plot, filter, sort) and have the action fire up "Select Branches" as well. The badge could relate to the number of branches selected. The idea is that it will be complementary to the text at the bottom of each branch, not replace it.
🙏🏻
| } | ||
| ] | ||
| }) | ||
| } as unknown as Table<Experiment> |
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] When we add the extension part of this it would be good to add more commits/at least one extra branch to the base test fixture.
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] Would also mean we would get the design added to a Story, right?
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.
Yes, as soon as there is more than one branch, the new design appears. I think it might be good to add a story for it right away, so that it's possible to see it without faking it.
| @import '../../../../../shared/variables.scss'; | ||
|
|
||
| .branchName { | ||
| padding: 40px 20px 10px; |
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.
[C] The next problem we will have to solve is: "how can a user compare two separate records on different branches". For me, this means we need a mechanism to display them directly above/below one another. Maybe we could allow pinning or we could start with something like "show only selected" as a multi-select option.
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.
That will need some design and planning because it does seem like this use case will be very much needed and there is no simple solution for it.
| isBranchesView ? switchToCommitsView : switchToBranchesView | ||
| } | ||
| > | ||
| {isBranchesView |
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] Do we need to/should we keep this around long term?
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 think people in general feel like this won't be necessary anymore, I don't mind removing it once the whole feature is in. That being said, I personally feel like this could be useful before selecting branches to add as it gives the user an overview of what is in each branch. Also if you do not particularly case about previous commits and have too many branches to easily select, this is a quick way to view everything at once.
This isn't too complicated to remove, nor it is to keep it. The most problematic part about keeping it is where to show it now that we have controls on every branch. I have no preferences about it.
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.
Trying to limit/fight complexity.
| columnResizeMode: 'onChange', | ||
| columns: columns as ColumnDef<Commit, unknown>[], | ||
| data, | ||
| // Setting any branch for now just so that it isn't undefined. It does not matter the label for now as it is not shown |
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] Can we track that this needs to be removed/updated somewhere?
| import { GitMerge } from '../../../../../shared/components/icons' | ||
|
|
||
| export const BranchDivider: React.FC<PropsWithChildren> = ({ children }) => ( | ||
| <tbody data-testid="branch-name"> |
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.
Do we want our branch divider to be a separate body? Would it make more sense, accessibility-wise, for this to be table header row inside its corresponding table body?
|
|
||
| return ( | ||
| <tbody> | ||
| <tr> |
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.
From my knowledge of table accessibility, I think cells inside the table should correspond with the table head if they're not a header. But due to how our table works now with multiple branches I don't see another way to easily show actions below each branch group so probably just have to leave it as is 🤔
| isBranchesView, | ||
| nbColumns | ||
| }) => ( | ||
| <tbody> |
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.
Same question for here as with the git branch row about this being in its own separate body.
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 realized that this row is currently a tbody in main 🤔 Must have changed from a header row at some point :)
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.
Changed both for <thead>.
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.
Apologies, I should have been more clear. A table actually can't have multiple theads, I was referring to th cells inside of a tr, whether that's directly inside of a tbody or inside of table. Our rows are made up of multiple tbodys so probably just being inside a direct child of the table would work best.
This is how accessibility standards recommend you add subheaders to tables.
| .errorText { | ||
| color: $error-color; | ||
| } | ||
|
|
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.
Re-added
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.
Is there a way to view how the different branch tables look on my end? Looking at the code, I'm not seeing a way to do this, but I might be missing something :)
From your demo, it looks like the experiment column shadow might be missing but I can't confirm this since, as mentioned, I'm not sure how to test how things look.
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.
Currently adding a story to see it. Otherwise, you have to manually add branches to the rows (we can duplicate the non workspace rows we send to updateRows in App.tsx)
| <Icon width={16} height={16} icon={Filter} /> | ||
| </Indicator> | ||
| {featureFlag.ADD_REMOVE_BRANCHES && ( | ||
| <Indicator |
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.
Similar blocks of code found in 2 locations. Consider refactoring.
| isLast?: boolean | ||
| } | ||
|
|
||
| export const TableBody: React.FC<TableBodyProps> = ({ |
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.
Similar blocks of code found in 2 locations. Consider refactoring.
|
Code Climate has analyzed commit 2161709 and detected 4 issues on this pull request. Here's the issue category breakdown:
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 94.7% (0.1% change). View more on Code Climate. |

Part of #1966
When there will be multiple branches, it will look like:
Screen.Recording.2023-04-21.at.9.18.31.AM.mov
Might still need to figure out where to move the "Select branches to show" (not shown here, but will look as before) and the "Switch to all branches view"
If there is only one branch (the current branch and the current behaviour, it will look like that (same as before:
