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: remove playground results flip #4076

Merged
merged 1 commit into from
Jun 23, 2023
Merged

fix: remove playground results flip #4076

merged 1 commit into from
Jun 23, 2023

Conversation

kwasniew
Copy link
Contributor

About the changes

Before:

  • when try configuration was clicked in playground and the results fetching was over there was a quick moment where playground guidance/instructions showed up before the result table was rendered

After:

  • instruction if only shown before form submission
  • after form submission loaded appears
  • when loading finishes table starts rendering

Important files

Discussion points

@vercel
Copy link

vercel bot commented Jun 23, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
unleash-monorepo-frontend ✅ Ready (Inspect) Visit Preview Jun 23, 2023 6:54am
1 Ignored Deployment
Name Status Preview Updated (UTC)
unleash-docs ⬜️ Ignored (Inspect) Jun 23, 2023 6:54am

@@ -57,6 +57,7 @@ export const AdvancedPlayground: VFC<{
const [searchParams, setSearchParams] = useSearchParams();
const searchParamsLength = Array.from(searchParams.entries()).length;
const { evaluateAdvancedPlayground, loading } = usePlaygroundApi();
const [hasFormBeenSubmitted, setHasFormBeenSubmitted] = useState(false);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

new variable to store if form was submitted

<ConditionallyRender
condition={
!Boolean(results) &&
!hasFormBeenSubmitted
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this removing flipping effect

Copy link
Contributor

@thomasheartman thomasheartman left a comment

Choose a reason for hiding this comment

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

This looks good to me! My only question would be if we could use data state to check whether the form has been submitted or not instead of introducing a new state variable, but I'm assuming you've already explored that possibility? But definitely non-blocking. Nice work! 🏆

@kwasniew
Copy link
Contributor Author

@thomasheartman You're right. I tried to do it w/o a new state variable but couldn't get it to work as expected.

@kwasniew kwasniew merged commit 175b103 into main Jun 23, 2023
17 of 19 checks passed
@kwasniew kwasniew deleted the remove-playground-flip branch June 23, 2023 07:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants