Commit graph

11607 commits

Author SHA1 Message Date
Adomas Venčkauskas
2b6c7277f7 Item Tree: Do not display Title in the columnpicker 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
af597d943b Move js-tree files out from /containers subfolder 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
e68685521b Do not change selection on macOS when using PageUp/Down 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
f773f79d10 Documentation adjustments for virtualized-table 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
82914a9583 JSWindow - WindowedList 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
67d9e87c55 Icons.getDomElement() -> Icons.getDOMElement() 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
47094fc4c3 Misc new tree cleanup 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
d26eba2d2c Adjustments and documentation for Utilities.Internal.makeClassEventDispatcher 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
bcd9d777c9 Remove unused Debug._setLevel() 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
51f13412b9 Documentation for the tree selection 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
5a97f2bdd8 ReactDom -> ReactDOM 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
1e75425698 Fix highlighted collection not unhighlighting 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
2f72ed17b7 Ensure columns with different visibility group retain their config 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
cbbff600a6 XUL -> JS tree megacommit
- Just a single huge commit. This has been developed over too long a
time, required many tiny changes across too many files and has seen too
many iterations to be separated into separate commits.
The original branch with all the messy commits will be kept around for
posterity
bb220ad0f2...adomasven:feature/react-item-tree
- Replaces XUL <tree> element across the whole zotero client codebase
with a custom supermegafast virtualized-table inspired by
react-virtualized yet mimicking old XUL treeview API. The
virtualized-table sits on top on a raw-to-the-metal,
interpreted-at-runtime JS based windowing solution inspired by
react-window. React-based solutions could not be used because they were
slow and Zotero UI needs to be responsive and be able to
display thousands of rows in a treeview without any slowdowns.
- Attempts were made at making this screen-reader friendly, but yet to
be tested with something like JAWS
- RTL-friendly
- Styling and behaviour across all platforms was copied as closely as
possible to the original XUL tree
- Instead of row-based scroll snapping this has smooth-scrolling. If
you're using arrow keys to browse through the tree then it effectively
snap-scrolls. Current CSS snap scroll attributes do not seem to work in
the way we would require even on up-to-date browsers, yet alone the ESR
version of FX that Zotero is on. JS solutions are either terrible for
performance or produce inexcusable jitter.
- When dragging-and-dropping items the initial drag freezes the UI for
a fairly jarring amount of time. Does not seem to be fixable due to
the synchronous code that needs to be run in the dragstart handler.
Used to be possible to run that code async with the XUL tree.
- Item tree column picker no longer has a dedicated button. Just
right-click the columns. The column preferences (width, order, etc) are
no longer handled by XUL, which required a custom serialization and
storage solution that throws warnings in the developer console due to
the amount of data being stored. Might cause temporary freezing on HDDs
upon column resize/reorder/visibility toggling.
- Context menu handling code basically unchanged, but any UI changes
that plugins may have wanted to do (including adding new columns) will
have to be redone by them. No serious thought has gone into how plugin
developers would achieve that yet.
- Opens up the possibility for awesome alternative ways to render the
tree items, including things like multiple-row view for the item tree,
which has been requested for a long while especially by users switching
from other referencing software
2021-08-21 06:58:12 -04:00
Tom Najdek
f274323478
Mendeley import: Move temp downloaded files instead of copying #2149 (#2150)
During Mendeley api import all attachments are fetched into temporary
location and were previously copied to the storage folder. Only after
import completed, temporary files were deleted. Therefore a complete
import required storage equal to twice the final library size. Switching
to move avoids this problem.

Also:

- Fix _isTempDownloadedFile() check
2021-08-20 00:07:28 -04:00
Dan Stillman
ddc7be75c7 Use PRAGMA legacy_alter_table=ON for existing schema updates
This won't make a difference until we update Firefox and get a new
SQLite version, but at that point the existing schema update steps that
recreate tables by renaming the old table would result in broken foreign
keys.

