Commit graph

15451 commits

Author SHA1 Message Date
abaevbog
6ff349d65d
Select child attachment after a file is drag-dropped onto a top-level item (#5328)
And also handle attachments added via context menu

Fixes: zotero#5320
2025-06-05 02:20:13 -04:00
windingwind
51a62022e9
Improve tabs menu keyboard handle (#5319)
Use space to close tab if the close button is active
Focus next close button after closing tab with keyboard
2025-06-05 02:11:53 -04:00
Dan Stillman
0b7340a651 Update reader submodule 2025-06-05 01:58:58 -04:00
Abe Jellinek
110d04f5f7 Add localization for Focus Mode string 2025-06-04 12:01:06 -04:00
Tom Najdek
ee35361608 Test for subsequent updates providing stale changed object data
From #5297
2025-05-31 02:20:32 -04:00
Dan Stillman
ded8dca668 Properly clear previousData on save for primary data and item fields
Closes #5297
2025-05-31 02:18:07 -04:00
Dan Stillman
05a2539b81 Don't corrupt DataObject#_relations while saving
The predicate name used as an object key was being converted to an id,
so if relations weren't reloaded properly, they would be broken after a
save.

Discovered while working on #5297
2025-05-31 02:16:05 -04:00
abaevbog
1f8e05bfd8
Fix new annotation changing the scroll position in itemTree (#5309)
Extend scrollToRow in windowed-list.js to allow to
scroll the specified row to the top of the window
even if it is located below the current scroll window.
With this, when scroll position is restored in itemTree,
the same row remains at the top.

Fixes: #5233
2025-05-30 01:31:11 -04:00
windingwind
cdcac8a6e1
Fix sidenav drop indicator position (#5304)
regression after #5263
2025-05-30 00:59:08 -04:00
Abe Jellinek
769b4c8c34
Fixes for tags-box regressions (#4951)
* Show "Remove All Tags..." when right-clicking textbox

* Fix pasting multiple tags adding concatenated tag

* Remove unnecessary check

* Fix tag count changing when unsaved tag is removed
2025-05-30 00:56:56 -04:00
windingwind
3b151a0b18
Fix inconsistent collapsed sidenav state (#5311)
fix: #5276
2025-05-30 00:51:10 -04:00
Adomas Venčkauskas
9d04392eb0 Add a read-only library param to /connector/getSelectedCollection
Part of zotero/zotero-connectors#546
2025-05-26 13:41:07 +03:00
Abe Jellinek
3ff13bc08d Info box: Fix second right-click opening section menu
On Windows, after right-clicking on a title field.

this.querySelector('popupset') matched the popupset in the
collapsible-section head, not our own.

Fixes #5294
2025-05-21 12:12:31 -04:00
abaevbog
46f80ebdfb
Citation Dialog: more optimization of initial loading (#5296)
* citation dialog: interactive before io.getFields

- added io.allCitedDataLoadedPromise, which is resolved
when both io.fieldIndexPromise and io.citationsByItemIDPromise
are resolved. Resolved io.allCitedDataLoadedPromise essentially
means that calls to io.sort() and io.getItems()
will be fast because all necessary data is already loaded.
- citation dialog uses io.allCitedDataLoadedPromise to
not await for functions relying on io.sort() and io.getItems()
before the data is loaded, as it could take an arbitrary
amoung of time. Speicifcally, SearchHandler._getCitedItems() and
CitationDataManager.sort. As soon as allCitedDataLoadedPromise
is resolved, cited items will be sorted.
This means that when retrieving fields takes a long time, one can
still add new items, their bubbles will just not immediately
be sorted.
- this replaces earlier SearchHandler.loadCitedItemsPromise, which
was a special case of this handling.
- added a new test ensuring that bubbles can be added even
when io.allCitedDataLoadedPromise is not resolved yet
- cleanup for buildCitation function to remove handling
of io.citation.sortedItems, which is always empty on
load before io.sort() runs
- added a few Zotero.debug statements for future debugging
- Uses a dummy promise if no allCitedDataLoadedPromise 
(e.g. to accomodate the note editor)
2025-05-21 09:55:41 +03:00
Bogdan Abaev
dfc31d9961 citation dlg: data structure refactor, bug fixes
- replace objects with zoteroItem, citationItem, etc.
as the main representation of an entry in the citation
(CitationDataManager.items) with instances of a new BubbleItem class.
BubbleItem has two static methods to create
a new instance: BubbleItem.fromCitationItem() used
to create entries from io.citation.citationItem on load,
and BubbleItem.fromItem used to create entries from
Zotero.Item when a new item is being added into the citation.
BubbleItem.getCitationItem will return a citationItem
in a format that citeproc consumes. This streamlines
the flow of data, makes it easier to manage and avoids
unnecessary conversions between citationItem and Zotero.Item.
- This refactoring fixes the issue of added suffix/prefix
sticking to an item and persisting even if the bubble
is removed and re-added. Fixes: #5282
- add csl data to virtual item in io.customGetItem
to remain consistent with Zotero.Integration.Citation.loadItemData.
That way, csl data is always found on Zotero.Item
and we don't have to check citationItems.

Also:
- apply deduplication to cited items, so that a cited
item from the library that appears in selected or
opened section does not have a duplicate entry in
the cited section.
- added initial test suite for citation dialog
2025-05-19 09:24:01 +03:00
windingwind
086b0c3d84
Allow plugin to uninstall itself in update manifest (#5292)
Use `uninstall: true` in `update_url` JSON `updates` that is valid
for the installed plugin to uninstall the plugin the next time it
checks for updates
2025-05-16 06:10:45 -04:00
windingwind
e18bf2165a
Fix locate button for annotation item (#5298) 2025-05-16 06:05:02 -04:00
Tom Najdek
b0506aafe1
Unhide "title" column on "Restore Column Order" (#5299)
This actually checks for a "primary" column, so if an extension hides the "title" column but provides its own "primary" column, the "title" column remains hidden.
2025-05-15 07:48:25 -04:00
Dan Stillman
2bc0c4861c Fix changed object data not being passed in notifier extraData
Which I apparently broke a decade ago in afe0412c5

And add support for 'deleted' and 'tags', which now use a different
mechanism
2025-05-12 23:36:58 -04:00
Tom Najdek
ed24cce4a1
Fix custom trash header persisting after items are restored or deleted. Fixes #5279.
This was due to a logic bug in `getCurrentPane()`, which returned the wrong pane, causing the incorrect one to be updated.
2025-05-12 17:28:11 +02:00
abaevbog
1eacc8bbdf
Citation dialog: updated Enter handling in panels (#5281)
Unhandled Enter keypress from inside of a panel will now close it.
Enter on "Omit Author" checkbox or on the inactive locator
label dropdown will close the item details popup.
Enter on "Keep sources sorted" checkbox of settings
popup will close it for consistency.

Fixes: #5277
2025-05-10 00:29:44 -04:00
Abe Jellinek
9ed3f6363c Add test for synchronous Zotero.done() call
No one should do this nowadays, but EM still does.

zotero/translate@c858ce9613
2025-05-09 14:42:06 -04:00
Abe Jellinek
420b84d17e Update translate submodule 2025-05-09 14:25:48 -04:00
Abe Jellinek
51649b0045 Update reader submodule 2025-05-09 10:38:54 -04:00
Abe Jellinek
e54665cf49 ReaderTab constructor: Assign _contextPaneOpen from correct option 2025-05-09 10:38:45 -04:00
Abe Jellinek
1b61be71b9 isPaneCollapsed(): Use correct check
We don't know if collapsibleParent is non-null, but we already know that
its previous sibling is the splitter if it is.
2025-05-09 10:36:26 -04:00
abaevbog
e625c0009e
Fixes to annotation row behavior in trash (#5266)
- right-click on annotation rows in trash will display
  "Delete Permanently" option, instead of an empty menu
- in trash and other non-editable collection rows, disable
  "Add Note from Annotations" button in itemPane header
- remove ability to add tags to annotations and other
  items by dragging them into tag selector from trash
- remove ability to add items to collections by
  dragging them into collection tree from trash
- fix attachment row being removed from trash if
  its child annotation row is erased

Also:
- fix contextPane in reader tab being editable for item in trash
- fix title being editable in attachmentBox for item in trash

Fixes: #5261
2025-05-09 02:05:53 -04:00
Dan Stillman
f539d7439d Fix test failure after #5263 2025-05-09 01:52:26 -04:00
Dan Stillman
c1cea87743 Disable advanced search test
Completely, not just in CI, since it's failing for me locally
2025-05-09 01:41:05 -04:00
Abe Jellinek
3102b6b67a
Always show item/context pane toggle (#5263) 2025-05-09 01:27:20 -04:00
Abe Jellinek
c42e144f56
Make XULElementBase into a mixin to reduce code duplication (#5270) 2025-05-09 01:00:43 -04:00
windingwind
0b339a3a30 Fix attachmentsBox#_handleAddPopupShowing
Fix rebase regression after 0b8b4c0
2025-05-08 22:38:42 +02:00
windingwind
32009ccdb6
Fix annotation item pane title word cutoff (#5271) 2025-05-08 16:36:38 -04:00
Abe Jellinek
143829065f SequoiaContextMenuChild: Remove unused field 2025-05-07 10:19:49 -04:00
Tom Najdek
6eafb89e82
Import Wizard: Fix focus loss on options page
Also resolves an issue preventing the wizard from continuing when pressing the Enter key on this screen.
2025-05-07 13:52:52 +02:00
abaevbog
971c57fedd
Disable itemTree row drop between child rows (#5258)
Fixes: #5257
2025-05-07 02:00:22 -04:00
Dan Stillman
f8a517d286 Force "Show Tabs Menu" menu item to update with shortcut key at startup 2025-05-07 01:52:54 -04:00
windingwind
61b62d0a02 Improve tabs menu (#4961) 2025-05-07 01:52:54 -04:00
Abe Jellinek
c6e5e6c1e6 Revert "Show item pane toggle everywhere"
Mistaken push.

This reverts commit 4b5bee37b1.
2025-05-06 12:15:19 -04:00
Abe Jellinek
4b5bee37b1 Show item pane toggle everywhere 2025-05-06 12:05:31 -04:00
Tom Najdek
55423024ea Revert "Tweak column behaviour on visibility and order changes" (#5254)
This reverts commit 997ba12626.
2025-05-05 23:39:53 -04:00
Tom Najdek
de0907c8f7 Fix issues with flexbox width calculations (#5254)
Issues caused by differing padding values between the header cell and the table body cell
2025-05-05 23:39:53 -04:00
Tom Najdek
af6e4cc44c Adjust column resizing logic to account for extra width in the first column (#5254)
Fixes #5198
2025-05-05 23:39:53 -04:00
abaevbog
54763ff722
improve performance of annotation rows removal (#5259)
Do not update itemTree selection on each annotation row
removal when an attachment row is collapsed.
It causes a significant delay when attachment with
many annotations is collapsed if selection is on any
row below the attachment. It is also redundant because
the selection is updated at the end of _closeContainer anyway.

Fixes: #5255
2025-05-05 23:23:59 -04:00
Tom Najdek
31845457a2
Fix creator type dropmarker color in dark mode 2025-05-04 15:51:28 +02:00
Abe Jellinek
03b33d995e Reorder _openTagsPopup() to clarify logic
And only remove the keydown listener when the top-level popup hides.
2025-05-03 01:38:18 -04:00
Abe Jellinek
68aff7b23e Hide leftover popups when switching tabs (#5251) 2025-05-03 01:38:18 -04:00
abaevbog
22996da722
open annotation in new window on Shift+Enter (#5253)
Per https://forums.zotero.org/discussion/123944/shift-enter-to-open-the-annotations-in-separate-windows-of-the-reader
2025-05-03 01:35:46 -04:00
abaevbog
929bacaac7
Fix unintentional title transfer between attachments on item switch (#5245)
Also added similar test for item details table

Fixes #5244
2025-05-03 01:34:06 -04:00
abaevbog
3fc8e4d02e
Fix leftover annotation rows and disappearing attachment rows after drag-drop (#5248)
- collapse all rows before removing them. It makes
  sure that annotation rows will be cleaned up properly
  when an attachment row is moved into another parent.
- refactor conditionals to handle changes of parent
  regardless of whether the item is a container
  (attachment with annotations) or not (a note).
- added tests for itemTree's handling of changing the
  parent of attachments and notes, as well as ensuring
  there are no leftover annotation rows in Unfiled Items.

Fixes: zotero#5246
2025-05-03 01:30:50 -04:00