Commit graph

16087 commits

Author SHA1 Message Date
Adomas Venčkauskas
003bdab3ff Auto-recover ALL-CAPS macOS corrupted word field codes.
Closes zotero/zotero-word-for-mac-integration#38
2026-02-26 16:22:28 +02:00
Tom Najdek
f0d3347b26
Fix tag splitting for strings containing Unicode characters. Fix #5807 2026-02-25 11:30:55 +01:00
Dan Stillman
f21e1b2d32 Add platform-native file change watcher for storage sync
Use platform-native file change APIs to track which stored-file
attachments have been modified, avoiding expensive full scans of all
attachment files during sync.

Backends:
- macOS: FSEvents (persistent event journal, survives restarts)
- Windows: ReadDirectoryChangesW (live recursive directory watch
  via overlapped I/O polling)
- Linux: inotify (live per-directory watches)

On unsupported platforms or on error, falls back to existing scan logic.
2026-02-24 14:15:15 -05:00
Dan Stillman
2739b29709 Avoid excessive /file requests during file sync
Don't mark attachments for download when server has no file (mtime is
null), and clear TO_DOWNLOAD state on 404 responses in both ZFS and
WebDAV so items aren't re-checked on every subsequent sync.
2026-02-22 23:45:55 -05:00
Adomas Venčkauskas
3386490a03 Fix browser toolbox switching windows breaking script debugging 2026-02-20 12:11:25 +02:00
Dan Stillman
2aaf0c213f DataObject: Set type-derived properties on prototype instead of per-instance
Move _ObjectType, _objectTypePlural, _ObjectTypePlural, and
_ObjectsClass from per-instance properties to prototype properties,
computed once per subclass on first instantiation. This avoids a huge
number of duplicate string allocations and reduce memory usage a bit
(e.g., ~35 MB in a 19K-item test library).
2026-02-17 12:09:59 -05:00
Dan Stillman
0d16d81a3c Share a single cached CSL.Engine instance across output formats
setOutputFormat() just sets this.opt.mode and this.fun.decorate, so
there shouldn't be a need to cache separate engines per format. The
format is excluded from the cache key, and setOutputFormat() is called
on cache hit instead.

Also simplify _preloadFormat() in quickCopy.js to only create one
engine instead of two (one per format).

Saves ~7 MB of resident memory (~140 MB before the citeproc-js
sort-macro caching optimization).
2026-02-17 12:09:59 -05:00
Dan Stillman
fe74fce120 citeproc-js: Cache sort-mode macro expansions to reduce memory usage
Previously, macros referenced by sort keys were expanded inline into
the sort token array every time they were encountered. Non-sort macros
were already cached in state.macros[name] and referenced via closures,
but sort-mode macros were duplicated across sort keys.

With a complex style like chicago-shortened-notes-bibliography (155
macros, 6 macro-based sort keys), this produced 179,605 tokens and
355,652 closures in bibliography_sort alone -- 99.9% of all tokens.

This commit caches sort-mode macro expansions in state.sort_macros[name]
using the same closure-reference approach as non-sort macros.

In addition to the memory savings, avoiding the redundant macro
expansion makes engine initialization dramatically faster with complex
styles.

Results with chicago-shortened-notes-bibliography:
- Engine initialization: 464 ms -> 57 ms (8x faster)
- Per-engine heap (Node.js): 123 MB -> 6.7 MB (94.6% reduction)
- Resident per engine (Firefox): ~140 MB -> ~7 MB
- Total tokens: 187,893 -> 11,669 (93.8% reduction)
- Total closures: 370,982 -> 21,823 (94.1% reduction)
- All 1,502 citeproc-js tests pass (at f88a47e6)
- Same 1501/1505 pass on master (same 4 pre-existing failures)
2026-02-17 12:09:59 -05:00
Dan Stillman
7fe4e50c4c HTTP.request(): Don't try to output responseText if not text response 2026-02-14 16:10:30 -05:00
Dan Stillman
c9ab1ec62c WebDAV: Compute fresh Digest auth headers for each request
The previous approach of capturing and replaying the Authorization header
from an initial request worked for Basic auth but broke with Digest auth,
where the header includes the HTTP method and URI in the hash. This caused
each replayed request to be rejected with a 401, which Firefox wouldn't
retry because the request already included Authorization.

Instead, split _channelAuthorization into _basicAuthHeader and
_digestParams. For Basic auth, the header is still replayed as-is. For
Digest, the challenge parameters (realm, nonce, qop, etc.) are cached
and a fresh Authorization header is computed per request.

_getAuthorizationHeaders() now takes method and URI parameters so it can
compute the correct Digest response hash for each request.
2026-02-14 16:10:30 -05:00
Abe Jellinek
ae397ca37c Fix item type becoming 'undefined' when menu is dismissed with Escape
By adding a missing getter override. If a setter is overridden, the
corresponding getter also needs to be overridden, or it will implicitly
return undefined.

Fixes #5793
2026-02-10 14:34:00 -05:00
Dan Stillman
c377c4c7ec CLAUDE.md: Additional test guidance 2026-02-09 22:38:33 -05:00
Dan Stillman
427fb1d4d9 Update version 2026-02-09 22:38:33 -05:00
windingwind
94dbdd5981
Skip plugin strict_max_version check on non-stable releases (#5781)
Unless `extensions.strictCompatibility` is set to true

resolve: #5775
2026-02-09 22:30:09 -05:00
Dan Stillman
fcd887a89d Fix cross-suite ZoteroPane test failures
Failed when running CollectionTree and ZoteroPane tests together

- Make `deleteSelectedItems()` async and await `deleteSelection()` so
  the full Notifier commit chain (including items list refresh)
  completes before the function resolves. Update tests to call
  `deleteSelectedItems()` directly instead of calling fire-and-forget
  keyboard events, and add a stubbed test for the Delete key binding.

- Fix "Delete Item…" menu test to explicitly re-select after `saveTx()`
  to guarantee selection state
2026-02-09 22:18:50 -05:00
abaevbog
9640875fcf
Space on an option of menulist dropdown will select it (#5783)
Fixes: #5779
2026-02-09 16:43:23 -05:00
Dan Stillman
c35d7f21e9 Upload build-{os}.json manifests to deployment server
Needed by zotero/client-downloads@4b2060361, which reads build
metadata from these files instead of hardcoding it.
2026-02-09 15:24:07 -05:00
Dan Stillman
8a1bdacf7d Fix WebDAV verification failure on OPTIONS/PROPFIND auth type mismatch
`checkServer()` was capturing the Authorization header from OPTIONS and
explicitly setting it on PROPFIND via `setRequestHeader()`. If the auth
type didn't match what the server required for PROPFIND (e.g., Basic vs.
Digest, though maybe other things too), the explicit header could
prevent Firefox from negotiating the correct auth scheme on the 401
challenge.

To fix, move `onAuthorizationHeader()` from OPTIONS to PROPFIND and
don't pass captured auth to PROPFIND, letting Firefox handle the auth
transparently.

https://forums.zotero.org/discussion/129665/webdav-error-for-zotero-8-0-3
2026-02-09 14:21:58 -05:00
Dan Stillman
5cb83c69c6 Fix incorrect bold text in file-renaming banner 2026-02-09 14:21:58 -05:00
Yago Iglesias
fe3021701e
Use grep -E instead of egrep (#5789) 2026-02-09 09:54:19 -05:00
Dan Stillman
06794ce278 Update note-editor submodule 2026-02-06 15:57:43 -05:00
Dan Stillman
fa30baf523 Add CLAUDE.md with project guidance for Claude Code
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 15:54:09 -05:00
Dan Stillman
c7014b97c7 Update locales from Transifex 2026-02-06 15:47:31 -05:00
Dan Stillman
752b0f7008 Convert preferences_sync.xhtml from spaces to tabs 2026-02-06 15:15:30 -05:00
Dan Stillman
d966eee6a7 Update English strings for Transifex 2026-02-06 00:55:29 -05:00
Dan Stillman
2f7055e15d Update CSL locales 2026-02-06 00:51:33 -05:00
abaevbog
bd8d56e384
Preference to hide context annotation rows (#5315)
hideContextAnnotationRows pref, accessible via View > Hide Non-Matching Annotations,
will hide non-matching context annotation rows.
Enabled by default.

Fixes zotero#5264
2026-02-06 00:51:01 -05:00
Tom Najdek
bbb39719f0
Tweak hover color for banner buttons (#5776) 2026-02-04 12:10:24 +01:00
Dan Stillman
eecdd66098 Use PROPFIND instead of OPTIONS to cache WebDAV credentials
Some WebDAV servers allow unauthenticated OPTIONS requests, so the
Authorization header capturing added in 089701eca8 wouldn't work.

PROPFIND with Depth: 0 reliably requires authentication while only
returning properties of the directory itself.

https://forums.zotero.org/discussion/comment/506993/#Comment_506993
2026-02-03 23:42:45 -05:00
Abe Jellinek
5e82c888b6 Scaffold: Fix repeated reload prompts 2026-02-03 16:14:25 -05:00
Tom Najdek
0f565ecfef
Replace × close links with buttons in banners (#5735) 2026-02-03 15:51:24 -05:00
abaevbog
7b0f5d8f32
update menulist keyboard nav and appearance (#5773)
- on all platforms, Space will open the menulist popup
- on Windows, ArrowUp/ArrowDown will change selection without triggering command event.
This is needed to avoid alerts that are meant to fire after a confirmed
selection when the user is just trying to navigate the menu (e.g. item type menu)
- on Windows, fix odd appearance of checked menulist options in advanced search
condition dropdowns when "More" option is selected
- on Linux, fix menulist focus ring not appearing in Advanced Search
or Preferences (https://forums.zotero.org/discussion/129498/advanced-search-drop-down-menus-are-not-highlighted-during-keyboard-navigation)

Fixes: #5772
2026-02-03 15:22:30 -05:00
Dan Stillman
2f064a5604 Rename deployment scripts 2026-02-03 14:34:37 -05:00
Tom Najdek
818ce564bb
Improve RTF scan. Add test coverage. (#5672) 2026-02-02 15:03:57 -05:00
Dan Stillman
331a83d2e8 Update reader submodule 2026-02-02 11:13:03 -05:00
Dan Stillman
56cd4713f1 Clear cached WebDAV credentials if we get a 401 2026-02-01 16:42:55 -05:00
Dan Stillman
089701eca8 Fix WebDAV authentication handling in fx140
Firefox no longer seems to send a previously used Authorization header
with subsequent requests. This results in extra requests, since every
WebDAV request triggers a 401, and also results in errors, because a PUT
is sent without Authorization, causing some WebDAV servers to
immediately send a 401 and close the connection, which the HTTP layer
interprets as a connection failure (status 0). (It's also not good to
try to send a large file just to get a 401.)

There might be some way to share context between requests, but instead,
just get the used Authorization header and include that explicitly in
future requests.

To test this properly, we have to switch to using httpd.js for all
WebDAV requests, since the mocked XHR doesn't trigger the 401 retry.

https://forums.zotero.org/discussion/129194/webdav-uploads-fail-on-zotero-8-put-sent-without-authorization-server-closes-connection
2026-02-01 16:42:55 -05:00
Dan Stillman
e7d1772470 Don't show Authorization header value in HTTP.request() debug mode 2026-02-01 16:42:55 -05:00
windingwind
1347023b39
Fix note context tabNotesDeck.selectedPanel null error (#5771)
fix: #5770
2026-02-01 11:06:10 -05:00
Dan Stillman
62894d56e5 Update version 2026-01-29 15:35:21 -05:00
Dan Stillman
a0758e016a Update locales from Transifex 2026-01-29 15:35:21 -05:00
Dan Stillman
0c97b6f74c Include collections in trash when generating item JSON
Any modification to an item belonging to collections in the trash would
cause those collections to be removed from the item when the item was
uploaded.

Fixes #5766
2026-01-29 15:14:02 -05:00
Dan Stillman
f3c0e4fdc2 Fix error resetting group library with unsynced embedded images
https://forums.zotero.org/discussion/129373/zotero-7-8-warning-when-syncing-group-library
2026-01-29 13:22:14 -05:00
Dan Stillman
2c2b6fe171 Update package-lock.json 2026-01-29 13:22:13 -05:00
abaevbog
22f62138a3
Fix quicksearch not finding annotations of standalone attachments (#5756)
Fix search not finding annotations of standalone attachments
when searching within a scope.

Fixes: #5751
2026-01-28 13:30:36 -05:00
windingwind
1969bde82c
Fix attachment preview discard logic (#5757)
Use keepAlive() to prevent deferred discard when the preview moves out of view but later enters the view again before the discard timeout.
2026-01-28 11:28:06 -05:00
Abe Jellinek
db9598f01e Update reader submodule 2026-01-28 10:28:23 -05:00
Abe Jellinek
c31386dc3e Update reader submodule 2026-01-28 10:01:15 -05:00
windingwind
aef4beee89 Fix note editor iframe docShell undefined error
Regression after 37ce3c0
2026-01-28 10:49:55 +01:00
Abe Jellinek
4880674668 Remove DOI when creating bookSection from book
And book from bookSection.

Closes #5732
2026-01-27 16:20:14 -05:00