PubPeerFoundation / pubpeer_zotero_plugin

Plugin to show if references in Zotero have PubPeer comments
138 stars 2 forks source link

Show PP link (and comment count?) near article in the zotero #1

Closed brandonStell closed 4 years ago

brandonStell commented 5 years ago

Maybe as a new column?

image

retorquere commented 4 years ago

Link is not currently possible in the item list, as a cell in the list can only display either:

Adding even such a column is non-trivial because Zotero has a lot of hard-coded things in place that check that only Zotero data is displayed there, so I have to monkey-patch all those places to allow for the extra column to exist, and for Zotero not to go haywire when it has existed but the plugin that created it is uninstalled. This is all supposed to become easier as Zotero moves from XUL to React in preparation of the later move to Electron (https://groups.google.com/d/msg/zotero-dev/fu0LpM6AOdE/4O0dIHWdCAAJ) but I don't know how far off that is, and how long PubPeer is willing to wait for it to emerge.

memo to self should we go with Zotero as it is now:

brandonStell commented 4 years ago

Perhaps the new PubPeer column could contain the date of the most recent comment (in a color that catches the eye)? Something like: "Last PubPeer comment on [Date]"

retorquere commented 4 years ago

No colors. Either plain text, or single image.

retorquere commented 4 years ago

I'd recommend against too wide a column. The column title could say "last pubpeer comment" and the column value could be the date (if any)

brandonStell commented 4 years ago

I think an image would probably catch the eye the best.

brandonStell commented 4 years ago

pp-logo-horizontal-main-lightbg

borisbarbour commented 4 years ago

A column is a good idea. I think an image would be better: takes up less space and would be more eyecatching. If the image needs to be squarish, then just the graphic part of the logo. If it can be rectangular then maybe the graphic part + "PUBPEER" (as part of the image).

Can the tab of the tab be coloured when there are comments? Or highlighted in some other way, e.g. bold text? Typically people won't have the PubPeer tab focused and it would be nice if it could indicate the presence of content.

The aim here is to allow the reader to notice that PubPeer comments exist for a paper without having to check for them specifically.

retorquere commented 4 years ago

So the column would then just be a static image when pubpeer comments are present, and empty otherwise?

I'll look at styling the tab, I think it should be possible but I haven't tried before.

brandonStell commented 4 years ago

So the column would then just be a static image when pubpeer comments are present, and empty otherwise?

Yes.

retorquere commented 4 years ago

It looks like I can actually add an image plus a text, in the same way the title column has a type icon and a text. The space for the icon isn't really large though. I wonder if the logo will be legible. If one of you is any good with photo editing software (I'm not) it'd be good to have the logo pasted over such a type icon, just to see if the results might look OK. Getting stuff into the midle in there is pretty invasive (Zotero really is not built to do it and a fair bit of monkey patching is required to make it work safely), so before I embark on this, an idea of what it would look like would be good.

brandonStell commented 4 years ago

I'll try to mock it up with the PubPeer icon tomorrow. However, maybe even if the icon ended up to be just a plain green (or red?) square it would catch the eye?

brandonStell commented 4 years ago

Also we have these available, which might work. https://pubpeer.com/favicon-16x16.png https://pubpeer.com/favicon-32x32.png https://pubpeer.com/favicon-96x96.png

retorquere commented 4 years ago

I think it'd look better on a white background, but those would work. Zotero itself uses 32 x 32, 48 x 48 and 16 x 16 images.

brandonStell commented 4 years ago

agreed.

pp-logo-48x48 pp-logo-32x32 pp-logo-16x16

brandonStell commented 4 years ago

the zotero type icon in the title bar is 32x32 ?

borisbarbour commented 4 years ago

Ha. I was just going to say I thought the solid background would give more contrast and that the colour would be distinctive. But, as you suggest, let's see what it would look like squeezed into the column before any final decision. It might well be unrecognisable.

On Fri, Nov 15, 2019 at 11:45 PM Brandon Stell notifications@github.com wrote:

agreed.

[image: pp-logo-48x48] https://user-images.githubusercontent.com/11091919/68980836-f2388000-0801-11ea-9991-905fa14fcd2a.png [image: pp-logo-32x32] https://user-images.githubusercontent.com/11091919/68980837-f2d11680-0801-11ea-9d55-83c429ea7825.png [image: pp-logo-16x16] https://user-images.githubusercontent.com/11091919/68980838-f2d11680-0801-11ea-89ca-eb5e93d5d26a.png

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/PubPeerFoundation/pubpeer_zotero_plugin/issues/1?email_source=notifications&email_token=ABCZPNU7JEV3TO6FW6QYY5DQT4Q73A5CNFSM4HYZWKS2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEEG6G3Q#issuecomment-554558318, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABCZPNTY2EAUITJAXA7ANMDQT4Q73ANCNFSM4HYZWKSQ .

