Commit graph

15319 commits

Author SHA1 Message Date
Abe Jellinek
93b677aaf4
Fix HiddenBrowser test failures (#5134)
Wait for 'complete', not 'interactive', so we know the image has been
loaded.

And use single documentIsReady() implementation instead of copy-pasting.
2025-03-20 23:32:02 -04:00
abaevbog
eb54cd82f6
citation dlg: refocus input on cmd/ctrl-f (#5136)
Fixes: #5100
2025-03-20 22:32:09 -04:00
Tom Najdek
9a58be243e
Improve layout of the buttons in the locate manager (#5139) 2025-03-20 17:22:07 -04:00
abaevbog
753032a001
citation dlg: highlight bubble when table focused (#5142)
In library mode, apply highlighting to bubbles that
correspond to selected items in itemTree only when
the items table is focused. When the focus leaves,
highlighting is removed from bubbles.

Fixes: #5138
2025-03-20 17:20:22 -04:00
Abe Jellinek
d79baf8251 Prevent stacked context pane from expanding over toolbar/titlebar
Regression in b649a1a953

Fixes #5135
2025-03-19 15:20:25 -04:00
Abe Jellinek
01db0bfe86 Fix occasional error when reader is closed immediately 2025-03-19 13:09:31 -04:00
Abe Jellinek
2a31c1977e Include item tree SCSS in preferences to restore tick icon
Fixes #5131
2025-03-19 10:09:33 -04:00
Dan Stillman
ab2880471e Add Troubleshooting Mode checkbox to "Restart with Logging Enabled…"
Add "Restart in Troubleshooting Mode" checkbox, checked by default, and
remove "Restart Later" option, since it's not possible to restart later
in Troubleshooting Mode. I doubt anyone used that, and if they really
need it, they can use -ZoteroDebug at the command line or toggle the
`debug.store` pref manually.

Closes #4580
2025-03-19 01:10:52 -04:00
Dan Stillman
35659b599e Indicate Troubleshooting Mode in error reports
And show plugins as disabled

Closes #4345
2025-03-19 00:19:54 -04:00
Dan Stillman
ebc670bb56 Update translators, styles, and CSL locales 2025-03-18 23:46:45 -04:00
windingwind
ccf4fd20cc
Fix plugin scope not loaded if plugin is disabled when starting Zotero (#5129) 2025-03-18 14:36:53 -04:00
Dan Stillman
d92ddd18b7 Fix WebDAV progress updates for Zotero.HTTP.download() 2025-03-18 14:10:24 -04:00
Tom Najdek
087df1f0c1 Restore attachment download progress spinner in item row (#5124) 2025-03-18 14:10:24 -04:00
Dan Stillman
80f9622c65 Change setItemDownloadPercentage() throttle from 100 ms to 25 ms
https://github.com/zotero/zotero/pull/5124#issuecomment-2731535371
2025-03-18 10:39:14 -04:00
Dan Stillman
c9f43bcdb8 Update locales from Transifex 2025-03-18 03:11:47 -04:00
Dan Stillman
91546e2e20 Remove hack for Issue search condition in French locale
https://forums.zotero.org/discussion/comment/473643/#Comment_473643
2025-03-18 02:24:01 -04:00
abaevbog
d780eed06f
citation dialog: restore arrowDown on bubbles opening details popup (#5123)
- restore earlier behavior of arrowDown on a bubble
opening itemDetails popup
- remove arrowUp closing the popup
- remove arrow navigation between rows of bubbles on arrowUp/down
- remove no longer needed edge case of arrowDown
handling on the last row of bubbles

Fixes: #5118
2025-03-17 23:27:27 -04:00
Tom Najdek
fef389290a
Fix unable to select a custom theme. Close #5070 (#5125)
This resolves an issue where, after the selected theme was deleted, it was impossible to select a newly added custom theme. This happened because the preference key for the selected theme uses consecutive IDs and wasn't cleared when the theme was deleted. As a result, the newly created theme would receive exactly the same ID. When the newly created theme was selected, the preference observer did not trigger (because the ID did not change), leading to this bug.

The fix here is to clear the theme preference when it is deleted. The added benefit is that when this happens in dark mode, the dark theme is auto-picked instead of falling back to "Original".
2025-03-17 21:07:10 -04:00
Dan Stillman
0d934c846f Fix file downloads timing out after 30 seconds
We switched file downloads to use XHR to fix downloads failing via
authenticated proxies in fx115+, but that made them subject to our
default 30-second timeout in `Zotero.HTTP.request()`. That timeout uses
the XHR `timeout` property, which applies to the whole request, even if
data is actively being downloaded. As a result, file downloads would
fail for people downloading large files or on very slow connections.

This implements manual connect and inactivity timeouts when using
`Zotero.HTTP.download()`. Currently, these both use `options.timeout`,
or the default 30 seconds, but we could probably take separate options
and have lower defaults now that they no longer apply to the whole
request.
2025-03-15 22:50:49 -04:00
abaevbog
99b4171500
citation dlg: persist screen position (#5122)
Do not explicitly move the window to the center of the screen.

Fixes: #5119
2025-03-14 23:04:31 -04:00
abaevbog
4915f1fadf
citation dialog: fix unhandled click on accept button of unfocused dialog (#5113)
Fix issue where clicking accept button would not work
when the dialog itself is unfocused. Add a small delay in the
focus handler of the dialog to allow accept button clicks
to be handled before rerunning the search.

Fixes: #5110
2025-03-14 07:49:57 -04:00
abaevbog
583fbf4e95
citation dialog: stricter non-sql item search (#5109)
While filtering selected/open/cited items, include
items that match EVERY word from the search string,
as opposed to items that match ANY of the searched words.

Fixes: #5099
2025-03-14 07:33:08 -04:00
abaevbog
a49e4e5449
citation dlg: only do not hide X when search runs (#5116)
Instead, when the search runs, replace just the accept
button with the spinner.

Fixes: #5115
2025-03-14 07:31:58 -04:00
abaevbog
bbf91d65f9
Citation dialog: move locator label lower (#5096)
So it aligns with inputs a bit better. Positioning
is tricky with native select elements but with a bit extra
margins, it looks better.

Fixes: #5091
2025-03-13 23:48:10 -04:00
Abe Jellinek
de0f5693e8
Make the info box ellipsis behave (#5103) 2025-03-13 23:47:40 -04:00
abaevbog
ebdeab4b3e
citation dialog: deduplicate open items (#5105)
So that if there are multiple tabs opened for the
same top level item, it appears only once in search
results.
2025-03-13 23:35:09 -04:00
abaevbog
92d6e69b6e
citation dlg: fix collectionTree rendering (#5114)
After switching from list mode to library mode if
the selected collection row is close to the bottom.

Fixes: #5104
2025-03-13 23:33:12 -04:00
Abe Jellinek
a98d172cd7 Restore icon to Find Full Text
Regression in 7020d60351
2025-03-13 15:39:50 -04:00
Abe Jellinek
bbfede2b55 Merge window: Fix error & blank context menu on right-click
Fixes #5077
2025-03-13 12:21:03 -04:00
Adomas Venčkauskas
bcb7e08f2f Fix citation dialog item tree refreshing on feed notifications
Closes #5107
2025-03-13 11:45:25 +02:00
abaevbog
ea71725e7f
citation dialog: Enter adds row when only 1 match (#5106)
In library mode when there are no selected/open/cited items,
Enter keypress from input will add the first row of itemTree
into the citation only if it is the only row.

Fixes: #5098
2025-03-12 21:25:41 -04:00
Tom Najdek
38188ff7d0
Fix huge buttons in banner on Linux 2025-03-12 13:45:00 +01:00
Tom Najdek
e9c0e47a17
Suggest running git lfs install in check_requirements instructions (#5102) 2025-03-12 06:54:05 -04:00
Northword
2d95cad479
Fix update checker _checker.stopCurrentCheck is not function (#5089) 2025-03-12 06:18:59 -04:00
Dan Stillman
de24306c90 Revert "Info box: Capitalize "Open Context Menu""
This is done on purpose. We distinguish between tooltips that are
command/feature titles and those that are action descriptions. So we
have "New Note" but "List all tabs". Apple does the same -- e.g., "Edit
Tags" and "Perform tasks with the selected items" next to each other in
Finder.

This reverts commit 011c5bd6c0.
2025-03-12 05:36:11 -04:00
abaevbog
cb53c6eb2e
citation dialog: fix IO race condition on load (#5097)
IOManager relies on everything being loaded, so it
should be initialized last. Otherwise, any IO handler
trying to access currentLayout would throw an error.

Also, swap the order of operations in bubble-input to
set input width only after the first input is added.
Otherwise, first input will have an arbitrary width
during initial load.

https://forums.zotero.org/discussion/122554/beta-new-insertion-bar-problem-with-citations-but-not-notes
2025-03-12 00:48:40 -04:00
Abe Jellinek
011c5bd6c0 Info box: Capitalize "Open Context Menu"
Like other button tooltips.
2025-03-11 16:36:43 -04:00
Dan Stillman
b78bf8e24b Citation dialog: Use "All Fields & Tags Mode" in Library Mode
Quick fix for #5090
2025-03-11 08:04:41 -04:00
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