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

Fix row selection (duplicate experiments) #3921

Merged
merged 5 commits into from
May 19, 2023
Merged

Fix row selection (duplicate experiments) #3921

merged 5 commits into from
May 19, 2023

Conversation

sroy3
Copy link
Contributor

@sroy3 sroy3 commented May 17, 2023

For #1966

Screen.Recording.2023-05-17.at.3.51.02.PM.mov

@sroy3 sroy3 added the bug Something isn't working label May 17, 2023
@sroy3 sroy3 self-assigned this May 17, 2023
@sroy3 sroy3 marked this pull request as ready for review May 17, 2023 19:52
@sroy3 sroy3 requested review from mattseddon and julieg18 as code owners May 17, 2023 19:52
@mattseddon
Copy link
Member

This PR highlights a bigger problem. Having duplicate entries in the table is going to lead to some unexpected behaviour. For example selecting a single record for plotting adds duplicate entries into the plots diff call:

Screen.Recording.2023-05-18.at.9.54.29.am.mov

☝🏻 I'll fix this right now. I think the behaviour for the checkboxes makes sense but doing things like starring/deleting etc should update entries for that record.

const [firstCell, ...cells] = getVisibleCells()
const isWorkspace = id === EXPERIMENT_WORKSPACE_ID
const changesIfWorkspace = isWorkspace ? changes : undefined

const { toggleRowSelected, selectedRows } = useContext(RowSelectionContext)

const isRowSelected = !!selectedRows[id]
const isRowSelected = !!selectedRows[getCompositeId(id, branch)]
Copy link
Member

Choose a reason for hiding this comment

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

[Q] Should we call this rowId and put it on the experiment data?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was more complicated doing that as it needs to be added everywhere and it's only useful for row selection (something happening on the webview side only).

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.

Good work!

@sroy3 sroy3 enabled auto-merge (squash) May 18, 2023 22:41
@codeclimate
Copy link

codeclimate bot commented May 19, 2023

Code Climate has analyzed commit aa7bd4e 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 95.0% (0.0% change).

View more on Code Climate.

@sroy3 sroy3 merged commit 6fe4461 into main May 19, 2023
@sroy3 sroy3 deleted the fix-row-selection branch May 19, 2023 06:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants