Thanks for the input, everyone!
Upon further investigation, I've narrowed down the cause of the UI blocking to calls to `Zotero.QuickCopy.getContentFromItems`. For each item, I call this function up to two times (depending on the user's configuration)—once to generate an item citation and again to generate a bibliography entry. Each call to the function causes a noticeable interaction delay.
Unrelated to my plugin, I now realize this is the same cause of the delay I experience when dragging an item in Zotero. Interestingly, I only notice the delay if the selected Quick Copy Format is a "citation style." If I instead choose an "export format," the interaction delay goes away. (See example in this
screen recording.) Looking at the Quick Copy code, I imagine this is related to export formats
using a callback whereas citation styles appear to run synchronously.
Based on what I've heard from y'all, this sounds like something I wouldn't be able to directly offload to a worker since it requires the Zotero object. I'm not very familiar with the citation system. Is there any way I can more efficiently obtain citations and bibliography entries for items? Can I somehow use the CSL engine from a worker?
Any suggestions are greatly appreciated!