Show a warning when clicking 'I fixed it' if embedded Rapid editor has unsaved changes #2397
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #2162
When completing a task (i.e. clicking "I fixed it", "Can't complete", etc, all of which would advance to the next task), a confirmation window will now be shown if there are unsaved changes in the embedded Rapid editor. The confirmation is very basic (I just used
window.confirm()
) but should help prevent users from accidentally advancing to the next task without uploading their changes. I considered trying to make a more complex/styleable modal but decided not to for now since with my limited experience with the codebase it would have taken longer and might not have matched the existing design language that I'm still getting familiar with.Screen.Recording.2024-08-08.at.10.11.52.AM.mp4
Tested: