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

Add progress ring to plots ribbon while data is loading #2841

Merged
merged 11 commits into from
Nov 30, 2022

Conversation

mattseddon
Copy link
Member

@mattseddon mattseddon commented Nov 28, 2022

1/2 main <- this <- #2859

Closes #2835.

This PR adds a progress ring to revisions in the plots ribbon whilst data is being loaded. This would have been a simple change had it not been for a race condition in running checkpoint experiments where the revision was never actually loaded until the experiment finished.

This change comes with a caveat (see inline comments). I will follow up straight away.

Demo

Screen.Recording.2022-11-30.at.3.44.31.pm.mov

@mattseddon mattseddon added the product PR that affects product label Nov 28, 2022
@mattseddon mattseddon self-assigned this Nov 28, 2022
@mattseddon mattseddon force-pushed the add-ribbon-progress-ring branch from 383e0ab to a45aec3 Compare November 28, 2022 03:10
@sroy3
Copy link
Contributor

sroy3 commented Nov 28, 2022

This looks great! Makes things a little more dynamic.

@mattseddon mattseddon force-pushed the add-ribbon-progress-ring branch from a45aec3 to f1e790b Compare November 29, 2022 01:21

useEffect(() => {
setOrder(pastOrder => performOrderedUpdate(pastOrder, revisions, reorderId))
}, [revisions])
Copy link
Member Author

Choose a reason for hiding this comment

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

[F] There was a race condition between the data update and useEffect that would cause reorderObjectList(order, revisions, reorderId) to drop selected checkpoint experiments from the ribbon. Deleting this means that we need to update the message passed for comparison plots and split the order of the comparison table columns from selectedRevisions (to reinstate => 'should not reorder the ribbon when comparison plots are reordered').

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 do this as an immediate follow up

@@ -1818,37 +1818,6 @@ describe('App', () => {
type: MessageFromWebviewType.REFRESH_REVISIONS
})
})

it('should not reorder the ribbon when comparison plots are reordered', () => {
Copy link
Member Author

Choose a reason for hiding this comment

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

@mattseddon mattseddon force-pushed the add-ribbon-progress-ring branch from a48afa1 to b8e07e5 Compare November 29, 2022 21:46
@@ -27,6 +26,11 @@
display: inline;
font-size: 0.8125rem;
}

.fetching {
Copy link
Member Author

Choose a reason for hiding this comment

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

[F] Gives us the space to display an icon against the experiment (e.g <Error/> if we have an issue with it)

@@ -0,0 +1,61 @@
import React from 'react'
Copy link
Member Author

Choose a reason for hiding this comment

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

[F] Add a story to demonstrate the styling of the ribbon with and without progress ring(s)

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'm sure we'll need to iterate on the style.

@mattseddon mattseddon marked this pull request as ready for review November 30, 2022 04:52
@mattseddon mattseddon enabled auto-merge (squash) November 30, 2022 20:42
@codeclimate
Copy link

codeclimate bot commented Nov 30, 2022

Code Climate has analyzed commit e21e29d 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.1% change).

View more on Code Climate.

@mattseddon mattseddon merged commit d5f94aa into main Nov 30, 2022
@mattseddon mattseddon deleted the add-ribbon-progress-ring branch November 30, 2022 20:58
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.

Revisions on the ribbon can be very slow to appear
2 participants