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?

@vilanell000
Copy link
Author

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?

Thanks for the reply! I believe providing clear feedback to users is quite helpful — it makes it easier for them to know whether the save action was successful or not, without having to double-check manually.

That said, I understand if you prefer to keep it simpler. I’m totally fine with that. I also agree that passing the mutation query directly to the button sounds like a clean approach.

# Conflicts:
#	src/components/WorkoutRoutines/widgets/forms/RoutineForm.tsx
@rolandgeider
Copy link
Member

I believe providing clear feedback to users is quite helpful

yeah, which is something we don't do as much as we should.

Do you want to give this idea a try?

@vilanell000
Copy link
Author

I believe providing clear feedback to users is quite helpful

yeah, which is something we don't do as much as we should.

Do you want to give this idea a try?

yes, I would like to. but it will take some time, because I'm in middle of final week.

@rolandgeider
Copy link
Member

yes, I would like to. but it will take some time, because I'm in middle of final week.

of course, this is not a job! 😄

@vilanell000
Copy link
Author

yes, I would like to. but it will take some time, because I'm in middle of final week.

of course, this is not a job! 😄

hi, I created a new branch and another pull request #1161

here is how save button would act:

  1. after click this button, replace the button while query is loading (using LoadingButton) and to make it disabled for one second at minimum and two seconds at maxmum.
  2. then, the button will display“SAVE ✅”if success, or “SAVE❌ ” if failed briefly.
  3. then switch back to original button.

hope this is what you expected.

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