Add timers for save button to make the saving intent visible for user by abcampo-iry · Pull Request #1410 · RaspberryPiFoundation/editor-ui

Pull request overview

This PR updates the Scratch save-state hook to keep “Saving” visible for a minimum duration and keep “Saved” visible briefly before returning to the default “Save” label, improving the visibility of save feedback in the UI.

Changes:

  • Add a minimum “saving” visibility duration (1s) before transitioning to “saved”.
  • Keep “saved” visible for 5s before resetting to the idle “save” state.
  • Update hook tests to validate the new timing-based lifecycle.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/hooks/useScratchSaveState.js Adds timing logic to enforce a minimum “saving” duration and a delayed reset after “saved”.
src/hooks/useScratchSaveState.test.js Updates tests to assert the new timing-based state transitions and adds timer cleanup.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.