Adding minor UI touches with Rails & Stimulus

Recently, we ran into a usability issue in our app. When customers archived Widgets, the interface gave no indication that anything was happening until the process was fully complete. This caused confusion for our users, and in many cases they attempted to archive the same Widget more than once. Without any visual feedback, people were left wondering if their click had worked or if they needed to try again, and this uncertainty often led to duplicate requests.

To address this, I opened a pull request that introduced real-time feedback immediately after the user confirms an archive action. When the Confirm button is clicked, a spinner now appears and the text of the button changes to the i18n-enabled word “Processing.” This makes it clear that the operation is underway and that the user should wait for confirmation, eliminating the guesswork that was happening before.

One benefit of the new approach is that it is encapsulated in a reusable Stimulus controller. This makes it easy to reuse the same spinner and “Processing” pattern in other buttons that trigger operations of similar length. It provides a lightweight, user-friendly way to improve the experience for actions that take more than a moment but do not require the complexity of full background processing.

I wrote this blog post because I wanted to remind everyone that very small UI improvements like this can significantly reduce confusion and and help with customer retention! Sometimes a clear indication that work is in progress is all the user really needs to feel confident that the system, and those of us who work on the system, are responding to their requests!