Commit graph

11731 commits

Author SHA1 Message Date
Adomas Venčkauskas
a2062bf011 Fix selection not being maintained when collapsing/expanding rows 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
55c758c9d0 Fix header columns being misaligned with table columns in item tree
And reindent _virtualized-table.scss
2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
431d7e1eaa Fix alternating-row colours switching upon child expand-collapse 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
efc009f724 Fix collection tree header alignment on macOS 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
7ec89c44ce Improve column sorting speed 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
ff627b7d3f Ensure column order and width prefs are properly retained 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
9e04250142 Do not sort a column on mouseup if mousedown occurred on a different one 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
4cea4519b8 Fix column resizing weirdness with fixed with columns 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
36ed9d302b Make item tree header height adjust based on font size 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
277503f879 Fix rows not being properly redrawn in duplicates view 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
a15fb83cc4 Fix feed sort being wrong 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
c496b5e367 Fix crash message not getting locked 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
8ebf1609b6 Item tree selection changes and fixes
- Fixes selection events always being debounced
- Fixes some failing tests
- Ensures Select All command selects search matching children of
collapsed parents. Adds tests for this case
2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
6dce19d546 Expand search parents whith Select All shortcut in item tree 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
1db2eb4aea Ensure disabled item tree rows are not selectible with Select All 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
7265393be9 Fix item PDF not opening on double click in tree 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
9c7f28b126 Fix trees not properly redrawing on drag events 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
b671611b51 Fix item tree message not being centered outside of main window 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
d83ec19c23 Do not try to open/close empty collection tree rows on + and - hotkeys
Causes performance issues
2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
b5dc0e7630 Add a comment for how to open the data generator 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
87014451de Fix item tree selection issues when using + and - hotkeys 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
cc97545bd6 Fix advanced search item tree being invisible on open 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
700ac31eef Ensure \n\n in itemPaneMessage is displayed as a newline 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
82f87a0d8d Add a Restore Column Order choice in the column picker 2021-08-21 06:58:12 -04:00
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