Commit graph

11963 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
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
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
420b84d17e Update translate submodule 2025-05-09 14:25:48 -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
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
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
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
Dan Stillman
a7964f7116 Fix duplicate attachment row after retrieving metadata
https://forums.zotero.org/discussion/123939/double-pdf-file-after-doing-a-retrieve-metadata-operation-on-a-standalone-pdf-file

Regression from 48fd23ccec
2025-05-01 02:48:42 -04:00
Adomas Venčkauskas
d9b9046201 Fix Google Docs allowing to select note style (endnotes)
Report: https://forums.zotero.org/discussion/123928/zotero-citations-not-appearing-as-endnotes-despite-selected-setting
2025-04-30 16:47:25 +03:00
Abe Jellinek
230e3d8065
Skip invalid relative path when changing LABD (#5239) 2025-04-30 01:06:40 -04:00
abaevbog
4521f750a4
ItemTree annotations: miscellaneous fixes (#5232)
- disable context menu on collapsible-sections of annotations in `itemPane`
- fix `arrowRight`/`arrowLeft` being able to expand/collapse annotation sections when they are focused
- set proper aria-label and aria-description on annotation cards
- fix misaligned annotation icons

Fixes: #5231
Fixes: #5234
Fixes: #5240
2025-04-30 00:54:45 -04:00
windingwind
bd9735baf3
Fix v-table selector dataKey escape (#5238)
Regression after 0b8b4c0
Fix https://forums.zotero.org/discussion/123877
DataKey from custom columns may include unexpected chars
2025-04-29 09:32:33 -04:00
Abe Jellinek
54006b7c8c
Make hidden readers inactive, firing visibilitychange (#5225) 2025-04-28 04:16:16 -04:00
abaevbog
48fd23ccec
annotations showing in itemTree (#3416)
- Annotations are displayed in itemTree under their file attachments
  on a third level. The annotation spans the entire row.
- The title is constructed on the go. When possible, it
  includes annotation quote and comment as pseudo-columns
  of the row. The comment occupies about twice as much space as
  the quote. Otherwise, (if there is no quote) only the annotation
  comment
  is included as the "title" part of the row
- Non-CJK segments of the quote part of the annotation row are
  italicized. CJK segments are left as is. If CJK segments are present,
  there is more padding between quote and comment parts.
- Search matches the actual attachment instead of its parent file.
- Can create child notes from annotations of the same item or
  standalone notes from annotations across different items from
  the context menu or the header button.
- When an annotation (or multiple annotations) are selected, the
  annotationItemPane component is displayed where annotations are
  grouped by their top-level item. Annotations are displayed fully,
  without having their content cut off.
- Special treatment for annotations to always prompt
  to erase the item regardless of what collectionTree row
  is selected (e.g., if a collection is selected, we
  still want one to be able to delete the annotation).
  This only applies if all selected items are annotations.
  If multiple items are selected, some annotations and
  some not, do nothing. This is until the trash is
  ready. In the future, we may send annotations to trash
- strip all HTML tags from annotation for now, until the logic to
  properly render annotation markup is copied over from the reader
  (applies to both annotation-row component and the annotation
  item rendered in the itemTree)
- Added a generalized "expandToItem" function to itemTree to
  expand all ancestors of a given item, similar to "expandToCollection"
  from collectionTree
- add annotation conditions to advanced search
- show [Image not available] if no annotation file for ink or image
  annotations
- only keep annotation-specific context menu options when some
  annotations are selected in itemTree
- enable Quick Copy of annotations from itemTree via drag-drop,
  shortcut key, or Edit → Copy Annotation
- Minor refactoring of Zotero.Annotation.toJSON() to pull out async code
  that handles ink and image annotations, so that
  Zotero.Annotation.toJSONsync() for highlight, underline, and note
  annotations does not have to be awaited. Since ink and image
  annotation don't seem to work for drag-drop Quick Copy, they are just
  skipped for now.
2025-04-28 04:10:28 -04:00
Abe Jellinek
d74db17cf1
Select Items dialog: Fix scrollbars and padding, add title (#5213) 2025-04-22 23:37:38 -04:00