This patch will make sure that newer SQLite versions will use the legacy
behavior for the existing steps, and going forward schema update steps
that want to recreate tables will need to create a new table, migrate
the data, delete the old table, and rename the new one into place.
2021-08-17 00:41:59 -04:00
Dan Stillman
eac98d1c2e Add test for 4.0 → 5.0 DB upgrade
With a mechanism for specifying a zipped DB copy to use as the initial
DB when resetting the DB in tests
2021-08-17 00:41:59 -04:00
Dan Stillman
0f96c20f3c Fix several possible DB upgrade errors from 4.0 to 5.0
- We were updating global schema before migrating userdata, but a 4 → 5
  upgrade involved a system.sql version bump, which wiped out itemTypes,
  causing 'annotation' to not exist after the upgrade. This moves global
  schema updates after userdata migration and bumps the global schema
  version to repair DBs that were already upgraded and broken.

- A system.sql bump without a global schema update would result in empty
  tables. This moves the global-schema-related tables to userdata.sql.

- The DB integrity check before userdata updates added in 5b9e6497a
  could fail when coming from an older DB, because the checks assume
  current schema. An integrity check is now done after a userdata update.
  (We were already skipping the new table/index reconciliation stuff. If
  old DBs are discovered to have problems that would cause a migration
  step to fail, we'll fix those explicitly in the steps.)

Also:

- Make sure `version` is `versionNumber` in the `fields` table. It was
  changed with a system.sql bump in 5.0, but hard-coded fields were later
  removed from system.sql in favor of schema.json, meaning that anyone who
  upgraded from 4.0 after that would never have `version` removed and so
  would have both fields (one from before and one from schema.json).
2021-08-17 00:41:59 -04:00
Dan Stillman
4021492797 Babel: Add support for optional chaining
https://babeljs.io/docs/en/babel-plugin-proposal-optional-chaining
2021-08-17 00:41:59 -04:00
Dan Stillman
f50a3b0840 Merge new English strings 2021-08-13 06:32:37 -04:00
Dan Stillman
3732f97d41 Add OpenURL resolver directory
Remove the apparently obsolete [1] WorldCat `lookup?IP=requestor` search
functionality and replace with a hierarchical menu populated directly
from our directory [2].

Also switch to https://www.worldcat.org/registry/gateway as the default
resolver, which seems to be the same as
http://worldcatlibraries.org/registry/gateway but with HTTPS support

Fixes #1811
Fixes #1853

[1] https://forums.zotero.org/discussion/79312/search-for-resolvers-gives-out-of-date-information
[2] https://www.zotero.org/support/locate/openurl_resolvers
2021-08-13 06:25:16 -04:00
Adomas Venčkauskas
5118cd4164 Fix note insertion errors when note does not contain citations 2021-08-13 13:18:15 +03:00
Dan Stillman
9738d20558 Update note-editor submodule 2021-08-12 00:56:26 -04:00
Dan Stillman
15162c277b Update locales from Transifex and merge new English strings 2021-08-12 00:43:18 -04:00
Dan Stillman
ee2b63bf18 Update submodules 2021-08-06 16:56:31 -04:00
Dan Stillman
5ae8e819ef Update utilities submodule and add comment for MAX_TITLE_LENGTH 2021-08-06 16:06:29 -04:00
Martynas Bagdonas
9b3367f227 Allow zotero://open-pdf/ to navigate to specific annotation by key
zotero://open-pdf/library/items/AABBCCDD?annotation=[annotation-key]

Fallback to a page if annotation is missing:
zotero://open-pdf/library/items/AABBCCDD?page=123&annotation=[annotation-key]

Fixes #2125
2021-08-06 13:06:40 +03:00
Martynas Bagdonas
6472321000 Upgrade note-editor schema to v4:
- Set `annotation.attachmentURI` instead of `annotation.uri` when inserting annotations
- Migrate `annotation.uri` to `annotation.attachmentURI`
- Add `annotation.annotationKey` that references to the original annotation
2021-08-06 13:06:40 +03:00
Martynas Bagdonas
a065d477ed Add zoom options to View menu
Fixes #2138
2021-08-05 11:27:54 +03:00
Martynas Bagdonas
bd56b16247 Fix missing checkbox issue for standalone PDF reader window 2021-08-05 11:23:35 +03:00
Dan Stillman
97b381f435 Update utilities submodule (fixes #2141)
Follow-up to #2128
2021-08-04 20:40:27 -04:00
Dan Stillman
21df0ecac6 Remove shallow=true for translate and utilities submodules
Shallow submodules break normal fetching/pulling in confusing ways.
2021-08-04 20:20:54 -04:00
Dan Stillman
b1e63c8fe1 Update translate and utilities submodules 2021-08-04 20:02:46 -04:00
Abe Jellinek
4ebed5dee7
Update strings and add test for ADS Bibcode extraction (#2128) 2021-08-04 19:37:49 -04:00
Abe Jellinek
4475e86eac
Fix error when connector requests translators (#2135)
The call to done() resulted in a 500 response and prevented the
connector from fetching the list of available translators.
2021-08-04 04:39:43 -04:00
Martynas Bagdonas
7015c8df59 Fix missing menu checkbox issue on pdf-reader and note-editor on Windows 2021-08-02 11:45:30 +03:00
Abe Jellinek
5bfdeb36ca
Exclude unmergeable types by name, not by ID (#2137)
Excluding by ID obscured which types were being excluded. IDs drifted
and we ended up blacklisting artwork and encyclopediaArticle.
2021-07-30 16:15:10 -04:00
Adomas Venčkauskas
0e2073b251 Revert removal of Utilities.Internal.itemToExportFormat() (since c929055) 2021-07-30 14:28:14 +03:00
Adomas Venčkauskas
4d497afea0 Use Translator Tester code from shared repo for Scaffold 2021-07-28 15:46:07 +03:00
Adomas Venčkauskas
8f90cfbcfd Remove obsolete files after shared code modularization 2021-07-28 15:46:07 +03:00
Adomas Venčkauskas
7814efcfe2 Use zotero/translate and zotero/utilities for shared code 2021-07-28 15:46:07 +03:00
Adomas Venčkauskas
c929055571 Refactor utilities code in preparation to move to external repo 2021-07-28 15:46:07 +03:00
Martynas Bagdonas
e0bc873bce Improve embedded note image loading and deletion:
- Delete unused embedded images when note is closed.
- Load images as soon as they are downloaded.
- Introduce new notification for download event, and a test for it.
- Prevent simultaneous downloads of the same attachment.
2021-07-28 13:49:04 +03:00
Martynas Bagdonas
3c658fc672
Copy embedded images, downloaded when needed or show a warning (#2129) 2021-07-26 13:04:38 +03:00
Martynas Bagdonas
a40ac2907e Open PDF files over viewAttachment() to reuse its logic (download, etc.) 2021-07-22 17:54:46 +03:00
Dan Stillman
966bee275c CI: Temporarily disable NPM cache due to a bug in the setup-node action
Getting "Cache folder path is retrieved for npm but doesn't exist on
disk: /home/runner/.npm" in the "Post Install Node" step for all runs
2021-07-22 04:46:10 -04:00
Dan Stillman
a5902fc466 Update translators 2021-07-22 02:17:35 -04:00
Martynas Bagdonas
415973d83c Update citations only on note edit to avoid sync loops 2021-07-21 21:30:53 +03:00
Martynas Bagdonas
aa11c36a64 Little fixes to note editor:
- Fix invalid selector
- Filter itself sent postMessage messages
2021-07-21 21:20:20 +03:00
Dan Stillman
6a6e4fa92c Don't update retractions on bundled file update notification 2021-07-21 03:45:25 -04:00