- always render options and link buttons - just do
not display them if their respective field is empty.
That allows us to easily handle focus after refresh
because otherwise, the node may does not exist.
If we try to restore focus to such hidden component,
simulate a "tab" from it to focus the next possible node.
This fixes the issue of focus being lost on tab after all
content of editable-text is cleared.
- add tabindex=0 to itemType menulist, otherwise it was
not perceived as a candidate to return focus to.
- somewhat special treatment for restoring focus to
creator rows. If the desired node is not found, we'll
try to focus the respective node in the last creator row.
It prevents focus from being lost on tab after clearing
the very last creator.
Fixes: #4241
this._addCreatorRow needs to be properly initialized to
false (as opposed to being undefined) because 'false'
is the value we check against to decide if an empty
row should be added and focused after rendering.
Fixes: #4268
- only have enabled "Permanently delete" and "Restore to library"
options in the context menu for collections and searches in the trash
- display the custom header with buttons to delete or restore
in the itemPane when a collection or search in the trash is selected
Fixes: #4295
a532cfb475 added `isCollection()`, `isSearch()`, and `isItem()` methods
to data objects to handle collections and searches in the trash, with
`isItem()` checking whether `._ObjectType` was `Item`. That left out
feed items (`._ObjectType` == `FeedItem`), and when c384fef867 made
`getSelectedItems()` return only items, it used `isItem()`, so feed
items were excluded, which broke feed-item toggling between read and
unread [1] and possibly some other things.
The simple fix would be to make `isItem` match feed items as well (which
could potentially fix other bugs related to feed items), but there was
actually no need to add new methods (which can get confused with
`CollectionTreeRow` methods) when we can just check the object type with
`obj instanceof Zotero.Item`, which gets the benefit of inheritance and
matches `Zotero.FeedItem` instances as well.
[1] https://forums.zotero.org/discussion/115571/cannot-change-the-status-of-title-in-subscribtion
Fix to breakage after 3f45def that would not open a duplicate
tab but instead create another reader instance in the same tab.
Instead of finding a tab for a specific item, use tabID that
is passed when reader should be loaded in an unloaded tab. That
allows us to know if the tab is being duplicated or not.
Fixes: #4272
Sidenav button pane IDs usually correspond to sections with the same
IDs, but `context-notes` actually corresponds to two sections
(`context-all-notes` and `context-item-notes`). We were preventing
those sections from being pinned, but not the button that reveals them.
Fixes#4283
This adds an explicit function on ZoteroPane and the item tree for
getting objects -- including collections and searches in the trash --
and limits `getSelectedItems()` to returning actual items from the
selection. We shim various item properties on the collections and
searches in the trash, but code that's getting the selection should be
explicit about what it wants. Outside of the trash, they're equivalent,
except `getSelectedObjects()` does have an `asIDs` mode.
This switches to using getSelectedObjects() in various places and fixes
collections in the trash appearing as belonging to My Publications when
using the collections-containing-an-item highlight [1].
This also adds support for highlighting the parent collections of
collections in the trash.
[1] https://forums.zotero.org/discussion/115449/zotero-7-beta-deleted-collection-appears-as-belonging-to-my-publications
- Remove unsaved creator row on blur or escape
- Rename "unsavedRow" for "position" as we want to be able to find
the relative position of creators after the next refresh not only
for unsaved rows. In many cases "unsavedRow" as returned by getCreatorFields
is the actual index of the creator row.
- Calculate and use "position" in getCreatorFields for all creator rows, not
only unsaved one, when a new row is being added.
This fixed a bug where wrong row gets focused if an unsaved creator row is
added, some text is typed and then another creator row below this unsaved row is clicked.
- fixed a bug where autocomplete options would not be updated after creator mode
is switched for the default empty row (if there are no creators)
- simplified paste handler of creators to use modifyCreator that
also shifts creators if a creator is unsaved. Fixed bug brought up in
https://github.com/zotero/zotero/pull/4165#issue-2313280474 where
pasting creators does not always focus the last added creator.
- Fixed another bug brought up in https://github.com/zotero/zotero/pull/4165#issue-2313280474
where shift-enter from creator before "_ more creators" label
will add a new row in the end instead of focusing the next creator.
- Fixed bug where adding a row right before "_ more creators" label
and blurring it will remove all creators after it. Now, clicking +
on a creator right before the "_ more creators" label will display
all creators and add a row after it.
- Fixed a bug where if "_ more creators" is present, editing
a creator name and pressing shift-enter would loose focus
instead of adding and focusing a new row in the end.
- Fixed a bug where focus got lost from some buttons
Fixes#4143Fixes#4241
- linked color scheme radio buttons to their label. Using
aria-describedby on individual radio buttons instead of
linking color scheme label to radiogroup because voiceover
does not announce the label in that case.
- linked item pane header dropdown to its label
- linked markdown and richtext note format checkboxes to their labels.
- added aria description to linked attachments base directory
so the input and "choose" button
- linked virtualized tables to their labels
Data directory location setting needs some more labeling as well
but it's mechanics should be generally reworked per vpat 50.
- if an unloaded tab is being opened, do not close the
tab and have reader re-open a fresh tab. Instead, keep the
tab as is, have reader use the tab as a container and
just change the tab's type. It should fix a glitch on
windows when if you click on a tab during initial loading,
it will disappear until reader re-adds it. A few tweaks
to allow unloaded tabs be generally "selectable".
Fixes: #4149
- during startup loading, select the yet-unloaded tab right
away. That way, a tab is almost immediately selected,
instead of being stuck on the library tab until the reader is ready.
- if the items are not loaded yet, use a placeholder
icon for tabs. Fixes: #4150
- special handling for reader loading message during initial
load. When an unloaded tab is selected, the loading message
needs to be displayed but, since there is no reader yet, we
add it in Zotero_Tabs.select and try to remove by the reader
when it's loaded.
- Use SVG icons
- Show "[x] collection selected" or "[x] searches selected" in the item pane
- Show "[x] objects selected" if multiple types are selected, which I
don't love, but I don't have a better idea
- Use existing strings for ARIA labels
When a collection or a saved search is deleted, it appears in
trash among other trashed items. From there, it can be restored
or permanently deleted.
Items of trashed collections are not affected my the trashing/permanent
deletion of a collection and need to be deleted separately like before.
Subcollections of a trashed collection do not appear in the trash and
are restored or permanently deleted with the top-most trashed parent.
Previously we were redownloading only `SYNC_STATE_TO_DOWNLOAD` files,
not `SYNC_STATE_FORCE_DOWNLOAD`, because the latter gets downloaded even
when using on-demand file syncing, but if the download fails for some
reason, it should be retried on a manual open.
If the header is in bibliography entry mode.
Instead of trying to focus editable-text of the header (which
may not be possible), just focus the next node after the header.
- Add pagination, limits, and Link header
- Add schema endpoints and dummy /settings endpoint
- Add /file endpoints
- Browser security restrictions prevent the web library from actually loading
the file: URIs that the local API returns, but out-of-browser use will work
fine
- Add toResponseJSONAsync() DataObject function: delegates to toResponseJSON()
by default, adds information that requires awaiting promises
- Best attachment (links.attachment) and file size (links.enclosure.length)
for items, meta.numItems for groups
- Separate function for compatibility with the existing test code that uses
toResponseJSON(), but we could consider unifying
This commit does not add the Access-Control headers that allow webpages to make
requests to the local API, since I don't think we actually want that.
This required some tweaks to other parts of Zotero infrastructure:
- Search:
- Add 'includeDeleted' condition to match behavior of 'includeTrashed' API
parameter in a single search
- Data objects:
- Improve toResponseJSON() implementations so output better matches the web
API
- Add toResponseJSON() to Zotero.Tags - has to be async so it can query the
database and generally works differently from other toResponseJSON()
functions, but accomplishes the same task
- Remove unused getAPIData() and apiDataGenerator() DataObject functions. They
aren't functional and wouldn't really make implementing the local server
easier, so now seemed like a decent time to remove them
- Server:
- Support resolving routes using pathparser.jsm
- Add allowMissingParams option to PathParser#add(): prevents /route from
matching /route/:param
- Replace the query property of the data object sent to endpoint init()s with
searchParams, an instance of URLSearchParams - supports #getAll() for
repeatable parameters
- URIs:
- Make getObjectURI() public, add utilities for converting URIs to API
endpoints and web library URLs
- Set the window minimum size to 700px x 500px.
- Fix a regression where non-applicable operators remain visible.
- Fix the "✔️" appearing next to multiple operators in the operator popup menu.
- Include the "Year" and "Attachments" columns by default in the results table.