* Improve feed item pane header (fixes#4141)
* Show item pane custom head when headerMode is none (fixes#4116)
* fx115: Fix button style on windows (fixes#4120)
* Move split-menu-button styles to SCSS
isSnapshotAttachment() checks the link mode (needs to be IMPORTED_URL),
but we actually allow viewing all attachments with text/html MIME types
as "snapshots" in the reader. Don't throw on any HTML attachment that
the reader is willing to open.
- 59afef6 added a duplicate assignment to item.rights that was putting
a TextConstruct(!!!!) in the item JSON field instead of a string
- info.rights was being set to a TextConstruct (preexisting issue!)
The 'blur' event needs to be dispatched by editable-text
before its state is reset (not after) because tagsbox uses
.initialValue in the 'blur' handler.
followup to 101e6d55d5Fixes: #3575
- fix the infinite loop glitch. Tweak of editable-text to only
dispatch 'blur' event if the input was actually blured. It prevents
the hideEditor from being locked in an infinite loop due to the
call stack hideEditor -> modifyCreator -> moveCreator -> blur -> hideEditor
- refactor blurOpenField to not be async and to not be used in most
places. It is mainly redundant now that editable-text handles blur
if clicked anywhere outside of it, so it helps to avoid confusion.
- since moveCreator does not await or yield for anything anymore, remove the
Zotero.spawn part. The rest of the function is unchanged.
- on focusin of the empty unsaved creator row, use its future unsaved id
that reflects its positioning instead of its real id (which technically is
the very last creator row). That way, a tab from a creator row that was just
filled will land to the proper component after render, as opposed to
focusing the very last row.
- similar approach to removing the unsaved creator row when the focus is
in it - focus the row above it, as opposed to the last row.
Fixes: #4145
Addresses part of: #4143
- plus button is enabled on all creator rows, not just the last one
- enabled plus button will add an empty unsaved creator row below
current creator row. After that, plus button is disabled as long as
the next row is unsaved.
- the grippy of a newly added unsaved row is disabled
- adding an unsaved creator row will remove another unsaved creator row
if one exists. That way, only one unsaved row can exist at a time
- once the unsaved creator row is added, it is tentatively perceived as
the "last" creator row based on its id. That is to avoid shifting all
other creators' indicies and saving the item too many times. When the
field is blurred, that new creator is moved into its "unsavedIndex"
before saving the item
Fix to a glitch where after switching creator field mode, the
autocomplete suggestions for creators would still be for the old mode.
This only happened if the field mode was changed on an empty, unsaved
creator row.
- removed ztabindex logic from itemBox. It is no longer needed, adds
unnecessary complexity and is likely at the root of multiple glitches
if a plugin inserts an arbitrary row that does not have ztabindex set.
- if a creator row is deleted when the focus is inside of the row, focus
another creator row to not loose the focus.
- more centralized button handling in `_ensureButtonsFocusable` and
`_updateCreatorButtonsStatus`
- refactoring of hidden toolbarbuttons css so that the icons are still
hidden and don't occupy space (if desired) but are still visible for
screen readers, so they are focusable without JS changing their
visibility (this with ztabindex removal fixes vpat 24)
- removed `escape_enter` event from `editable-text`. It was a workaround
to know when itemBox should move focus back to itemTree. Unhandled
Enter on an input or Escape should focus itemTree (or reader) from
anywhere in the itemPane/contextPane (not just itemBox), so that logic
is moved to itemDetails.js. To avoid conflicts with Shift-Enter, do
not propagate that event outside of multiline editable-text. Fixes:
#3896
- removed not necessary keyboard nav handling from itemDetails.js. It
was only needed for mac, and is redundant if "Keyboard navigation"
setting is on
- using `keydown` instead of `keypress` for itemDetails keyboard nav
handling because `Enter` `keypress` does not seem to get out of
`editable-text` but `keydown` does.
- old handleKeyPress from itemBox is no longer relevant for most
elements, so it is removed and substituted with a dedicated handler
just for creator row.
- moved the creator's paste handler into its own dedicated function
from the autocomplete handler (which was confusing)
- special handling for `enter` and `escape` events on `editable-text`
with autocomplete to not stop event propagation, so that the events
can bubble and be handled in `itemDetails`. It avoids some cases of
the focus being lost and returned to the `window`. It was unnecessary
earlier due to `escape_enter` workaround but only within itemBox and
only within itemPane.
- removed explicit tab navigation handling from `collapsible-section`
header. Currently, it may get stuck when buttons are hidden (e.g. in
the trash mode). It was only added to enable keyboard navigation on
mac before special "Keyboard navigation" setting was discovered (it
was never an issue on windows), so now it's easier to just let mozilla
handle it.
- always use `getTitleField` to find and focus the proper title field in
itemBox
- on shift-tab from the focused tab, just move focus to the first
focusable element before the splitter without any special handling for
attachments, notes and duplicates pane as before. It ensures a more
consistent and predictable keyboard navigation, especially now that
itemPane is fairly keyboard accessible.
Fixes: #4076
:focus-within doesn't match when the window is inactive but the field
is focused.
Addresses #4101, except that focusing the new item's title field and
pressing Escape will clear the field (without modifying the item).
If a parent item and its primary attachment are selected, it should
still say "Show File" rather than "Show Files". This adds the
questionably named `Zotero.Items.numDistinctFileAttachmentsForLabel()`
to try to figure out if we're operating on 0, 1, or >1 items.
Follow-up to #4124
Fixes the issue where long press would not open up
context menu in a virtualized table and tab bar because
it was handled in mousedown events that longpress on a
touchscreen does not dispatch.
This behavior is still observed in the scrollable area
of the reader and the note editor.
Addresses: zotero#4094
When item is created manually, title field in itemBox
will be focused instead of the title in the itemPane as before.
If the itemBox is collapsed, it will be opened.
Added 'open' setter to item pane section for brevity
Fixes#4111
- revert debcb9944d since it breaks
drag-drop reordering of tabs
- when reader is being refocused by contextPane, add a small delay
so that the focus settles on the tab before focusing the reader
- also explicitly refocus the reader tab after drag, since then focus
also lands on the tab and finds itself outside of the reader
If the info section is collapsed, do not try to focus and
open the itemType menu as it can lead to an empty dropdown.
Just focus the header title in that case
After clicking on a reader tab, the reader will get focused
but the default mousedown event handler can then shift
focus onto the actual tab. It looks like the focus gets "lost",
and breaks reader keyboard shortcuts so we want to avoid it.
Mainly happens on windows.
Fixes: #4077
- If there are too many tabs opened to fit onto the screen,
the tabs menu can be scrolled
- When tabs menu is opened, scroll to the selected tab
- Use margins instead of padding to that the scrollbar does not
overlap with the cross button
- Make sure that if the tabs menu is long, there will
be a gap between it's top/bottom and the edge of the
screen
- On linux, screen.availTop and screen.availHeight are not always
correct and the menu can go outside of what is supposed to be
the available screen area. Special treatment for those
edge cases
Fluent seems to clear out label/placeholders attributes set directly
(not via .ftl file). So quicksearch placeholder added directly ends
up being emptied out.
This is the cleanest workaround found so far: add the placeholder
as the fluent argument
Fixes: #4073
- do not erase the last recorded tag on blur of the tag selector
- on tab from collectionTree or shift-tab from tag selector input,
try to refocus that last focused tag. If one does not exist,
try to focus the first non-disabled tag.
Fixes: #4008
Locator type dropdown just has aria-label "Locator type".
The locator input is labelled by a hidden label with "Locator input"
string, as well as the locator type. That way both are announced
when it is focused.
Fixes: #4039
- vpat 57: remove tabindex values, set tabindex=0 on all focusable
fields. It allows mozilla to determine the best focus sequence
for keyboard navigation and fixes wrong order where some inputs would
go before the "Ok" and "Cancel" buttons and some - after
- vpat 58: added labels to all inputs to be announced when focused.
Added separate labels for locator menulist and for the locator input so
that the locator type has a proper label. It is also better to have
visible explicit labels when possible
Since Word can't handle FSI/PDI.
This affects dragging items into notes and dragging/copying annotations
in the reader. Citations inserted from within the note editor already
didn't include bidi control characters.
Fixes#4013
* tag selector focus edits
- no tabstop on the tag selector scrollable area
- change tag selector's role from default "grid" to "group".
"grid" is not quite correct semantically and leads to
voiceover suggesting irrelevant commands.
- move all keyboard handling logic to tagSelectorList.jsx.
Tabbing through tag selector is now handled in ZoteroPane,
so the only logic left there is arrow navigation
between tags, and there's no reason to not have it
together with the tags list.
- a workaround to deal with focused tags when windowing
kicks in. When a tag is focused, record its index.
Each time tags are re-rendered, if the saved index is not
among rendered tags, refocus it, otherwise, move focus
to the tags list.
Screen readers announce the index of the selected item
from the list of citations in the panel. This removes
the separators from the count, since they are not focusable
and should be skipped.
- edits to zoteroPaneTest.js focus tests to expect the updated focus
sequence: selected tab -> tabs menu -> sync button -> collectionTree
toolbar -> collectionTree -> tags selector -> itemTree toolbar
- updated tags selector keydown handling to explicitly handle all
tab/shift-tab events using moveFocus. It is more readable and explicit
focus handling for all components is required for programmic tab/shiftTab
events dispatched in tests to actually move focus
Fixes: #3975
From the sync button, tabbing will move focus in the following mannger:
collections toolbar -> collections -> tags selector -> itemTree toolbar
-> itemTree.
On last tab in the itemPane/contextPane, focus will wrap around
to the selected tab to complete the loop. It ensures
that the focus order is consistent regardless of the
directions.
Also, minor tweaks to focusWrapAround in Zotero_Tabs
to properly move focus to the last focusable entry in
the contextPane.
- set each tag's role as "checkbox"
- set "aria-checked" status depending on if the tag
is selected
- added aria-label to tag selector so it does not
default to "grid"
Added aria labels and button roles for buttons in the
item/Collection pane. This includes buttons in the header
as well as rows from notes, related, collections, and
attachments section that act as buttons. Also added
missing aria-labelledby for mini-itembox rows below
attachment preview to have filename, dateModified
and etc. properly labelled.
This also covers most of vpat 16.
This does not affect how tags/header/itemBox entries are announced.
There is a separate issue with NVDA and JAWS sometimes struggling
with announcing text inside of `editable-text` component,
so this will be handled separately.
- added role="link" to "zotero-text-link" custom component,
using that instead of directly setting the class
wherever possible
- in all other cases, added role="link" directly to links
- added tooltiptext and "noClick" option to zotero-text-link
so that this component could be used in attachmentBox.js
- use "keyboard-clickable" class in zotero-text-link
instead of a separate listener to handle keypresses for brevity
* feed settings: part of the grid, not needed
* progress queue: migrated to flex
* tab-bar-container: already fixed in scss
* zotero-lookup-multiline-progress: migrated to flex
* zotero-lookup-textbox: removed, does nothing
* #zotero-prefpane-advanced #data-dir-path: migrated to flex
* #zotero-prefpane-sync: migrated to flex on #storage-url, removed from #storage-password to fix layout
* .search-condition: migrated to flex
* updates.css: migrated to flex
This reverts commit ecea550a37.
It seems to be causing various UI issues, including the items list
sliding under the item pane when the collections pane is expanded
(though I can no longer reproduce that).
Using timeout in credentialsChange caused button to become momentarily disabled
making it flicker. I've verified that the delay is no longer needed and that the
button becomes disabled when using backspace to clear the login/password input field.
- css tweaks for proper sizing and minor cleanup
of unused classes and properties
- added flip="none" for the panels to not bounce
around window's edges
- removed dialog's marginBottom on macOS - it doesn't
seem needed anymore
- close and reopen panel when window's height changes
on all platforms. It used to only happen on windows
but now the panel remains at it's original location on
macOS as well, so we'll always reopen the panel so
that is is positioned close to the dialog
- try to postion the panel in the middle on windows
- fix progress meter not appearing
* improved qf window drag
- not using old windowDraggingUtils since it causes
issues on windows with the mouse outrunning the window.
- instead, set -moz-window-drag: drag on dialog when
the mouse is over the red border
- added chromeutils param to the window. These are required
for dragging to work on windows and their values are
important because wrong values will cause the window to
shrink and basically disappear. 0,0,15,0 seems to work
most reliably though the reason why other values (e.g.
0,2,2,2 as on the ZoteroPane window) break window is not
clear
- added margins around the dialog on windows. moz-window-drag
doesn't seem to properly work for mouse clicks very close
to the window's edge
- with fx115, the <panel> does not follow the window
when it is dragged, so we have to hide the panel during dragging.
Unfortunately, mouseup/down events don't fire on the dialog when
moz-window-drag: drag is set on windows. Without these events,
as a workaround, we check window's position periodically and
hide/display the reference panel based on that.
- removed initial window.resizeTo() right when the content is
loaded. It's not needed and sometimes causes rendering
issues when the dialog appears shrunk.
* fx115 linux css edits
- try to make the dialog look like dialogs on other platforms.
Red background, no chrome etc. The actual window's background can't seem
to be transparant, so no round borders
- minor edits to sizing on linux
- Use min-width: 100vw on the <dialog> element to prevent
window.sizeToContent() from expanding the dialog unnecessarily on
style selection
- Set the window min-width since fx115 width attribute on the window is
ignored
- Set ids to persist position and dimensions