Skip to content

Conversation

vilanell000
Copy link

Proposed Changes

  • create a new save button component
  • replace the save button in the routine form

Related Issue(s)

#1114

The new save button will briefly show save ❌ if it fails or save ✅ if it succeeds, then switch back to the normal "Save" button.

If you think it is a good idea, I can do in other page as well.

@rolandgeider
Copy link
Member

hey! Adding some feedback is definitely a good idea. My first impression is that making the button red is a bit "too much". How about we simply disable the button while the query is running, show the ✅ afterwards and then remove that after a timeout. If there are any errors we can use the FormQueryErrors component that shows them and the user can try again after changing the input

@vilanell000
Copy link
Author

vilanell000 commented Sep 24, 2025

hey! Adding some feedback is definitely a good idea. My first impression is that making the button red is a bit "too much". How about we simply disable the button while the query is running, show the ✅ afterwards and then remove that after a timeout. If there are any errors we can use the FormQueryErrors component that shows them and the user can try again after changing the input

Hi, thank you for your reply.
I modify a little as you suggest. (imported the FormQueryErrors into RoutineForm.tsx, you can check the changes)

  • the color won't change now.
  • disable the button during the mutation.
  • the button stays disabled for 1.5s after click (cooldown), regardless of success/error.
  • still shows “Saving…”, then “Saved ✅” briefly, then resets.
  • keep the ❌ so that it corresponds with the ✅.

click save button if success:
截屏2025-09-24 下午6 24 02

click save button if faild:
截屏2025-09-24 下午6 50 17

after a timeout, it go back to save button:
截屏2025-09-24 下午6 23 32

@rolandgeider
Copy link
Member

Hey! After thinking a bit about this, I suggest we trim this even further. How about using a LoadingButton like in the DayForm just below

Bildschirmfoto 2025-10-01 um 13 12 37

There we just replace the regular button while the query is loading, but most will be fast enough that the user won't notice, so we should extend that by some timeout. We could also just pass the button a mutation query directly. What do you think?

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