wshanks / Zutilo

Zotero plugin providing some additional editing features
Other
1.49k stars 70 forks source link

Zutilo isn't working well in Zotero's latest beta version #203

Closed qqobb closed 3 years ago

qqobb commented 3 years ago

Zutilo isn't working properly in Zotero's latest beta, 5.0.97-beta.39+dea4a47b6. For example, all keyboard shortcuts seem to be broken. (Many context menu options seem to be working, though.) The previous beta version (5.0.97-beta.38+f27432347) and Zotero's stable release (5.0.96.3) aren't affected and can be used without these issues.

Users of the Zotero beta who are relying on Zutilo might want to disable Zotero updates until these problems are fixed. (Set the preferences app.update.auto and app.update.enabled to false in Zotero's Config Editor. Remember to change them back to true once the issues are resolved.) You might have to reinstall the previous beta build, 5.0.97-beta.38+f27432347.

Please see this discussion on the Zotero forums for more information: https://forums.zotero.org/discussion/91449/add-ons-broken-in-the-latest-beta-version-bbt-zutilo-etc

qqobb commented 3 years ago

@wshanks: Zotero's latest beta version is using a new HTML tree: https://github.com/zotero/zotero/pull/2029. This seems to have broken Zutilo's keyboard shortcuts. There're some Zutilo-related issues logged at startup: https://github.com/zotero/zotero/issues/2159#issuecomment-906143031.

qqobb commented 3 years ago

@dstillman: Thanks a lot for https://github.com/wshanks/Zutilo/pull/204! That seems to fix most of this issue.

I noticed two additional problems:

  1. The shortcuts focusZoteroCollectionsTree and focusZoteroItemsTree are broken:

https://github.com/wshanks/Zutilo/blob/7f1b2da6655070d631250a99dc13163cbaf3c31f/addon/chrome/content/zutilo/keys.js#L354-L363

I guess getElementById('zotero-collections-tree') and getElementById('zotero-items-tree') are obsolete now.

  1. If I set the shortcut
var label = `generateReport`;
var value = `{"modifiers":"alt","key":"R","keycode":null}`;
Zutilo.Prefs.set(`shortcut.` + label, value);

in the JS API and press Alt+R on an item with {"title":"ABC"}, Zotero jumps to another item with {"title":"RQS"} and shows the report for that item.

The same issue applies to the collection tree. If I set the shortcut

var label = `copyZoteroCollectionSelectLink`;
var value = `{"modifiers":"alt","key":"1","keycode":null}`;
Zutilo.Prefs.set(`shortcut.` + label, value);

in the JS API and press Alt+1 on a collection with {"collectionName":"ABC"}, Zotero jumps to another collection with {"collectionName":"123"} and copies the link of it.

This issue seems to generally affect shortcuts with {"modifiers":"alt"} and {"modifiers":"alt shift"}. It seems that shortcuts with {"modifiers":"control"}, {"modifiers":"control shift"}, {"modifiers":"alt control"} aren't affected. So you get the "search as you type" feature interfering the shortcut if the modifiers include Alt, but Ctrl prevents it. (BTW, in the items list, "search as you type" seems to apply to the Title column regardless of the sort column.)

dstillman commented 3 years ago

OK, I've added fixes for a few of the keyboard shortcuts. I'll let @adomasven look into the key navigation issue, but I would recommend releasing an update with the fixes so far.

qqobb commented 3 years ago

Thanks! I guess the other fixes would need to happen on the Zotero side. I noticed that the issue with interference from find-as-you-type is different on the collection tree; the issue is present there even with Ctrl in the modifiers. It's also not limited to Zutilo; e.g., Alt+T for the Tools menu does the same.

dstillman commented 3 years ago

Yes, key navigation in the HTML tree is currently implemented per-tree for collections and items, but it should apply to all trees, so hopefully this can be consolidated and fixed in one place.

dstillman commented 3 years ago

The key navigation bug should be fixed now in 5.0.97-beta.41.

qqobb commented 3 years ago

Yes, this issue seems to be fixed! Thanks!

jmwyf commented 2 years ago

@qqobb @dstillman zutilo shortcuts still can't use in 5.0.97-beta.57, how to fix it

wshanks commented 2 years ago

@jmwyf Could you give more specifics? I tried quickly and the shortcuts I tried worked for me.

jmwyf commented 2 years ago

@wshanks no response after I set shortcuts or response in a mess, my os is Mac big sur, zotero 5.0.97-beta.57, latest zutilo 3.10.0