Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Context pane notes list focus handling edits #4837

Merged
merged 1 commit into from
Nov 15, 2024

Conversation

abaevbog
Copy link
Contributor

  • fix the issue of focus not landing on search field of the notes pane when it is opened on tab from the reader
  • shift-tab from the sidenav when notes pane is opened will focus the search input as well, instead of the last focusable node in the pane (e.g. "X more..." button at the bottom)
  • tab from a note-row in the list of notes will focus the sidenav
  • shift-tab from a note-row will focus the header of the collapsible-section. I thought focusing the reader right away would be too much, since one might need to get to the + button to add a note, or something like that. And once you are at a section header, you can jump to the header of the previous section (if there is one) with arrowUp, at which point, you are at the top of the notes pane.

Per #4235 (comment)

- fix the issue of focus not landing on search field of the notes
pane when it is opened on tab from the reader
- shift-tab from the sidenav when notes pane is opened will focus
the search input as well, instead of the last focusable
node in the pane
- tab from a note-row in the list of notes will focus the sidenav
- shift-tab from a note-row will focus the header of the collapsible-section
of the row

Per zotero#4235 (comment)
@dstillman
Copy link
Member

dstillman commented Nov 15, 2024

This looks good, except if you're on a note row and Tab to the sidenav, and then Shift-Tab, you end up back in the note search field instead of on the note you were on before.

@dstillman
Copy link
Member

Oh, which I guess you're saying was on purpose, but I'm not sure why? Just feels wrong.

@dstillman
Copy link
Member

And to be clear, I'd expect it to refocus the specific element in the list that was focused before, as we do in the annotations tab of the left sidebar.

@abaevbog
Copy link
Contributor Author

Oh, which I guess you're saying was on purpose, but I'm not sure why? Just feels wrong.

I noticed that before this tweak, Shift-Tab would move focus back from the sidenav, which would land on the last focusable element (e.g. "X more" button at the bottom) and felt quite weird after playing around with it. So I thought that simulating a tab into the notes list (to land on the search input) would be less weird, that way focus is at least at the top. But it's a great idea to add an extra step to remember what note was last focused (just with a special attribute, maybe) and focusing that, if it exists.

@dstillman
Copy link
Member

Yeah, I think it's pretty much just identical to the Annotations tab. You can move up/down in that list and Tab or Shift-Tab out of it, and then if you go back in, you're on the same entry.

@dstillman
Copy link
Member

Similarly, I guess, we might want to do the same when tabbing forward in. So if you use down-arrow to move down the list, Shift-Tab back to the section header disclosure button, and Tab back, you'd end up on the same note row.

This is also, of course, how the collection and item trees work.

@dstillman
Copy link
Member

Let's get this in and tweak that separately. This is already an improvement.

@dstillman dstillman merged commit 7f57a43 into zotero:main Nov 15, 2024
1 check passed
abaevbog added a commit to abaevbog/zotero that referenced this pull request Nov 15, 2024
- remember the last focused note-row in the contextPane
and, if possible, refocus it on shift-tab from sidenav, on
tab from the reader into notes pane, or on tab into the
notes list from the collapsible-section. Otherwise, focus the search input.
Per: zotero#4837 (comment)

- when a note is opened in the context pane, let shift-tab
from sidenave place focus on the links-box. That way,
it is not skipped during tab navigation.

- fix focus not entering note-editor on Tab from the "Go back"
button and instead wrapping around to the current tab
dstillman pushed a commit that referenced this pull request Nov 21, 2024
- remember the last focused note-row in the contextPane
and, if possible, refocus it on shift-tab from sidenav, on
tab from the reader into notes pane, or on tab into the
notes list from the collapsible-section. Otherwise, focus the search input.
Per: #4837 (comment)

- when a note is opened in the context pane, let shift-tab
from sidenav place focus on the links-box. That way,
it is not skipped during tab navigation.

- fix focus not entering note-editor on Tab from the "Go back"
button and instead wrapping around to the current tab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants