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

Show a loading state in between URQL states #104

Merged
merged 4 commits into from
Sep 21, 2023

Conversation

tmeasday
Copy link
Member

@tmeasday tmeasday commented Sep 15, 2023

To reproduce the problem, turn on network shaping to slow down your internet and switch stories. Rather than seeing the old story you should see a spinner while you wait:

image

Unfortunately there's no good way to simulate this behaviour in SB that I could come up with.

📦 Published PR as canary version: 0.0.91--canary.104.2a6ea41.0

✨ Test out this PR locally via:

npm install @chromaui/[email protected]
# or 
yarn add @chromaui/[email protected]

@tmeasday tmeasday requested a review from weeksling September 15, 2023 06:10
@linear
Copy link

linear bot commented Sep 15, 2023

AP-3675 Loading state when switching story

We should show some kind of loading UI while the GQL query fetches the next story.

Copy link
Contributor

@weeksling weeksling left a comment

Choose a reason for hiding this comment

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

👍 This also seems to fix the issue you called out on my pr with the baseline toggle not resetting after changing stories. This unmounts the component when data is loading and so it resets the state values to defaults.

Copy link
Contributor

@weeksling weeksling left a comment

Choose a reason for hiding this comment

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

One suggestion for broken stories, otherwise this seems good to go

src/screens/VisualTests/VisualTests.tsx Outdated Show resolved Hide resolved
@tmeasday tmeasday merged commit 46ef7ac into main Sep 21, 2023
@tmeasday tmeasday deleted the tom/ap-3675-loading-state-when-switching-story branch September 21, 2023 01:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants