Commit graph

16494 commits

Author SHA1 Message Date
Dan Stillman
3a34c6a18f Run a focused button's action on Enter in Advanced Search
The pane-level Enter handler ran the default action (save in the saved
editor, submit in the temporary pane) regardless of the event target, so
Enter with focus on the Cancel button saved and closed the editor, and
Enter on Clear ran the search. Click the focused button instead, which
the platform otherwise only does for Space.
2026-07-10 11:45:29 -04:00
Dan Stillman
a6c3ad51ef Keep a group's same-entity binding visible when it no longer qualifies
The "in the same annotation" binding menu was hidden as soon as a group
no longer had two conditions at the bound level, but the group's stored
binding was still saved and applied. After switching one of two bound
annotation conditions to another type, the group looked like a plain
"Match all of the following" group but still required a single
annotation to satisfy all of its conditions, and no control was left to
see or clear the binding.

Show the menu whenever the group is bound, drop the binding only once no
condition at its level remains, and refresh the menus before
collectGroup() in updateSearch() so the first save after such an edit
doesn't serialize stale state.
2026-07-10 11:45:28 -04:00
Dan Stillman
1e0cf49a16 Don't refresh the items list when clearing an unset advanced search
setAdvancedSearch() invalidated the row unconditionally, unlike
setSearch()/setTags(), so merely opening or closing the Advanced Search
pane (which applies a null filter) re-queried and rebuilt the items
list. A passed search is still always applied, since its conditions may
have been edited in place, and setFilter() still waits for a refresh
already in flight so that callers see the settled view.
2026-07-10 11:45:28 -04:00
Dan Stillman
cc28fad6da Roll a standalone attachment's annotations up to the attachment itself
_rollUpAnyToLevel() only followed an annotation's parent when the
attachment itself had a parent, so in a search for top-level items, a
tag on a standalone attachment's annotation matched nothing.
2026-07-10 11:45:28 -04:00
Dan Stillman
d95d8f294d Fix serialization of the result level seeded for a migrated childNote
The condition seeded by _loadConditions() used `mode: undefined`, but
toJSON() only omits the "/mode" suffix when the mode is exactly false
(what parseCondition() returns), so a saved search migrated from the
obsolete childNote condition serialized -- and synced -- the condition
as "resultLevel/undefined".
2026-07-10 11:45:28 -04:00
Dan Stillman
c43f028c96 Remove dead code left over from the Advanced Search dialog
onLibraryChange() has no callers since library changes re-render the
pane, and .active/doCommand() belonged to the removed dialog's search
box.
2026-07-10 11:45:28 -04:00
Dan Stillman
8daed576ba Make first top-level joinMode win in combineConditions()
_buildQuery() already uses the first top-level joinMode for the
full-text post-filter; with multiple top-level joinMode conditions (only
creatable via the API), combineConditions() used the last.
2026-07-10 11:45:28 -04:00
Dan Stillman
2c62010c4c Fix misplaced comma 2026-07-10 11:45:28 -04:00
Abe Jellinek
0a67f4967c Read Aloud: Update skip button tooltip text
#5998
2026-07-10 11:17:23 -04:00
Abe Jellinek
64165eabf6 ItemTree#selectItems(): Clear advanced search if item doesn't match
Some checks are pending
CI / Test (shard 4) (push) Waiting to run
CI / Utilities Tests (push) Waiting to run
CI / Test (shard 1) (push) Waiting to run
CI / Test (shard 2) (push) Waiting to run
CI / Test (shard 3) (push) Waiting to run
CI / Build, Upload (push) Waiting to run
Extends existing handling for tag selection and quicksearch to handle
advanced search as well.

Fixes #5996 (not just for zotero://select but for all selectItems()
callers)
2026-07-09 14:11:36 -04:00
Dan Stillman
243ef0e28f Fix historical comments from 606d8f19ba 2026-07-09 13:12:43 -04:00
Dan Stillman
606d8f19ba Advanced search: Indent subcollections in Collection condition menu
Instead of just prefixing the labels with "-", indent the whole row,
including the icon. This looks better and fixes FAYT on subcollection
names.

https://forums.zotero.org/discussion/132561/
2026-07-09 13:09:24 -04:00
Dan Stillman
03a610e696 Activate window in focus traversal tests, fixing intermittent timeouts
The #focus() Tab/Shift-Tab tests dispatch synthetic keydowns and wait on
a focusin event to sync with the collections search field's async
(setTimeout) focus. Gecko only fires focus/blur events while the window
is active, so when the pane window wasn't active -- it opens in the
background on macOS/Windows and can lose activation on Linux/CI -- the
focusin never fired and the test hung until Mocha's timeout. Activate
the window in beforeEach, as the item pane and tags box focus tests
already do.

Also removes the temporary open-window logging added in e1f19f34f5.
2026-07-09 11:00:24 -04:00
Dan Stillman
c3787495cc Don't show empty-library message for empty search with no groups
hasItems() also now short-circuits with LIMIT 1 rather than counting all rows

https://forums.zotero.org/discussion/132635/zotero-beta-empty-database-message-when-no-results
2026-07-09 10:38:43 -04:00
Dan Stillman
e1f19f34f5 CI TEMP: Debugging for shift-tab focus test timeouts 2026-07-09 10:32:53 -04:00
Dan Stillman
1c9bf88888 Unpack update archives for different architectures in parallel
Some checks are pending
CI / Test (shard 1) (push) Waiting to run
CI / Test (shard 2) (push) Waiting to run
CI / Test (shard 3) (push) Waiting to run
CI / Test (shard 4) (push) Waiting to run
CI / Utilities Tests (push) Waiting to run
CI / Build, Upload (push) Waiting to run
2026-07-08 12:10:46 -04:00
Dan Stillman
39a1c56f6c Cache update diffs and compressed files across builds
Cache patches and compressed files by content hash so that they're reused
across FROM versions and releases. Cache entries are touched when used and
expire after 60 days.

The cache key includes a tag covering the xz/mbsdiff versions and the
compression options, so entries are invalidated when the toolchain changes.
2026-07-08 12:10:45 -04:00
Dan Stillman
d07dd66c21 Parallelize update MAR generation
Run the per-file mbsdiff/xz work in make_incremental_update.sh and
make_full_update.sh through a parallel job pool, largest files first, and
assemble the manifests serially afterward, producing byte-identical MARs.

Set UPDATE_PACKAGING_JOBS to override the number of parallel jobs.
2026-07-08 12:10:45 -04:00
Dan Stillman
3ae3bd41dc itemPaneTest: Scroll to attachments pane instead of relying on pin
The pinned pane doesn't reliably trigger a render of an out-of-view pane in
this state, so scroll to the pane the way the surrounding tests do.
2026-07-08 10:50:32 -04:00
Dan Stillman
4314494455 Include callback source in waitForCallback timeout errors
The stack for these errors is stripped as internal frames, so the error
didn't indicate which wait timed out.
2026-07-08 10:50:32 -04:00
Dan Stillman
f9e711a9b2 itemPaneTest: Wait for window resize in attachments pane beforeEach
Tests that shrink the window to test visibility-based rendering restore the
height on their last line without waiting for it to apply, so the next test
could start rendering while the window was still 100px tall. The attachments
box's async render is skipped for panes outside the viewport and only retried
on scroll, so the pane never rendered and assertions on it failed or timed
out.
2026-07-08 10:50:32 -04:00
Dan Stillman
77a3cd82a9 itemPaneTest: Wait for attachments box render of the correct item
waitForPreviewBoxRender() without an item id returns immediately if the box
still holds the previous item's completed render, so on a slow machine the
row assertions could run before the new item's async render started.
2026-07-08 10:50:32 -04:00
Dan Stillman
49e284bab0 recognizeDocumentTest, translatorsTest: Initialize translators in before()
EPUB recognition translates the EPUB's RDF metadata, and
Zotero.Translators.save() requires translators to be loaded. The full test
run relied on an earlier test file having initialized translators.
2026-07-08 10:50:32 -04:00
Dan Stillman
7d33215a37 recognizeDocumentTest: Restore translate stub in afterEach after failure
Tests restore the stub at the end of the test body, so a failure left
Zotero.Translate.Search.prototype.translate wrapped and retries failed with
"Attempted to wrap translate which is already wrapped".
2026-07-08 10:50:32 -04:00
Dan Stillman
dfd745c5d5 Log test failures that will be retried
The reporter only showed the final failure, so if a retry failed differently
(e.g., from a stub left wrapped by the first failure), the original error was
lost.
2026-07-08 10:50:32 -04:00
Dan Stillman
1fe9cad5f8 citationDialogTest: Initialize styles in before()
Zotero.Cite.getLocatorString() requires Zotero.Styles.init() to have run.
The full test run relied on an earlier test file (bibliographyTest) having
initialized styles.
2026-07-08 10:50:32 -04:00
Dan Stillman
62a431f42b CI: Don't run duplicate jobs for same-repo pull requests
Pushes to branches in this repo already run CI, so run pull_request jobs only
for PRs from forks, which don't trigger push runs here. The push run's checks
still appear on the PR, since checks are attached to the head commit. (This
skips merge-commit testing for same-repo PRs -- the push run tests the branch
as-is.)
2026-07-08 10:50:32 -04:00
Dan Stillman
4c392c4764 CI: Run tests in 4 parallel shards
Each shard job builds and runs a quarter of the test files via runtests.sh -p.
The deployment ZIP upload and utilities tests move to separate jobs. With the
default fail-fast matrix behavior, a failure in one shard cancels the others.
2026-07-08 10:50:32 -04:00
Dan Stillman
bd25413213 runtests.sh: Add -p option to run a shard of the test files (e.g., -p 2/4)
The sorted file list is split into contiguous chunks of roughly equal total
file size, using size as a stand-in for run time, so new test files are
included automatically and slow test files are spread across shards rather
than landing in the same shard by chance. Contiguous chunks preserve the
alphabetical run order of a full run, so files keep the same preceding files
as in a full run except at chunk starts, and a shard can be reproduced locally
by passing its first and last files to -s and -e.
2026-07-08 10:50:32 -04:00
Dan Stillman
094d5cc2b6
Update staged builds in place for faster dev builds (#5994)
After a full build, dir_build saves a manifest of build/ files to
staging/.build-manifest. On subsequent runs, if all changed files are
ones that build.sh copies into omni.ja unmodified (chrome/, components/,
resource/, and test/ when tests are staged), zip just those files into
the staged omni.ja instead of rebuilding, taking rebuilds from ~15
seconds to ~0.3 seconds on an M1 Mac. Files are prescreened by size and
mtime so that only changed files need to be hashed. Zotero .ftl files
are also updated at their localization/<locale>/ paths, and test files
are also copied to the staged tests/ directory.

Any other change triggers an automatic full rebuild: files transformed
by build.sh (defaults/, chrome.manifest, version, translators/, styles/,
mozilla .ftl files, CSL locales), removed files, changes to build inputs
in app/ (detected via a size/mtime fingerprint, with xulrunner runtimes
covered by the hash-* files written by fetch_xulrunner), or requesting
tests or devtools that the staged build doesn't include.

Other changes:

- dir_build no longer takes -q and always skips omni.ja compression and
  optimization, which only matter for distribution builds made via
  build.sh. Use -f (dir_build or build_and_run) to force a full rebuild.
- build_and_run now always rebuilds. -r is deprecated, and -n skips the
  rebuild and just launches the app.
- build_and_run no longer passes -purgecaches. Startup caches are
  invalidated automatically when the BuildID changes, which now happens
  whenever omni.ja is modified (including via add_omni_file), so
  relaunching an unchanged build can use the startup cache.
- build_and_run and runtests.sh invoke js-build directly instead of via
  'npm run', which saves ~270ms of npm overhead per build.
- The Word integration dylib is now ad-hoc-signed by dir_build, and only
  on full rebuilds, since incremental updates don't invalidate the
  existing signature. This also covers test builds, which were never
  signed before.
- dir_build removes broken symlinks left in build/ when source files are
  deleted, which previously broke rsync in prepare_build.
2026-07-08 10:07:58 -04:00
Martynas Bagdonas
225e91c5e7 Tabs: Fix audio status validation
Validate the status argument instead of the unrelated title identifier, so invalid audio status updates fail with the intended error.
2026-07-08 14:52:31 +03:00
Martynas Bagdonas
2b7f46227f Reader: Reliably deactivate the docShells of hidden reader tabs
The reader now releases its rendered pages while its document is
hidden, which requires document.visibilityState to be truthful: it's
driven by docShellIsActive, which also controls event-loop throttling
for background tabs. The flag was maintained by scattered one-off
writes and went stale on the transitions they didn't cover: a tab
opened in the background ran at foreground priority (unthrottled rAF
and timers) with a 'visible' document until the next tab switch, and a
hidden tab kept an active docShell forever after its Read Aloud
playback was paused or stopped — in both cases keeping the reader from
ever releasing memory.

Replace the writes with a single _updateDocShellActivity() that
re-derives the state — active only while the tab is selected or
playing Read Aloud — called from the three places its inputs change:
tab creation, tab selection, and Read Aloud status changes.
2026-07-08 14:51:07 +03:00
Dan Stillman
55eceab3b3 Update English strings for Transifex
Some checks failed
CI / Build, Upload, Test (push) Has been cancelled
2026-07-05 11:23:51 -04:00
Dan Stillman
e2db3c7966 Citation dialog: Handle citation processor errors gracefully
Some checks failed
CI / Build, Upload, Test (push) Has been cancelled
If the preview fails, log the error and show "Preview unavailable"
instead of breaking the item-add flow with an unhandled rejection.

If io.sort() fails during accept, log and continue unsorted -- the
insert runs the same processor operation, so a real failure triggers the
document-update error dialog instead of a stuck progress window.
Skipping the sort doesn't affect the inserted citation, which the
processor sorts itself. It only determines the stored item order, and
with it the initial bubble order if the citation is edited later -- the
reopened dialog re-sorts once cited data has loaded.
2026-07-03 16:01:50 -04:00
Dan Stillman
cddf0ea237 Update citeproc.js to include Juris-M/citeproc-js#281
Fixes HTML appearing in citations after an error during citation preview

https://forums.zotero.org/discussion/132539/
2026-07-03 15:53:12 -04:00
Dan Stillman
057966000c Advanced search: Don't move focus to the results when running the search
Some checks are pending
CI / Build, Upload, Test (push) Waiting to run
Behavior regression in #5658

https://forums.zotero.org/discussion/132526/10-0-beta-8-number-of-results-in-the-new-advanced-search
2026-07-02 12:59:25 -04:00
Dan Stillman
e416ea2dfa Fix repeated save prompt after trashing the saved search being edited
Deleting a search in the collections pane moves it to the trash rather
than erasing it, so the check that closes the saved-search editor when
the edited search is deleted didn't catch it. The save-changes prompt
then appeared on the next selection change, and canceling couldn't
restore the removed row, so the prompt reappeared on every selection
until choosing Don't Save. Treat a trashed search like a deleted one
and close the editor without prompting.
2026-07-02 12:44:07 -04:00
Dan Stillman
2f364f2fab Allow creating a saved search with collections or searches selected
Previously a search could be saved only at a library root. Now the Save
Search button is enabled when collections and/or saved searches within
a single editable library are selected, and the selection is added to
the saved search as collection/savedSearch conditions -- an 'any' group
of them when more than one row is selected. If the search's own join
mode is 'any', its existing conditions move into an 'any' group of
their own so the scope conditions apply to every result instead of
joining the OR. A 'recursive' condition is included per the
recursiveCollections pref.

https://forums.zotero.org/discussion/132528/beta-cannot-create-a-saved-search-from-a-collection
2026-07-02 12:38:52 -04:00
Dan Stillman
a48336350a Remove .swp file committed by accident 2026-07-02 10:54:04 -04:00
Martynas Bagdonas
af704dc119 Update document-worker submodule and report SDT progress 2026-07-02 15:04:31 +03:00
Dan Stillman
26c30d8ecd Allow browsing an attachment's annotations in search results
With "Hide Non-Matching Annotations" enabled, an attachment displayed as
empty and non-expandable if no annotations matched the search, so
searching by any non-annotation condition made it impossible to expand
attachments to browse their annotations. Now only hide the non-matching
annotations when the attachment actually has a matching one.

https://forums.zotero.org/discussion/132519/beta-advanced-search-cannot-expand-annotations-of-search-results
2026-07-01 22:13:38 -04:00
Tom Najdek
95ee1c616c
Fix xulrunner_hash to read the hash from openssl output on LibreSSL/macOS
Some checks are pending
CI / Build, Upload, Test (push) Waiting to run
Previous command only worked with OpenSSL's labeled output where the hash is the second field; the update also handles LibreSSL (macOS), which prints just the bare hash.
2026-07-01 20:14:30 +02:00
Dan Stillman
40b272c46b Add -b (build-only) flag to beta_build_and_deploy 2026-06-30 17:44:49 -04:00
Dan Stillman
1d8cdb13c1 Update Windows build to Firefox 140.12.0esr 2026-06-30 16:41:38 -04:00
Dan Stillman
163c27ca79 Keep Advanced Search button visible when the item pane is wide
When the item pane is dragged wide, the items pane is squeezed and the
quick search wrapper kept its intrinsic width and overflowed, pushing the
trailing Advanced Search button out under the item pane. Let the wrapper
shrink so the button stays within the pane.

Fixes #5982
2026-06-30 15:57:06 -04:00
Dan Stillman
d28bdd8d6e Update Mac and Linux builds to Firefox 140.12.0esr
Some checks are pending
CI / Build, Upload, Test (push) Waiting to run
2026-06-30 15:09:55 -04:00
Abe Jellinek
279e25c57e
Preferences: Scroll first search result into view (#5976) 2026-06-30 14:21:30 -04:00
Dan Stillman
13bd8c9d8d
Group attachment and annotation conditions into Advanced Search submenus (#5981) 2026-06-30 14:20:47 -04:00
Tom Najdek
7f30b0e47d
Respect skipDateModifiedUpdate of the operation when undoing it, fix #5971 2026-06-30 18:23:23 +02:00
Abe Jellinek
f3328b02ee
Item/collection tree: Resize using ResizeObserver, not debounce (#5977) 2026-06-30 08:44:18 -04:00