Focus inconsistencies in annotation notes
Sorry in advance for the long post...
There are inconsistencies with the annotation notes (the popups that appears when we click on an annotation). I observed these behaviors with highlight annotations, and with "Add note" annotations. Haven't tried with "Select Area".
Here are the current behaviors.
- A. Click on an annotation that has text in its note, notice that there is no cursor in the text.
- A.1. If you hit any arrow (left,right,up,down), it will navigate between the different annotations. This is expected since the focus seems to be on the entire annotation and its note, and not on the text of the note.
- A.2. If instead, you first click in the text to have a cursor: then,
- A.2.a. If you hit the left or right arrow, you will move the cursor left or right, and any subsequent arrow you hit will navigate in the text. This is expected since the focus is in the text (we see the cursor).
- A.2.b. However if you first hit the up/down arrow, it will go to the previous/next annotation and any subsequent arrow you hit will navigate between the different annotations. So there is a focus inconsistency, when hitting up or down for the first time, it should go navigate in the text, not the annotations.
This is regardless of whether the text in the note has one or multiple lines.
- B. Click on an annotation that doesn't has text in its note. This time, you get a cursor. in the note.
- B.1 Here, the behavior is the same as in A.2.b: hitting left/right first puts the focus on the text, whereas hitting up/down first puts the focus on the annotations. Of course, when the focus is on the text, hitting any arrow key has no effect since there is not text.
Another strange behavior that might be related is when deleting annotations:
- C. Click on an annotation that doesn't have text in it. There is a cursor in the note, which is there probably to avoid one more click when you want to annotate and enter text in the note of the annotation.
- C.1 If you hit Del or Backspace, it deletes the annotation. This is kind of strange considering that there is a cursor in the text, so you would think the focus is in the text, so hitting those keys shouldn't do anything (since there is no text to delete).
- C.2 If you first click in the text, and then hit Del or Backspace, it also deletes the annotation, so same behavior as in C.1
- C.3 If you first hit the left/right arrow, and then hit Del or Backspace, then it doesn't delete the annotation (expected since there is no text to delete).
Like in the previous problem, it seems that the focus was not "really" in the text, and then any character key or the left/right arrow really brings the focus on the text, but a Del or Backspace, or the up/down arrow, or a mouse click in the text, keep the focus on the annotation.
While I'm at it, the PageUp/PageDown keys also have a similar problem: it seems they get blocked by the fact that the annotation is opened, and there is also an inconsistency between annotation with or without text:
- D.1. Click on an annotation without text, then hit a PageUp/PageDown key, the key will work as intended once, but hitting it a second time or more doesn't do anything.
- D.2. Click on an annotation with text, then hit a PageUp/PageDown key, and nothing happens.
TLDR: Overall, I think there are 3 issues:
- When we click on a annotation with no text, the focus should be either on the annotation, or on the text. Right now, it's in a weird in-between state, from which you can get out, but there are inconsistencies as to which keys bring you back to which focus.
- When we click on a annotation with text, and then click in the text, all keys you further hit keep the focus in the text (even Del and Backspace), except for the up/down arrows.
- I'm not sure what's wrong for the PageUp/PageDown issue.
There are inconsistencies with the annotation notes (the popups that appears when we click on an annotation). I observed these behaviors with highlight annotations, and with "Add note" annotations. Haven't tried with "Select Area".
Here are the current behaviors.
- A. Click on an annotation that has text in its note, notice that there is no cursor in the text.
- A.1. If you hit any arrow (left,right,up,down), it will navigate between the different annotations. This is expected since the focus seems to be on the entire annotation and its note, and not on the text of the note.
- A.2. If instead, you first click in the text to have a cursor: then,
- A.2.a. If you hit the left or right arrow, you will move the cursor left or right, and any subsequent arrow you hit will navigate in the text. This is expected since the focus is in the text (we see the cursor).
- A.2.b. However if you first hit the up/down arrow, it will go to the previous/next annotation and any subsequent arrow you hit will navigate between the different annotations. So there is a focus inconsistency, when hitting up or down for the first time, it should go navigate in the text, not the annotations.
This is regardless of whether the text in the note has one or multiple lines.
- B. Click on an annotation that doesn't has text in its note. This time, you get a cursor. in the note.
- B.1 Here, the behavior is the same as in A.2.b: hitting left/right first puts the focus on the text, whereas hitting up/down first puts the focus on the annotations. Of course, when the focus is on the text, hitting any arrow key has no effect since there is not text.
Another strange behavior that might be related is when deleting annotations:
- C. Click on an annotation that doesn't have text in it. There is a cursor in the note, which is there probably to avoid one more click when you want to annotate and enter text in the note of the annotation.
- C.1 If you hit Del or Backspace, it deletes the annotation. This is kind of strange considering that there is a cursor in the text, so you would think the focus is in the text, so hitting those keys shouldn't do anything (since there is no text to delete).
- C.2 If you first click in the text, and then hit Del or Backspace, it also deletes the annotation, so same behavior as in C.1
- C.3 If you first hit the left/right arrow, and then hit Del or Backspace, then it doesn't delete the annotation (expected since there is no text to delete).
Like in the previous problem, it seems that the focus was not "really" in the text, and then any character key or the left/right arrow really brings the focus on the text, but a Del or Backspace, or the up/down arrow, or a mouse click in the text, keep the focus on the annotation.
While I'm at it, the PageUp/PageDown keys also have a similar problem: it seems they get blocked by the fact that the annotation is opened, and there is also an inconsistency between annotation with or without text:
- D.1. Click on an annotation without text, then hit a PageUp/PageDown key, the key will work as intended once, but hitting it a second time or more doesn't do anything.
- D.2. Click on an annotation with text, then hit a PageUp/PageDown key, and nothing happens.
TLDR: Overall, I think there are 3 issues:
- When we click on a annotation with no text, the focus should be either on the annotation, or on the text. Right now, it's in a weird in-between state, from which you can get out, but there are inconsistencies as to which keys bring you back to which focus.
- When we click on a annotation with text, and then click in the text, all keys you further hit keep the focus in the text (even Del and Backspace), except for the up/down arrows.
- I'm not sure what's wrong for the PageUp/PageDown issue.
1. While the sidebar was closed, I clicked on an annotation that I wanted to edit.
2. Based on the cursor position, I wanted to hit up arrow and then backspace.
3. Instead of moving the text cursor, up arrow selects the previous annotation. Backspace then deleted it.
Luckily, I was able to disable wifi on my iPad and retrieve the original annotation text before the deletion got synced.
Would it be possible to mitigate this somehow? It feels too easy to inadvertently delete an annotation. For example, see also:
https://forums.zotero.org/discussion/93648/too-many-backspaces-will-hide-annotation#latest
Sometimes it's not even obvious that a deletion has occurred, so undo capability won't help much there. Would it be possible to bring back the deletion confirmation dialog that was removed here, at least as an option?
https://github.com/zotero/zotero/issues/2320