ManifoldScholar/manifold

Unable to click off of annotation modal

mkgold opened this issue · 4 comments

I may be wrong about this, but I thought that I could close an annotation modal by clicking off of it and on to the main part of the text. In the attached screenshot, which is on the Debates instance, that does not work -- I have to click the Close button to leave the annotation.

Screen Shot 2022-11-02 at 5 39 10 PM

This is by design. When drawers in manifold allow the user to enter content, we typically put an overlay on the main content area that requires the user to press escape or click the close button to close it. We do this to avoid users accidentally closing a modal before they've saved changes.

I'm going to close this as I don't see it as a bug, but feel free to reopen if you want to debate this view or have a bigger discussion about it.

I think the issue here from your use case is that it assumes people are opening the modal to leave a comment. For me, as a teacher, I want to click on annotated passages to see what my students have written; similarly, as an author, I want to be able to click on the annotation to see what comments people have left. In these cases, my intention isn't to enter text, but to read, and it would be so much easier to simply click off of the annotation to go on to the next one or to continue reading the text.

I like your idea of ensuring that people don't lose text that they have typed, but could we activate a "are you sure you want to close? all entered text will be lost" message only when people have actually entered text into the box -- and otherwise, we just let them click off of the modal to close it.

I'm not assuming that everyone is going to leave a comment — but we do have to deal with the fact that someone could be leaving a comment.

I'd rather not add a "are you sure" modal because it adds a non-trivial amount of complexity to track the state of the various inputs that can show up when the modal is open. There can be multiple annotations in the modal, each of which can be in an editable state. Each annotation can have comments, and comments have threaded replies. I'm pretty sure it's possible to have more than one editing interface open at a time. We'd have to build some mechanism that spanned all these various editing interfaces and tracked the state of each of them, which is really non-trivial. Tracking that state will be complicated, so it will take time and add complexity to an already complex part of the application. I mean, we could do it, but it's not going to be a particularly quick fix.

You can always press escape to exit out, if you don't want to navigate to the close button with your mouse. Is that not sufficient?

That does help, but I didn't know that I could just click ESC. Here's the thing, though. When I click on an annotation, even as a logged in user, I don't see a text box to fill in. So there is no chance of me even losing text unless I actually click "reply" to an existing annotation.

Screen Shot 2022-11-10 at 12 03 47 PM