Commit graph

14518 commits

Author SHA1 Message Date
Abe Jellinek
657d5c4c42 Fix skip() error on CI
Apparently you can't call skip() directly from a describe() block.
2024-07-10 14:03:06 -04:00
Dan Stillman
0b3eda5d82 Update styles and translators 2024-07-10 02:16:43 -04:00
Dan Stillman
d90f655513 Update locales from Transifex 2024-07-10 02:15:35 -04:00
Dan Stillman
5d67514705 Update reader submodule 2024-07-10 01:51:56 -04:00
Abe Jellinek
9ea56705a0 Don't change title when renaming from parent metadata (#4363) 2024-07-10 01:51:39 -04:00
Abe Jellinek
327206f931 Rename subsequent attachments after their file base names (#4363) 2024-07-10 01:51:33 -04:00
Abe Jellinek
13496afeb3
Use SelectedItemText color on SelectedItem backgrounds (#4350) 2024-07-10 01:20:47 -04:00
Bogdan Abaev
2f1aa19ae5 tweaks for tests to pass after React 18 upgrade (#4338)
- Wait for the itemsView to be initialized in the onload listener of the
  Advanced Search window
- moved waitForTagSelector in a few tests to avoid it resolving too
  early. For some tests these tweaks are always required, for others -
  tests would pass half the time. Again, not clear why it's necessary,
  potentially some flakiness from react 18?
2024-07-10 01:04:33 -04:00
Bogdan Abaev
fd93af8305 ReactDOM.unmountComponentAtNode => root.unmount() (#4338)
unmountComponentAtNode is deprecated, so save or
pass the root as a prop and call root.unmount when
the component is destroyed
2024-07-10 01:04:31 -04:00
Bogdan Abaev
37991e220e use Icons.getCSSIcon instead of getDOMElement (#4338)
- getDOMElement relied on React.renderToStaticMarkup,
which is react 18 was moved to a different file than the
one exposed with react-dom-server. To not add another
file just for that one function, replace getDOMElement
with getCSSIcon.
- getDOMElement was mainly used for a few remaining
png icons that were not replaced with svg. For those
few icons, just record which background-url should be
set when the module loads and add it in getCSSIcon if
applicable. Alternatively, background-image setting
could be moved into a stylesheet?
- a few hardcoded twisty svgs in icons.jsx are not used anywhere
(they would be fetched via IconTwisty), so those are
removed
2024-07-10 01:04:28 -04:00
Bogdan Abaev
af4bbd2c4d ReactDOM.render -> React.createRoot().render (#4338)
- await for promise that is resolved in ref attribute
of root.render() as an alternative for removed callback
from ReactDOM.render
- await-ing for promise every time when ref needs to be
used after render (e.g. tag selector container), otherwise
ref will be undefined
- additional window.sizeToContent calls to properly size
dialogs with react-rendered content (e.g. create parent),
otherwise the window can cut off some of the content.
2024-07-10 01:04:24 -04:00
Bogdan Abaev
4e0c89b352 react 18.3.1 updated dependency (#4338) 2024-07-10 01:04:17 -04:00
Abe Jellinek
6eea3704a9 Zotero.ItemFields.isAutocompleteField: Cache, use Set 2024-07-10 00:48:53 -04:00
Abe Jellinek
a334d9fdd8 Item box: Use startsWith, not includes, for field name checks 2024-07-10 00:48:53 -04:00
Abe Jellinek
c05d43fa8e Item box: Enable autocomplete on long fields 2024-07-10 00:48:53 -04:00
Abe Jellinek
38764efb5a editable-text: Allow autocomplete with wrapping 2024-07-10 00:48:53 -04:00
Abe Jellinek
3e6cc03e2e Add autocomplete-textarea CE
Exactly the same as the Mozilla autocomplete-input CE, with a different
base class. Seems to work perfectly fine.
2024-07-10 00:48:53 -04:00
Abe Jellinek
0f5fc2962a RTL: Reverse collapsible-section animation 2024-07-10 00:43:59 -04:00
Abe Jellinek
ddfe376900 RTL: Flip attachment preview arrows 2024-07-10 00:43:59 -04:00
Abe Jellinek
043c6e1795 RTL: Use direction-aware arrow key handling 2024-07-10 00:43:59 -04:00
Abe Jellinek
ea2d4417e1 RTL: Add direction-aware arrow key utilities
We need these all over the place.
2024-07-10 00:43:59 -04:00
abaevbog
b0fa4415ee
fix focusring not appearing on linux (#4365)
-moz-accent-color variable doesn't seem to exist on linux.
Use --color-accent as the focus border, same as what is
already done in the reader.

Fixes: #4340
2024-07-10 00:41:13 -04:00
abaevbog
32b92c0205
Cache tabs' icons in data field (#4367)
So that after reload, we can display the correct icon sooner

Fixes: #4342
2024-07-10 00:31:54 -04:00
Abe Jellinek
8cb93b35a4 Tests: Fix -noquit flag
Fixes #4359
2024-07-09 12:07:32 -04:00
Dan Stillman
b899fc9d46 Update reader submodule 2024-07-09 04:54:22 -04:00
Dan Stillman
287ab3296d Update English strings for Transifex 2024-07-09 04:49:10 -04:00
Dan Stillman
5c08e07bf5 Don't expect return value from renameSelectedAttachmentsFromParents()
Removed in da1599ca34, because it was inconsistent and not actually
meaningful
2024-07-09 04:47:56 -04:00
Dan Stillman
da1599ca34 Show popup for Rename File from Parent Metadata
Closes #3230
2024-07-09 04:44:36 -04:00
Abe Jellinek
af1a4941ce
Set automatic title on first child attachment of each type (#4237) 2024-07-09 04:11:39 -04:00
windingwind
e4f75c36e1
Fix scaffold window UI (#4339)
fix: #4258
2024-07-09 04:02:52 -04:00
Abe Jellinek
f79a59f56a
Move various item pane strings to Fluent (#4329)
And:

- Accept Fluent l10nId/l10nArgs in ItemMessagePane#render()
- Reuse existing <description> tag to eliminate l10n flickering
2024-07-09 04:00:19 -04:00
windingwind
006c6e890a
Fix window control in RTL (#4348)
fix: #4332
2024-07-09 03:56:19 -04:00
abaevbog
2d3375e9f6
Revised logic of trashed collections in item cache (#4358)
- revert change from 2401a34031
that only loads un-trashed collections in _loadCollections.
If an item only belongs to deleted collections, item._loaded.collections = true
from _loadCollections will never run, so an exception
will be thrown in item.toJSON() when syncing happens.
Instead, to address the problem of item.getCollections()
having stale data #4307, add 'includeTrashed' parameter to
item.getCollections() based on which item._collections
will be filtered. Fixes: #4346
- revert earlier, no more necessary, changes from a532cfb475
to not alter item._collections cache when collections are being trashed or restored.
Collection is removed from item._collections only when it is permanently
erased.
- removed unnecessary test checking for consistent item._collections
value before and after reload, since item._collections is no longer
modified
- fix encountered bug where a trashed child collection is not
unloaded if a parent collection is erased without being trashed first.
- tweaked Zotero.Search sql construction to count items
that only belong to trashed collections into 'unfiled'. Fixes: #4347

---------

Co-authored-by: Dan Stillman
2024-07-09 03:34:12 -04:00
Abe Jellinek
58c445b616 Preferences: Extract #prefs-search queries 2024-07-08 16:40:26 -04:00
Abe Jellinek
c2b51c7dfe Preferences: Separate load and show, fix navigation race condition
Now we give the caller control over whether the pane should still be
shown after it loads. We're fine with showing in all cases when handling
a search, but we don't want to show when handling a navigation select
if the user already selected something else while the pane was still
loading.

Fixes #4357
2024-07-08 16:38:58 -04:00
Abe Jellinek
a80c4c46bd Make OpenURL resolver base URL field LTR in all locales
Fixes #4354
2024-07-08 16:10:52 -04:00
Abe Jellinek
5444e4ec4d RTL: Flip sidenav Locate icon
Fixes #4353
2024-07-08 15:44:59 -04:00
windingwind
d2f5d1f47b Fix item pane do not update after closing/reopening
fix: #4344
Fix eslint error in itemPane.js
2024-07-08 19:20:31 +08:00
Dan Stillman
4f780424e8 Update locales from Transifex and merge new English strings 2024-07-08 00:26:50 -04:00
Dan Stillman
72dd5128fb Update English strings for Transifex 2024-07-08 00:26:39 -04:00
windingwind
19d4c8e038 Fix RTL: Wrong direction of PDF page preview next/forward buttons
fix: #4333
2024-07-08 09:34:09 +08:00
Tom Najdek
2b5e116717
Fix RTF Scan never marks citations as unmapped (#4328) 2024-07-06 06:31:33 -04:00
Tom Najdek
21203501a9 Don't fade right edge of a tab if text doesn't overflow. Fix #4330 2024-07-06 06:18:31 -04:00
Tom Najdek
73bc0cbb94 Optimization: Reduce number of renders in tab bar
By extracting Tab into a separate, memoized component, caching handlers
and tweaking how icons and other props are passed, we're able to only
re-render tabs that actually changed, rather than re-rendering the
entire tab bar all the time. This should be especially noticeable when
dragging tabs around but will reduce CPU cycles used in general.
2024-07-06 06:18:31 -04:00
Dan Stillman
d9790b707a Fix style list breakage if style name contains HTML special characters
https://forums.zotero.org/discussion/115761/z7-beta-document-settings-do-not-show-full-list-of-styles
2024-07-06 04:13:53 -04:00
Martynas Bagdonas
eeece86b4e Add missing access keys for View and Go menus 2024-07-05 09:01:15 +03:00
Martynas Bagdonas
8622ef6fe6 Update reader and pdf-worker submodules 2024-07-05 08:34:20 +03:00
Martynas Bagdonas
95b27f6f85 Fix double menu separator in reader window View menu 2024-07-05 08:31:53 +03:00
abaevbog
2401a34031
Fix updating of deleted collections in Libraries & Collections (#4324)
- listen to 'collection' notifier events and re-render
the section if a relevant collection is moved to trash or
modified. That way, a deleted collection will be removed,
a restored collection will be added back, and renaming a
collection will update the name.
- fixed a bug where a restored collection would not
be added into item._collections cache. Fixed false-positive
test for it.
- do not add deleted collections into items. _collections cache in
Zotero.Items._loadCollections. Otherwise, deleted collections will
appear in librariesCollectionsBox after the app is restarted.
2024-07-04 22:07:37 -04:00
Dan Stillman
680a175a32 Fix "-" button in Manage Lookup Engines
Which has maybe always been disabled/broken?

(Though it's possible you should only be able to disable custom engines,
not bundled ones)
2024-07-04 05:29:39 -04:00