Closes#2168, closes#2169.
Adds find-as-you-type to locate, preference style and export
formats managers.
To enable find as you type you need to specify the getRowString(index) prop
on the VirtualizedTable. See prop comment for more info.
- Messages are shown once a day by default (within the same session for
id-less messages)
- Messages with an `id` attribute include a checkbox to not show again
for 30 days
- If an `infoURL` attribute is provided, a "More Information" button is
shown that launches that URL
- If `title` is provided, it's used for the dialog title. Otherwise
"Warning" is shown.
- Select last reopened tab instead of opening all in background
- Rearrange Close/Close Other Tabs/Reopen Closed Tabs options
- Use proper plural for Reopen Closed Tab[s]
7ef7943a17 made "Loading items…" small again after it got big during
HTMLification but made everything else (e.g., welcome message, My
Publications intro) small as well. This adds an ugly hack to keep the
loading message small for now (without passing dedicated HTML from a
bunch of different places).
Removes `defaultRowHeight` prop added in adb8aa39f in favor of a prop
that disables font size scaling. A non-default row height can still be
specified with `rowHeight`.
Most of our existing trees need to disable font size scaling, but the
idea is that pretty much everything _should_ scale with font size for
accessibility, and it's a limitation of the current prefs and other UIs
that they don't currently, so it's better to default to scaling and
gradually remove uses of this prop.
This fixes a bug where the HTML trees other than the collection and item
trees would have larger rows but without larger text when font size was
increased.
Also:
- Fixes#2157 by fixing line height adjustment on macOS when at the
default font size, applying it to all trees, and moving the explicit
`rowHeight` override from the item tree to the collection tree, which
should have more spacing than all other trees (rather than the item tree
having less).
We can do fun things now.
Also:
- Make colored tag swatches resize with the font size
- Increase border radius for color swatches, and adjust with size
Roughly center child item icons between the parent item icon and text,
which looks a bit less awkward than the previous tree's positioning. An
alternative would be to align with the beginning of the parent item text
(a value of 21), but that's a bit spaced out, at least until we have
multiple levels with additional twisties.
- 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
- 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
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
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.
- 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).
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
- 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
- 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.
Just don't consider items in the trash to be linked items in
item.getLinkedItem(). I'm not totally sure why we didn't do this many
years ago, since it's one of the biggest sources of confusion in Zotero.
This addresses #1648 and closes#1610, though not by undeleting and
overwriting the item in the trash. When deleting an item and then
re-dragging it from another library, I think most people would expect
the item in the trash to still exist (possibly with notes, etc.), rather
than having been automatically restored and overwritten with new data.
And since `Zotero.Libraries.isGroupLibrary()` just checked that
property, that hasn't worked either since `isGroup` was added in 2015.
There's no test for `.isGroup`, and the test for `isGroupLibrary()` used
`if()` instead of `it()`, so it never actually ran.
Also:
- Remove old code block in search.js that called `isGroupLibrary()`.
Since `isGroupLibrary()` didn't work, this block was unused, and its
logic was previously added elsewhere.
- Properly transform HTML tags flavored plain-text into actual HTML
- Add support for multiline comments and highlights
- Insert newline before citation/comment when necessary
We're relying on Bluebird's synchronous promise inspection for noWait
translate mode (as used in Quick Copy). We should decide if we want to
keep the Bluebird dependency or rewrite this to use native promises
(e.g., with a separate synchronous `_loadTranslator()` function for
noWait mode), but for now just restore the `Zotero.Promise.method()`.
The bug fixed in bde9a74f9d was triggering an error getting code for a
deleted search translator, which due to this bug caused a double
complete() call that got detection all out of sync, which caused some
search translators to be skipped, which resulted in ISBN lookup
failures.
Among other things, if the name of a translator was changed, until
restart Zotero.Translators.getAllForType() would return the old cache
entry pointing to a file that no longer existed.
- Make a copy of the database after first initialization that can be
swapped in when reinitializing in resetDB()
- Avoid unnecessary one-second delay on every reset
Probably more that can be done, but this should take minutes off the
test runs
- Add/Remove Dictionaries window
- Better account for the (unlikely) possibility that a dictionary could
be replaced by another more popular dictionary provided by a different
extension id (tested)
- Better account for the (very unlikely) possibility that an extension
could bundle multiple dictionaries (untested)
- Use toolkit version comparator for proper extension version
comparisons
- Localize strings
- Add tests for updating
Otherwise switching back to release from beta doesn't show the last-used
version if the beta hasn't gone through at least one
compatibility-breaking schema update.
This connects the new feed processor to Zotero's existing feed reader. The new
feed processor assumes a content window environment, so a sandbox in a parent
window is used to load it.
There is no isInstitution field, so OpenURL search was producing invalid
data for items with institutional authors. Instead we use the name field
in API JSON and the isInstitution flag in internal JSON.
It's not totally clear how it's calculated, but it doesn't seem to be
just characters.
And make the path limit 255, which is the File Explorer limit, even if
the filesystem can allow up to 260.
Filesystems care about byte length, not character length, so treat
maxLength as the byte length limit and truncate accordingly.
This will also now remove entire emoji characters without corrupting
them.
If a file attached to an item with a URL wasn't found in the temp
directory, it would trigger an error that stopped the sync. (I'm not
sure how a file wouldn't exist.)
By changing to `mousemove` to start the tab title tooltip, the behavior matches
applications like Firefox more closely: you can always get the latest tooltip
back after changing state by nudging the mouse (without having to exit and
re-enter anything).
This hides tooltips (such as the tab title tooltip) whenever the tab bar state
changes, such as when adding or removing a tab, to ensure we don't leave any
tooltips behind that no longer match reality.
Fixes https://github.com/zotero/zotero/issues/2060
It's still possible to trigger a local import from a 1.18 database by
selecting the .sqlite file directly from the file option, but don't
offer it in the dialog.
E.g., if a sync is ongoing and there are multiple item saves that would
trigger auto-sync with the same options, only queue a single sync.
7ace5ea29e fixed the main cause of this, but in case some other
saves end up happening during a sync, this will prevent them from
triggering multiple sync loops with the same options.
An extra sync loop would be performed for every object downloaded, so a
download to an empty database could result in a huge number of
unnecessary loops. This was a regression from 52932b6eb, which started
queuing auto-syncs while a sync was in progress. The fix here is to skip
auto-sync for all objects saved from a sync download.
There are two new mechanisms involved:
- Event-level notifier options that get passed to passed to notify() at
the top level of extraData rather than being included with every
object (e.g., because `skipAutoSync` should apply to an entire save
transaction)
- The ability to pass event-level notifier options when initializing
a Zotero.Notifier.Queue, such as the one used for sync downloads
This hides the tab bar on Windows and Linux, where it currently takes up a lot
of vertical space below the menu bar. On macOS, the tab bar remains always shown
since we don't have the menu bar and can move tabs in the window there.
Fixes https://github.com/zotero/zotero/issues/2019