I was handed a prototype: a material library app in a single HTML file, no server, everything stored in the browser. You register a product, take a photo with the phone camera, adjust brightness, contrast, saturation and rotation, and the app keeps both the original and the corrected image. The save button says so plainly: “Save original + corrected.” On the product detail panel, next to the selected photo, there was a button labelled “View original.”
Before building on it, I read what each button actually did. That one did not show anything.
What the button did
Its handler took the selected photo, set the corrected image field to the original image, wrote the product back to the database, reloaded, and showed a toast: the selected photo had been changed back to its original state. There was no confirmation dialog. The two other destructive actions on the same panel, deleting a photo and deleting a product, both asked first. This one had a viewing verb on the label, so nobody had thought it needed to ask.
The original photo was safe. What disappeared was the correction: the brightness, contrast and rotation someone had chosen, baked into a separate image that was now replaced by a copy of the original. A person who pressed “View original” to compare, then closed the panel, would have lost their edit without being told anything they would read as a loss. The toast said “changed,” but it arrived after the click, describing something already saved.
I do not know whether this ever cost anyone real work. The prototype came to me before it was in daily use, and nothing in what I have records an edit being lost this way. What I can say is that the button would have done it every time.
Two names, two actions
The fix was not to add a confirmation to the old button. The problem was that one control carried two meanings, and the label promised the harmless one. So the rebuilt app splits them. “View original” is now a display toggle: it switches which image is shown and writes nothing. Undoing a correction is a separate button called “Revert correction,” and that one is the only path that changes stored data.
Photos also moved out of the browser database into files on a small local server, and the original file is never modified; corrections are saved as a separate file. In a browser test against that server, I registered a photo at 125% brightness with a 90° rotation and checked that the stored original was byte-for-byte what had been uploaded. A unit test covers the photo flow as well. The browser-only mode, where the app is opened as a file with no server, was not tested in this round, so I cannot say the same about it yet.
When a button’s name and its behavior disagree, people believe the name, and the data goes quietly. Looking and undoing should not share a name, and they should not share a code path.