--

Boris Barbour The PubPeer Foundation

Article 5. No one shall be subjected to torture or to cruel, inhuman or degrading treatment or punishment.

brandonStell commented 4 years ago

pp-logo-48x48

brandonStell commented 4 years ago

pp-logo-lines-dark-background-48x48 pp-logo-lines-dark-background-32x32 pp-logo-lines-dark-background-16x16

brandonStell commented 4 years ago

one_possibility

retorquere commented 4 years ago

memo to self:

brandonStell commented 4 years ago

:robot: this is your friendly neighborhood build bot announcing test build 0.0.3.8 ("have text")

Install in Zotero by downloading test build 0.0.3.8, opening the Zotero "Tools" menu, selecting "Add-ons", open the gear menu in the top right, and select "Install Add-on From File...".

retorquere commented 4 years ago

It looks like it's still either an image or a text. Zotero does something magic with the title column to make the icon show up there, and I haven't been able to find out what. It doesn't help that adding a column in the middle list is really not supposed to be possible.

borisbarbour commented 4 years ago

Go with the image?

On Sun, Nov 24, 2019 at 7:01 PM Emiliano Heyns notifications@github.com wrote:

It looks like it's still either an image or a text. Zotero does something magic with the title column to make the icon show up there, and I haven't been able to find out what. It doesn't help that adding a column in the middle list is really not supposed to be possible.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/PubPeerFoundation/pubpeer_zotero_plugin/issues/1?email_source=notifications&email_token=ABCZPNTJ62M7GCRX2E4HWXDQVK6QTA5CNFSM4HYZWKS2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFARCQA#issuecomment-557912384, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABCZPNV7LDE2CM4MPWHGU63QVK6QTANCNFSM4HYZWKSQ .

--

Boris Barbour The PubPeer Foundation

Article 5. No one shall be subjected to torture or to cruel, inhuman or degrading treatment or punishment.

retorquere commented 4 years ago

I'm not yet sure I can get an image in there. To get the text in I only had to patch getCellText, but patching getImageSrc doesn't do anything. I'm still digging through the Zotero source to see how images get there at all.

brandonStell commented 4 years ago

I vote for the image also.

brandonStell commented 4 years ago

:robot: this is your friendly neighborhood build bot announcing test build 0.0.3.9 ("images")

Install in Zotero by downloading test build 0.0.3.9, opening the Zotero "Tools" menu, selecting "Add-ons", open the gear menu in the top right, and select "Install Add-on From File...".

retorquere commented 4 years ago

OK, give .9 a whirl

brandonStell commented 4 years ago

Wow, that looks really good. Nice job!

I see you were able to get some text in there: I'd love if the icon could be a link to the PubPeer page.

retorquere commented 4 years ago

Those cells can only contain plain text, alas. I can apply CSS (the image is a put there by CSS), but CSS can't add links.

borisbarbour commented 4 years ago

I like it! The icon is visible (even to me with four eyes and a small laptop screen) and looks good. Once you click on the publication row, that brings up the tabs - maybe in colour :-) In any case, there is a link there. I don't think we need to duplication the information about the number of comments into the central pane.

We could probably shorten the column heading to "PubPeer". People will understand.

On Sun, Nov 24, 2019 at 10:35 PM Emiliano Heyns notifications@github.com wrote:

Those cells can only contain unstyled plain text, alas.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/PubPeerFoundation/pubpeer_zotero_plugin/issues/1?email_source=notifications&email_token=ABCZPNWRGJXSG5ECD4WZDFLQVLXSLA5CNFSM4HYZWKS2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFAVPMY#issuecomment-557930419, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABCZPNXNGHFUCPNHUP2UDHLQVLXSLANCNFSM4HYZWKSQ .

--

Boris Barbour The PubPeer Foundation

Article 5. No one shall be subjected to torture or to cruel, inhuman or degrading treatment or punishment.

retorquere commented 4 years ago

Putting the number there allows for easy sorting on "has comments". If you want to sort on actual number of comments, I must add leading zeroes (like Zotero does for the Year column) as the table only sorts on string vamlue, not numeric value.

retorquere commented 4 years ago

(the image isn't actually part of the cell contents so you can't sort on that, but I could just simply always put a single space there -- that would also allow sorting on "has comments")

borisbarbour commented 4 years ago

Honestly, I think the binary information comments or none is fine for the central pane. Numbers would be unnecessary there and redundant with the tab.

On Sun, Nov 24, 2019 at 10:55 PM Emiliano Heyns notifications@github.com wrote:

