zotero-connectors icon indicating copy to clipboard operation
zotero-connectors copied to clipboard

Default translation collection

Open stefanct opened this issue 5 years ago • 5 comments

Since a while it is possible to select the target collection to be used as destination of newly imported items within the connector (in FF at least).

However, this selection is not permanent: it changes to the last selected collection whenever another one is selected in the application itself. In my workflow I always categorize the items after import (the metadata always needs a cleanup before I want to do that). Thus I want new items always to go into a "todo" subcollection.

This is currently impossible AFAICT: updateFromClient is called from the "progressWindow.show" message listener (src/common/inject/progressWindow_inject.js:448) to get the current selection via Zotero.Connector.callMethod("getSelectedCollection", {}) (there are other calls to that method but AFAICT they are not relevant... I have no idea what I am talking about so... ;)

It would be nice to have a setting that overrides this selection (and keep everything else as it was, i.e. it would still be nice to be able to use the menu to override this - now constant - pre-selection). I would be fine with a hidden setting that specifies the ID of the subcollection (i.e., I am fine w/o a GUI to change it - well, if there is a way to determine the ID somehow... even if I have to look into the sqlite db :). I have not tried to find out how the connector could find the other information (e.g., the name) that "getSelectedCollection" returns.

I am not a JS dev at all so I would rather not implement it myself. In any case, what are your comments on this?

stefanct avatar Feb 06 '20 17:02 stefanct

This would be easy enough to do on a technical level — we could store a collection key in the connector prefs and pre-select it in the target selector — but I think we'd only do it if we could expose it in some way that didn't require getting keys out of the database manually. I don't have a great idea for that.

I think this is the first request we've gotten for this, though. A somewhat more common (and much more straightforward to implement) request is to assign a tag — e.g., "new" or "to review" — to new items, which would allow you to assign a collection at save time and then easily filter for unreviewed items in your library root at your leisure. I think I'd be inclined to implement a default tag (which could be prefilled in the target selector) over a default collection.

dstillman avatar Feb 06 '20 18:02 dstillman

I could see this being useful and not entirely difficult to implement, especially without UI. Although it might make more sense to do it in zotero/zotero in server_connector.js. There are various ways to implement a UI solution:

  1. Context menu option in the Zotero client
  2. A collection tree that allows you to select the default target in the Connector prefs
  3. A checkbox within the progress window in the Connector

I cannot see us prioritizing this heavily but we could definitely take a PR for at least a hidden pref in zotero/zotero if you want to give that a shot.

adomasven avatar Feb 06 '20 18:02 adomasven

@dstillman a default tag is very orthogonal to what I would call a solution to my problem :) Yes, I would be able to find all misplaced entries but it is still something I have (to remember) to do. It might be useful to others though - I like the idea.

From a UI POV I think suggestion (3) of @adomasven makes most sense since it is very visible but not annoying and comparatively easy to implement I guess? 1) is quite intrusive for something that is probably accessed only a few times per installation. 2) sounds like a lot of work(?)

@adomasven BTW that link is broken (the text is OK though)

stefanct avatar Feb 06 '20 18:02 stefanct

Well, it's only orthogonal if you define the problem a certain way: specifically, not wanting to have to think about a collection at the time of saving. That's fair, but you linked that to needing to clean up items after import, which seems unrelated, and something a default tag would certainly help with. If you put that part aside, it's not clear to me that there's a huge difference between choosing a collection at save time vs. choosing a collection later (though I understand that it's your preferred workflow).

Worth noting that recent targets you saved to are available in the drop-down menu, so you don't actually have to expand the target selector to choose a collection if it's somewhere you saved to recently. So you can do a "todo" collection now with just one occasional extra click.

Along with being much more straightforward to implement, one benefit of a default tag is that it couldn't fail, since it'd just be a string that was set, unlike having to pick a collection that may not continue to exist (requiring fallback to the library root).

In any case, if we did do a default collection, I definitely don't want to add a checkbox to the progress window or a context-menu option in Zotero. This isn't a common request, so I don't think it merits prime UI space. However we implement this, it should go in the preferences somewhere. So if we did this, I think it would have to be (2).

dstillman avatar Feb 06 '20 19:02 dstillman

I very much support this ticket. I came here to ask for this.

I just want my new items to go to the top-level collection, really. The current behavior (1) ends up adding new items to random collections (assuming the Zotero app and Firefox are being used in parallel for different purposes; this happens to me all the time), and (2) straight out fails when the active collection is a smart collection.

Cheers, Nicolas

nicolasrochette avatar Sep 26 '20 01:09 nicolasrochette