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: improve playground editor UX #1890

Merged
merged 4 commits into from
Feb 18, 2025

Conversation

crazy-poncho
Copy link
Contributor

Status

READY

Description

There're some annoying UX issues in playground editor. For example, can't effectively type changes in editor, because there's no debounce on user changes, so each new character potentially sends request with invalid input and it triggers error response and editor component disappears. Also, even if you copy-paste valid inputs and you get success response, because component unmounts, cursor position is lost.

That's why i have some playground editor UX improvements:

  • show error message in output editor when you get error response from POST api/generate endpoint
  • use debounce for generate query to improve performance
  • use keepPreviousData query option to prevent editor unmount, so we keep cursor position

Steps to Test or Reproduce

Just go to home page and scroll to playground editor, or visit https://orval.dev/playground page and try to reproduce mentioned problems.

Copy link
Collaborator

@melloware melloware left a comment

Choose a reason for hiding this comment

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

I love this. @anymaniax any objections?

@melloware melloware added the documentation Improvements or additions to documentation label Feb 10, 2025
@melloware melloware added this to the 7.6.0 milestone Feb 10, 2025
@melloware melloware merged commit 40cdba2 into orval-labs:master Feb 18, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants