Commit graph

15281 commits

Author SHA1 Message Date
Abe Jellinek
9cdfadbbae
Fix space before ellipsis in editable-text (#5087) 2025-03-10 22:47:38 -04:00
Dan Stillman
764dd1a9da Take object instead of id in Utilities.Internal.showInLibrary()
Not updating quickFormat.js, since we'll be removing that
2025-03-10 22:40:43 -04:00
Bogdan Abaev
6d52656a92 integration.ftl file for "integration-*" strings
And a few minor .ftl string edits
2025-03-10 22:40:43 -04:00
Bogdan Abaev
4a00304925 Redesigned citation dialog (#4872)
Implemented redesigned citation dialog with library
and list modes one can switch between. This dialog is
a direct replacement of quickFormat and classic citation
dialogs.

In Library Mode:
- items table has a new + button column to add items from the
citation and rows of selected items are highlighted
- open, cited and selected items appear in a section
between the items table and bubbleInput. When there are no
matches, a message is shown.
- only top-level items are shown when citing
items and only notes/notes' parents - when adding a note
- selected items are gathered in a collapsible deck to save space.
Click on the deck will expand it. All selected items can be
added via "Add all" button.
- when an item is added, bubble-input may increase in height and
push itemTree lower. To try to preserve relative positioning
of the mouse, itemTree will scroll to be over the row that was just clicked

In List mode:
- arrow up/down from the input will change the selected item
with the focus remaining in the input
- selected items are a collapsible list section

Other behaviors and fixes:
- one can add any locator (not just pages) by typing its full or short name
in an input and pressing Enter (e.g. line 10, or l. 10, or chap. "test chapter")
- Added a new preference to select if the citation dialog
should always open in list mode, library mode or in the last
mode that was used
- bubbles whose items are selected in library or list mode
are highlighted
- arrow up/down from a bubble will focus the bubble
above/below it for easier navigation across bubble-input
- multi-select is supported on items in list mode or item cards in
library mode via Shift-arrow or Cmd+click to select multiple items
- Cmd/Ctrl + Enter will always accept the dialog no matter what
is focused
- when there are no bubbles, accept button is disabled
- after an item is added, bubble-input is always refocused
- added suppressed property to itemTreeMenubar to be able to
hide if in list mode, where it is not relevant. Fixed menubar
getting stuck or re-appearing on Alt keypress on Linux by setting
height: 0 vs hiding it via hidden.
- added initialFolder and onActivate prop to collectionTree to set which collection
should be reopened when dialog opens and to be able to set a custom
onActivate handler.
- added getExtraField prop to itemTree to get data on if
an item is in a citation or not

Implementation details:
- citationDialog.js is the main file. It relies on a number of
helper files in citationDialog/* directory to keep the main
file less cluttered. popupHandler.js contains the logic of
opening/closing the item details popup to add locator/prefix/suffix/etc.
keyboardHandler.js is responsible for overall keyboard navigation
throughout the dialog. searchHandler.js contains the logic
for running the search based on user's query. Finally, Helpers.js
has general helper functions that don't handle any actual logic.
- SearchHandler is set to run search in two ways: for cited/selected/open
items (which are cached and do not involve any actual SQL query) and
general search for items across all libraries. When layout.search
runs, firstly cited/selected/open items are updated after which the
SQL search runs.
- bubbleInput.js is a customElement responsible for bubbles interface.
bubbleInput.refresh takes a list of items and handles adding/removing/reordering
of bubbles as needed. It always has two inputs on each side of
a bubble, as opposed to having inputs inserted dynamically. It
allows keyboardHandler.js to handle navigation with arrows within
bubbleInput.
- when user interacts with bubbleInput, it emits custom events that are
handled by IOManager singleton in citationDialog.js, which
may update the items information and pass them back to bubbleInput.refresh
to have the list of bubbles updated
- CitationDataManager singleton is responsible for storing
items added into the citation in CitationDataManager.items
in an object with both Zotero.Item and the actual citation item.
It is easier to pass both items to other components
and helpers, as opposed to sharing functions to convert
items back and forth.
2025-03-10 22:40:43 -04:00
Bogdan Abaev
27f1103d88 Use regularOnly in "Change Parent Item" selectItemsDialog 2025-03-10 22:40:43 -04:00
Dan Stillman
cbd6ccbec3 Don't enable Citation Explorer for Google Docs for now 2025-03-10 22:40:43 -04:00
Adomas Venčkauskas
a3654652b2 Adds a Citation Explorer dialog for document integration (#3468) 2025-03-10 22:40:43 -04:00
Dan Stillman
8ddb6bfd17 Remove code to modify Zotero.DB properties via transaction options
No idea why this was ever here, but I don't think it's actually used
(and if it is, it shouldn't be). The only options I see are handled
directly within `executeTransaction()` itself.
2025-03-10 04:26:16 -04:00
Dan Stillman
e532e435f4 Fix very slow purging of itemDataValues at startup in large databases
When an item is erased (removed from the trash or cleaned up from a
feed), we set a flag to purge values in `itemDataValues` on the next
startup, with this query:

DELETE FROM itemDataValues WHERE valueID NOT IN (SELECT valueID FROM itemData);

For some people, that query was incredibly slow and would result in
Zotero intermittently hanging on "Loading items…" for a long time at
startup. It's possible this is mostly limited to people who subscribe to
high-volume feeds and have a lot of item churn. One affected person had
>900K values in `itemDataValues` despite having only 20K items.

It turns out the slow query is due to the foreign-key constraint on
`itemData(valueID)` that references`itemDataValues(valueID)`. SQLite is
checking every row being deleted from `itemDataValues` against
`itemData`, even though the query is specifically removing rows that
don't exist in `itemData`! For the 900K-value DB, disabling foreign-key
checks causes the `DELETE` query to take 25 seconds instead of...some
much longer time that I didn't wait for.

We already had an `executeTransaction()` flag, `disableForeignKeys`, to
temporarily disable foreign-key checks, but it didn't do so in a way
that was safe for post-initialization usage -- a write query outside of
a transaction could've run between the transaction commit and
foreign-key checks being re-enabled. This commit changes it to properly
block all other queries unless they include an `ignoreDBLock` option,
meaning that queries within the function passed to the transaction need
to include that option. (And since that's not realistic for the couple
other uses of `disableForeignKeys` -- one for a test and one in code
that almost certainly hasn't been run by anyone in 15 years -- those now
just run `PRAGMA foreign_keys=OFF|ON` explicitly, leaving this as the
only current use.)
2025-03-10 04:26:16 -04:00
Dan Stillman
659d5e864b build_and_run: Fix handling of ZOTERO_PROFILE containing spaces 2025-03-09 16:16:47 -04:00
Abe Jellinek
ac0813e0f5
Restore window controls on Windows/Linux (#5083) 2025-03-07 16:24:46 -05:00
PChemGuy
8a06edab49
Sort strings naturally or alphabetically (#5075)
Hidden setting. If true, use natural collection sorting matching the current behavior. If false, use conventional alphabetic sorting.
2025-03-07 02:08:11 -05:00
Abe Jellinek
679de040ec Add tests for renderItemTitle() 2025-03-06 11:00:33 -05:00
Abe Jellinek
8082516bf6 renderItemTitle(): Create <span> when inverting style
Creating an <i> with a style attribute that *removes* italics is just
too confusing.
2025-03-06 11:00:32 -05:00
Abe Jellinek
c9c9c500bf renderItemTitle(): Fix nested tag handling when rendering to string
Need to exit the loop regardless of whether we're rendering actual
nodes.

Fixes #5082
2025-03-06 10:20:13 -05:00
Dan Stillman
d931319b12 Prevent DNS/TCP connections in snapshots 2025-03-06 01:46:38 -05:00
Dan Stillman
d7ce4191b1 Remove chai-as-promised submodule
We've included this in package.json for many years, so this shouldn't be
here.
2025-03-05 22:59:49 -05:00
abaevbog
d0bf8f8993
always trim editableText from itemBox on blur (#5081)
So that whitespaces are removed even if the itemBox
does not refresh.

Fixes: #5080
2025-03-05 18:03:03 -05:00
Dan Stillman
05f3ea3b82 Update reader submodule 2025-03-05 07:30:21 -05:00
Dan Stillman
8021ca0a0b Fix /connector/saveSnapshot test for Zotero.HTTP.download() 2025-03-05 07:18:12 -05:00
Tom Najdek
6add721e68
Convert customThemes from a pref to a synced setting (#5071) 2025-03-05 06:43:52 -05:00
Dan Stillman
a464fe0408 Update "Find Full Text" tests for Zotero.HTTP.download()
Downloads are now included in request() call counts
2025-03-05 06:34:25 -05:00
abaevbog
d3cee95fb7
Click on itemBox label focus edits (#5065)
Click on a label of a focused field will refocus itemTree
or the reader content, depending on the tab. That way
focus is not lost.

Fixes: #5063
2025-03-05 05:59:11 -05:00
Dan Stillman
c262a5b392 Add Cr as glboal in eslint config 2025-03-05 05:51:04 -05:00
Dan Stillman
3a26ce3bb1 Avoid args is undefined logged error in file sync tests 2025-03-05 05:50:58 -05:00
Dan Stillman
1f401f0897 Replace Zotero.Utilities.Internal.saveURI() with Zotero.HTTP.download()
Adds a new function, Zotero.HTTP.download(), that uses
Zotero.HTTP.request(). This fixes downloads via authenticated proxies in
Zotero 7 and gives us other request() functionality (e.g., 5xx retrying)
for free.

The downside is that this is probably less efficient, potentially
loading large downloads in memory. We should create a replacement for
request() based on fetch() that supports getting the body as a
ReadableStream.

Fixes #5062
2025-03-05 04:46:51 -05:00
windingwind
ccc1800f21
Fix attachment preview background (#5067)
regression from 9c41874
2025-03-04 09:45:22 -05:00
Abe Jellinek
cab8e38806
Remove deleted actors to prevent console spam (#5074) 2025-03-04 09:45:08 -05:00
Abe Jellinek
5c8859b618 RemoteTranslate: Fix request methods not sending cookies 2025-02-28 15:22:37 -05:00
Abe Jellinek
c19f43ea46 Scaffold: Suppress ESLint JSON.parse() syntax errors 2025-02-28 15:16:26 -05:00
Abe Jellinek
1e08985dcd Scaffold: Accept shorthand URLs in URL box
Like "google.com" instead of "https://www.google.com/".
2025-02-28 15:16:12 -05:00
Dan Stillman
307753d313 "Select add-on to install" → "Select plugin to install"
https://forums.zotero.org/discussion/122235/title-in-the-plugin-selection-windows-dialog-add-on-plugin
2025-02-27 23:30:45 -05:00
windingwind
1b64e3417c
Fix web-ext support (#5068) 2025-02-27 22:28:42 -05:00
Abe Jellinek
6f8da4825e Advanced Search: Remove red background from condition tooltips
Fixes #5066
2025-02-26 16:41:07 -05:00
Abe Jellinek
ba7b521bb1 Scaffold: Clean up load() slightly 2025-02-26 12:09:06 -05:00
Abe Jellinek
ddb5977c48 Scaffold: Remove 2028/2029 fix
Hasn't been an issue since ES2019.
2025-02-26 11:27:02 -05:00
Martynas Bagdonas
9077310669 Update pdf-worker submodule 2025-02-26 18:10:58 +02:00
Abe Jellinek
3c8d50dd47 Remove loadBrowserWindow() test support function (#5050)
A browser window was no longer actually needed for charset detection
(on macOS, at least, and hopefully elsewhere) because we switched to a
HiddenFrame-based hidden browser. Remaining uses now call
`loadZoteroWindow()`.
2025-02-26 03:00:04 -05:00
Abe Jellinek
26221b6786 Fix broken browser window on print + remove many Mozilla files (#5050) 2025-02-26 03:00:04 -05:00
Abe Jellinek
90a9c5164a
macOS: Unescape dragged path when NSURL doesn't (#5059) 2025-02-25 05:28:12 -05:00
abaevbog
c049120efb
do not try to select deleted item in a collection (#5061)
After navigating to the collection from "Libraries and Collections"
section of an item in the trash. Deleted item does not appear in actual
collections and trying to select it will just re-select the trash.

Fixes: #5060
2025-02-25 05:24:59 -05:00
Martynas Bagdonas
a3ebb4ad41 Update reader submodule 2025-02-25 11:24:33 +02:00
Abe Jellinek
854f2188c2 Duplicates: Fix hidden elements remaining visible
And update comment.

Fixes #5056
2025-02-24 11:18:48 -05:00
abaevbog
54346b0ca7
fix broken QF cancellation from editor instance (#5054)
Define missing cancel method on io object passed from the
editor instance to quickFormat dialog. Without this
Escape keypresses throws an error because io.cancel is
undefined.

Followup to #4859
2025-02-21 22:13:41 +02:00
Martynas Bagdonas
96e71762f9 Normalize decomposed chars in PDF text, Zotero notes for proper indexing
Fixes #5051
2025-02-21 14:55:20 +02:00
Abe Jellinek
d3871d6864 editable-text: Forward onTextEntered() from input
Fixes #5043
2025-02-20 14:40:58 -05:00
Dan Stillman
45310397e5 Update Word for Mac submodule 2025-02-20 06:28:27 -05:00
Adomas Ven
2e9b9d4070
Close citation dialog if user interacts with the integration plugin (#4859)
Asks the user if they want to discard the changes in their existing dialog if
they have made changes.

If there is no citation dialog, but a command is running (like updating the document)
an alert is displayed.

Closes #4855
2025-02-18 05:52:23 -05:00
Abe Jellinek
eb30c23a0d
Scaffold: Infer types of parameters based on naming conventions (#5038) 2025-02-18 05:07:51 -05:00
Adomas Venčkauskas
239b68e6b8 Update Word for Windows submodule 2025-02-18 11:43:51 +02:00