dvanoni / notero

A Zotero plugin for syncing items and notes into Notion
https://download.notero.vanoni.dev
MIT License
2.39k stars 107 forks source link

Disruption of Drag-and-Drop Feature During Notero Sync #457

Closed nicolnt closed 2 months ago

nicolnt commented 9 months ago

Describe the issue During the syncing process of Notero, the drag-and-drop functionality in Zotero becomes blocked, disrupting my workflow. As I heavily rely on drag-and-drop to assign tags or move documents within collections, this interruption significantly hampers my efficiency.

To Reproduce Steps to reproduce the behaviour:

  1. Add a tag by drag-and-drop or move document in a collection where Notero sync is enabled
  2. Wait for Notero to stop syncing
  3. Repeat step 1.
  4. Step wait for the repeat of step 2. to finish
  5. Again, for all the files you need to move or tags you need to add.

Expected behavior Non-blocking dragging of file when Notero is syncing

Screenshots image The screenshot shows Notero's small pop-up in the bottom-right corner of the Zotero window. During its display, drag-and-drop operations are inhibited, causing inconvenience.

Additional context

dvanoni commented 9 months ago

Thanks for reporting this, @nicolnt. I'm able to reproduce the behavior on macOS 14.2.1 in both Zotero 6.0.30 and Zotero 7.0.0-beta.56.

It's quite noticeable while trying to perform drag-and-drop operations, and I've also noticed that most UI interactions seem to be negatively impacted while a sync is in progress.

Upon some initial exploration, it looks like the UI impact occurs while Notero is performing operations to update Zotero items after each is saved to Notion. I imagine this is because these operations are happening on the main thread that's also used for UI updates.

I'll dig into this and see if I can come up with a fix.

dvanoni commented 9 months ago

I'm discussing this with other Zotero developers on the mailing list. I don't have a solution yet, but I've at least narrowed down the cause to the code that generates item citations.

While absolutely not ideal, a way to work around the issue is by removing anything related to citations. Specifically, this means you'd have to:

dvanoni commented 2 months ago

@nicolnt, I think I've hopefully fixed (or at least improved) this in version 0.6.2.

The issue is indeed caused by the generation of citations, and it seems to be an issue that Zotero also suffers from when using its Quick Copy functionality—see this Zotero forum post.

It turns out that some citation styles cause more of a performance impact than others, and the APA style seems to be especially bad. Unfortunately, Notero used the APA style to generate author-date page titles, but that's no longer the case in v0.6.2.

There will still be a performance impact if using the Full Citation and In-Text Citation properties in combination with certain Quick Copy formats, but since the problem exists in Zotero itself, I don't know that I can easily fix it.

Please let me know if you're still having performance issues!