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

chore: Use tanstack query for settings #384

Merged
merged 1 commit into from
Dec 18, 2024
Merged

Conversation

going-confetti
Copy link
Collaborator

@going-confetti going-confetti commented Dec 18, 2024

Description

How to Test

  1. Open the settings dialog
  2. Check if tabs still work
  3. Try changing a setting and saving it

Checklist

  • I have performed a self-review of my code.
  • I have added tests for my changes.
  • I have run linter locally (npm run lint) and all checks pass.
  • I have run tests locally (npm test) and all tests pass.
  • I have commented on my code, particularly in hard-to-understand areas.

Screenshots (if appropriate):

Related PR(s)/Issue(s)

Comment on lines +48 to 51
<Flex align="center">
<Spinner mr="2" />
<Text size="2">
k6 Studio logs in this screen are updated in real-time.
<Text size="2" color="gray">
Application logs are updated in real-time.
</Text>
</Flex>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I made it a bit more subtle, but I'm not quite happy with the spinner here: IMO it gives an indication that something is constantly fetching, even though it's not the case.

@@ -65,23 +60,6 @@ export const SettingsDialog = ({ open, onOpenChange }: SettingsDialogProps) => {
formState: { isDirty, errors },
} = formMethods

const onSubmit = async (data: AppSettings) => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

using tanstack query is more ergonomic and allows us to reused cached settings across different components

@going-confetti going-confetti marked this pull request as ready for review December 18, 2024 11:19
@going-confetti going-confetti requested a review from a team as a code owner December 18, 2024 11:19
@going-confetti going-confetti requested review from cristianoventura and e-fisher and removed request for a team December 18, 2024 11:19
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not related to this PR, but I think it'd be really nice to add basic syntax highlighting to logs
image

Copy link
Collaborator

@allansson allansson left a comment

Choose a reason for hiding this comment

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

Left a suggestion, but otherwise it's legit. 💯

src/components/Settings/SettingsDialog.tsx Show resolved Hide resolved
@going-confetti going-confetti merged commit 7ebb02a into main Dec 18, 2024
2 checks passed
@going-confetti going-confetti deleted the chore/usequery-settings branch December 18, 2024 12:25
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