maryvilledev / codesplainUI

Web app for breaking down and annotating Python 3 source code.
https://www.codesplain.io
GNU General Public License v3.0
2 stars 2 forks source link

Codesplain will now balk when asked to load the same snippet #534

Closed dane-johnson closed 7 years ago

dane-johnson commented 7 years ago

Description

When asked to load a snippet that is already loaded, Codesplain will now skip reloading the snippet.

Motivation and Context

Closes #533

Checklist:

Browsers

Screenshots (if appropriate):

thebho commented 7 years ago

Will this just ignore the request, or actually reload the page with the state saved in S3?

dane-johnson commented 7 years ago

It will ignore the request.

thebho commented 7 years ago

That feels wrong to me. If we don't want them selecting the current snippet, it should be disabled not ignored. If you select a snippet it should force a reload (and a confirmation modal if anything has changed)

Hopding commented 7 years ago

Being disabled or ignored is fine with me. I don't think we should refresh though. We do not refresh the page when you select a snippet from the list. We just perform an AJAX request and display the resulting data, but no browser refresh occurs. I see no reason that we should perform a browser refresh if the snippet you click happens to be the same one you're already viewing.

thebho commented 7 years ago

Ok, no browser refresh, but it should still recover the state to the saved version if you make any changes.