(the image isn't actually part of the cell contents so you can't sort on that, although I could just simply always put a single space there -- that would also allow sorting on "has comments")

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/PubPeerFoundation/pubpeer_zotero_plugin/issues/1?email_source=notifications&email_token=ABCZPNXQBSLOIWUHIPHU4TTQVLZ3JA5CNFSM4HYZWKS2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFAV3LA#issuecomment-557931948, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABCZPNQRRGZHPM4SROCQEJ3QVLZ3JANCNFSM4HYZWKSQ .

--

Boris Barbour The PubPeer Foundation

Article 5. No one shall be subjected to torture or to cruel, inhuman or degrading treatment or punishment.

brandonStell commented 4 years ago

:robot: this is your friendly neighborhood build bot announcing test build 0.0.3.10 ("sorting")

Install in Zotero by downloading test build 0.0.3.10, opening the Zotero "Tools" menu, selecting "Add-ons", open the gear menu in the top right, and select "Install Add-on From File...".

retorquere commented 4 years ago

WRT https://github.com/PubPeerFoundation/pubpeer_zotero_plugin/issues/1#issuecomment-550485187: I can actually change the color/font of the text using CSS. I'd be careful to not go too baroque with this.

brandonStell commented 4 years ago

:robot: this is your friendly neighborhood build bot announcing test build 0.0.3.11 ("as per https://github.com/PubPeerFoundation/pubpeer_zotero_plugin/issues/1#issuecomment-550485187")

Install in Zotero by downloading test build 0.0.3.11, opening the Zotero "Tools" menu, selecting "Add-ons", open the gear menu in the top right, and select "Install Add-on From File...".

retorquere commented 4 years ago

Honestly, I think the binary information comments or none is fine for the central pane. Numbers would be unnecessary there and redundant with the tab.

While that's true, that goes for all information Zotero shows in the middle column.

retorquere commented 4 years ago

good to go? Then I can merge this for a proper release.

brandonStell commented 4 years ago

I think users will like to see the comment number in the center pane. Otherwise they have to click on every article and open the tab to know if there is a new comment.

On Sun, Nov 24, 2019, 22:57 borisbarbour notifications@github.com wrote:

Honestly, I think the binary information comments or none is fine for the central pane. Numbers would be unnecessary there and redundant with the tab.

On Sun, Nov 24, 2019 at 10:55 PM Emiliano Heyns notifications@github.com wrote:

(the image isn't actually part of the cell contents so you can't sort on that, although I could just simply always put a single space there -- that would also allow sorting on "has comments")

— You are receiving this because you commented. Reply to this email directly, view it on GitHub < https://github.com/PubPeerFoundation/pubpeer_zotero_plugin/issues/1?email_source=notifications&email_token=ABCZPNXQBSLOIWUHIPHU4TTQVLZ3JA5CNFSM4HYZWKS2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFAV3LA#issuecomment-557931948 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/ABCZPNQRRGZHPM4SROCQEJ3QVLZ3JANCNFSM4HYZWKSQ

.

--

Boris Barbour The PubPeer Foundation

Article 5. No one shall be subjected to torture or to cruel, inhuman or degrading treatment or punishment.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/PubPeerFoundation/pubpeer_zotero_plugin/issues/1?email_source=notifications&email_token=ACUT7T55Y43LGNANONL6ACLQVL2FXA5CNFSM4HYZWKS2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFAV45Q#issuecomment-557932150, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACUT7T5NNHSXESKJNS2ULDTQVL2FXANCNFSM4HYZWKSQ .

retorquere commented 4 years ago

.11 displays the date of last comment, .10 displays the space, .9 displays the number of comments (which won't sort well unless I add leading zeroes)

brandonStell commented 4 years ago

:+1: for .9 without the leading zeros. We could change it to a space later if we change our minds.

Fine with me if you merge.

retorquere commented 4 years ago

Is that the decision then? Or do you want to confirm with @borisbarbour?

brandonStell commented 4 years ago

We should wait to see how strongly he feels about it.

borisbarbour commented 4 years ago

Go for it!

On Mon, Nov 25, 2019 at 12:23 PM Brandon Stell notifications@github.com wrote:

We should wait to see how strongly he feels about it.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/PubPeerFoundation/pubpeer_zotero_plugin/issues/1?email_source=notifications&email_token=ABCZPNRMVEJTT6DO36ETWHDQVOYUXA5CNFSM4HYZWKS2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFCB5XA#issuecomment-558112476, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABCZPNT74EXHAZBXJS2VPLTQVOYUXANCNFSM4HYZWKSQ .

--

Boris Barbour The PubPeer Foundation

Article 5. No one shall be subjected to torture or to cruel, inhuman or degrading treatment or punishment.

retorquere commented 4 years ago

Out as 0.0.4