dev build for fx115 and custom item-pane sections

560 views
Skip to first unread message

Dan Stillman

unread,
Mar 30, 2024, 10:18:17 AMMar 30
to zoter...@googlegroups.com
We've just merged the branch we've been working on that updates Zotero
to be based on Firefox 115 ESR instead of Firefox 102 ESR. This will be
the ESR version of Firefox used for the initial public release of Zotero 7.

This is a work in progress with definite bugs, but we're hoping to push
out a Zotero 7 beta build based on this code on April 8. To give plugin
developers a chance to update their code first, we've pushed builds on
the 'dev' channel:

https://www.zotero.org/support/dev/zotero_7_for_developers#dev_builds

(As before, this channel will only be active until we push out a beta
with these changes.)

We've added a section to the Zotero 7 developer docs that covers the
biggest changes to the Mozilla platform from Firefox 102 to 115:

https://www.zotero.org/support/dev/zotero_7_for_developers#firefox_102_firefox_115

This version also includes the promised API for adding custom sections
to the item pane:

https://www.zotero.org/support/dev/zotero_7_for_developers#custom_item_pane_sections

Some of the Mozilla changes (IOUtils, Services.prompt, flexbox) already
work fine in 102, but for the rest, you can use
Zotero.platformMajorVersion to test whether a Zotero 7 build is based on
Firefox 102 or 115, which will allow you to update your plugin in
advance of the Zotero 7 beta that includes these changes.

Let us know if you have any questions!

David Hoff-Vanoni

unread,
Mar 30, 2024, 6:36:21 PMMar 30
to zotero-dev
I'm excited to try this new version!

I downloaded the dev build for Mac (Zotero 7.0.0-dev.21+a45be190e), but when I try to open it I receive the following error:
You can’t open the application “Zotero.app” because this application is not supported on this Mac.

Looking into the system console, I see this message:
LAUNCH:Application cannot be launched because its unsupported bit is set, org.zotero.zotero-dev node=<private> status=-10661

I'm on an Intel Macbook running macOS 14.3.1.

Am I doing something wrong, or does the build need to be updated?

volatile static

unread,
Mar 30, 2024, 7:58:01 PMMar 30
to zotero-dev
It is great to get a precise date of the release.

volatile static

unread,
Mar 30, 2024, 8:47:02 PMMar 30
to zotero-dev
BTW, I'm glad to say the zotero...@1.3.21 is up to date with item pane API for plugins.

Dan Stillman

unread,
Mar 31, 2024, 6:34:59 AMMar 31
to zoter...@googlegroups.com
On 3/30/24 6:36 PM, David Hoff-Vanoni wrote:
> I downloaded the dev build for Mac (Zotero 7.0.0-dev.21+a45be190e),
> but when I try to open it I receive the following error:
> You can’t open the application “Zotero.app” because this application
> is not supported on this Mac.

Oops, sorry about that. Fixed now for Intel Macs. Thanks!

Dan Stillman

unread,
Apr 8, 2024, 11:42:31 PMApr 8
to zoter...@googlegroups.com
Just to note, we released 7.0.0-beta.69 based on Firefox 115 for Windows and macOS a few hours ago, but we pulled it due to a startup error some people were getting with a popular plugin.

We've added a missing try/catch when loading bootstrap.js and are building 7.0.0-beta.70 for all platforms now.

- Dan
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted

Emiliano Heyns

unread,
Apr 10, 2024, 5:10:38 PMApr 10
to zotero-dev
Can OS.Path.split be added to the osfile shim?

On Tuesday, April 9, 2024 at 10:54:09 PM UTC+2 Emiliano Heyns wrote:
Sorry, this was answered before.

On Tuesday, April 9, 2024 at 9:44:40 PM UTC+2 Emiliano Heyns wrote:
Are IOUtils and PathUtils available in Zotero 6?

Dan Stillman

unread,
Apr 11, 2024, 7:33:02 AMApr 11
to zoter...@googlegroups.com
On 4/10/24 5:10 PM, Emiliano Heyns wrote:
> Can OS.Path.split be added to the osfile shim?

Yes, we'll add that for the next build. (We've never used that in
Zotero, so we missed that one.)

Emiliano Heyns

unread,
Apr 23, 2024, 3:21:33 PMApr 23
to zotero-dev
Is there also an API that would allow adding the citation key to the main item pane?

XY Wong

unread,
Apr 28, 2024, 11:00:01 PMApr 28
to zotero-dev
> Is there also an API that would allow adding the citation key to the main item pane?

The API for the info section of the item pane (which I guess is the `main item pane` you mentioned`) is in progress; Currently, an alternative could be displaying the citation key in a custom section.

Emiliano Heyns

unread,
Apr 29, 2024, 6:54:11 AMApr 29
to zotero-dev
I've added this bodyXHTML

'<html:input type="text" id="better-bibtex-citation-key" readonly="true" xmlns:html="http://www.w3.org/1999/xhtml"/>'

but it doesn't take the full width available. Is there sample code that adds fields to the section?

Emiliano Heyns

unread,
Apr 29, 2024, 10:50:33 AMApr 29
to zotero-dev
I've added an ID to my ftl file:

betterbibtex-item-pane-header = Citation key

and registered the section with

      Zotero.ItemPaneManager.registerSection({
        paneID: 'betterbibtex-section-citationkey',
        pluginID: 'better...@iris-advies.com',
        header: {
          l10nID: 'betterbibtex-item-pane-header',
          icon: `${rootURI}content/skin/citation-key.png`,
        },
        sidenav: {
          l10nID: 'betterbibtex-item-pane-header',
          icon: `${rootURI}content/skin/citation-key.png`,
        },
        bodyXHTML: 'Citation Key <html:input type="text" id="better-bibtex-citation-key" readonly="true" style="position:relative;width:80%" xmlns:html="http://www.w3.org/1999/xhtml"/>',
        // onRender: ({ body, item, editable, tabType }) => {
        onRender: ({ body, item }) => {
          body.ownerDocument.getElementById('better-bibtex-citation-key').value = item.getField('citationKey') || '\u274C'
        },
      })

but while the section is showing up, the title for it isn't. How do I debug this?

XY Wong

unread,
Apr 29, 2024, 10:42:57 PMApr 29
to zotero-dev
> while the section is showing up, the title for it isn't. How do I debug this?

The title's ftl: 
```
betterbibtex-item-pane-header =
    .label = Citation key
```

The sidenav's ftl:
```
xxx = 
    .tooltiptext = xxx
```


> but it doesn't take the full width available. Is there sample code that adds fields to the section?


I see you have explicitly set the width to 80%, so I suppose you have figured it out.


Emiliano Heyns

unread,
Apr 30, 2024, 2:38:31 AMApr 30
to zotero-dev
On Tuesday, April 30, 2024 at 4:42:57 AM UTC+2 XY Wong wrote:
> while the section is showing up, the title for it isn't. How do I debug this?

The title's ftl: 
```
betterbibtex-item-pane-header =
    .label = Citation key
```

The sidenav's ftl:
```
xxx = 
    .tooltiptext = xxx
```



I think I've done that (but apparently not) in https://github.com/retorquere/zotero-better-bibtex/commit/62585702cd7c77b025a358b5242829f72c13aa7d, but the section header doesn't show
 
> but it doesn't take the full width available. Is there sample code that adds fields to the section?


I see you have explicitly set the width to 80%, so I suppose you have figured it out.

That was the only thing that seemed to sort-of work. Setting flex="1" doesn't have any effect. This isn't too important to me as it's a temporary solution anyhow.
I've tried to replicate that in https://github.com/retorquere/zotero-better-bibtex/commit/4bac4fe3cb05583de06f7b40c95f08ce9ce88169 but I'm not seeing anything show up.


XY Wong

unread,
Apr 30, 2024, 4:30:26 AMApr 30
to zotero-dev
> but the section header doesn't show

You need to load the `ftl` file into the window using `window.MozXULElement.insertFTLIfNeeded('better-bibtex.ftl')`.


And don't use the same ftl string for both the section's sidenav button and its header. The `label` will appear inside the sidenav button.

> Setting flex="1" doesn't have any effect.

In fx115, the `flex=1` works differently compared to earlier versions. So very likely they do not work the way in fx102 or fx60.

> but I'm not seeing anything show up.

The section summary only shows up when the section is collapsed. I made a build from your main and it works as expected.

Emiliano Heyns

unread,
May 1, 2024, 1:59:43 AMMay 1
to zotero-dev
Does PathUtils.filename need the path to exist? I'm calling OS.Path.basename using the shim, and a user is getting OperationError: PathUtils.filename: Could not initialize path: NS_ERROR_FILE_UNRECOGNIZED_PATH

Dan Stillman

unread,
May 1, 2024, 2:08:18 AMMay 1
to zoter...@googlegroups.com
On 5/1/24 1:59 AM, Emiliano Heyns wrote:
> Does PathUtils.filename need the path to exist? I'm calling
> OS.Path.basename using the shim, and a user is getting OperationError:
> PathUtils.filename: Could not initialize path:
> NS_ERROR_FILE_UNRECOGNIZED_PATH

No, but it has to be a valid path, including slashes in the correct
direction. OS.Path.basename() was more forgiving.

Emiliano Heyns

unread,
May 1, 2024, 2:49:21 AMMay 1
to zotero-dev
It apparently doesn't like it if I feed it a path that as no slashes at all. No longer a problem in my code, but thought you might want to know.

Dan Stillman

unread,
May 1, 2024, 2:51:10 AMMay 1
to zoter...@googlegroups.com
On 5/1/24 2:49 AM, Emiliano Heyns wrote:
> It apparently doesn't like it if I feed it a path that as no slashes
> at all. No longer a problem in my code, but thought you might want to
> know.

It's not a question of slashes. It just has to be an absolute path.

Emiliano Heyns

unread,
May 1, 2024, 3:01:30 AMMay 1
to zotero-dev
On Tuesday, April 30, 2024 at 10:30:26 AM UTC+2 XY Wong wrote:
> but the section header doesn't show

You need to load the `ftl` file into the window using `window.MozXULElement.insertFTLIfNeeded('better-bibtex.ftl')`.

Where? In the onRender call? How do I get the window object in the onRender call? Or is this just part of the main window?
 
And don't use the same ftl string for both the section's sidenav button and its header. The `label` will appear inside the sidenav button.

Check. And the sidenav should have the tooltip, and the header the label, correct?
 
> Setting flex="1" doesn't have any effect.

In fx115, the `flex=1` works differently compared to earlier versions. So very likely they do not work the way in fx102 or fx60.

Right but the docs relevant to 115 say

UI now uses modern flexbox instead of XUL layout, so Mozilla CSS properties need to be replaced with standard properties (e.g., -moz-box-flex: 1flex: 1) and there are various layout differences
 
so I had assumed to flex="1" would have allowed the text input box to stretch.


The section summary only shows up when the section is collapsed.

Check. Thank you.

If the data behind the section changes in the background (like the citekey being regenerated in my case), how do I tell Zotero to refresh the custom section (and later the info section)?

XY Wong

unread,
May 1, 2024, 3:21:49 AMMay 1
to zotero-dev
> Or is this just part of the main window?

Yes. The `onMainWindowLoad` in the bootstrap.js

> And the sidenav should have the tooltip, and the header the label, correct?

Yes

UI now uses modern flexbox instead of XUL layout, so Mozilla CSS properties need to be replaced with standard properties (e.g., -moz-box-flex: 1 → flex: 1) and there are various layout differences
 
> so I had assumed to flex="1" would have allowed the text input box to stretch.

Here are two things: the attribute `flex="1"` and the CSS property `flex: 1;`. In fx115, the attribute `flex="1"` on XUL elements adds the CSS property `flex: 1;` to the element, which equals to the CSS `flex-grow: 1; flex-shrink: 1; flex-basis: 0%;`

So in your case:
1. the input element is not a XUL element so the attribute `flex="1"` won't work;
2. the CSS `flex: 1;` won't do anything since its parent element, the `body` element, does not use a flex layout, unless you set CSS `display: flex;` to the `body` element.

> If the data behind the section changes in the background (like the citekey being regenerated in my case), how do I tell Zotero to refresh the custom section (and later the info section)?


Register a notifier callback in `onInit` which calls `refresh` when the item is modified and unregister it in `onDestroy`.

Feel free to discuss if I didn't explain it clearly.

Emiliano Heyns

unread,
May 1, 2024, 4:28:19 AMMay 1
to zotero-dev
Oh that is surprising. Why is this? I had expected relative paths to work.

Emiliano Heyns

unread,
May 1, 2024, 7:13:25 AMMay 1
to zotero-dev
On Wednesday, May 1, 2024 at 9:21:49 AM UTC+2 XY Wong wrote:
> Or is this just part of the main window?

Yes. The `onMainWindowLoad` in the bootstrap.js

But the "Zotero 7 for developers" page says:

Any .ftl files you place in the locale subfolders will be automatically registered in Zotero's localization system.

and mine are, so shouldn't they be loaded automatically?
 
UI now uses modern flexbox instead of XUL layout, so Mozilla CSS properties need to be replaced with standard properties (e.g., -moz-box-flex: 1 → flex: 1) and there are various layout differences
 
> so I had assumed to flex="1" would have allowed the text input box to stretch.

Here are two things: the attribute `flex="1"` and the CSS property `flex: 1;`. In fx115, the attribute `flex="1"` on XUL elements adds the CSS property `flex: 1;` to the element, which equals to the CSS `flex-grow: 1; flex-shrink: 1; flex-basis: 0%;`

Ah check.
 

So in your case:
1. the input element is not a XUL element so the attribute `flex="1"` won't work;
2. the CSS `flex: 1;` won't do anything since its parent element, the `body` element, does not use a flex layout, unless you set CSS `display: flex;` to the `body` element.

Which I shouldn't do I take it?
 
> If the data behind the section changes in the background (like the citekey being regenerated in my case), how do I tell Zotero to refresh the custom section (and later the info section)?


Register a notifier callback in `onInit` which calls `refresh` when the item is modified and unregister it in `onDestroy`.

How can I know what item is being displayed? I only need to refresh if the currently shown item has changed. Should I remember that in the onRender?

Emiliano Heyns

unread,
May 4, 2024, 2:33:07 PMMay 4
to zotero-dev
Is there a similar way to refresh the item pane on Zotero 6?

XY Wong

unread,
May 4, 2024, 11:09:22 PMMay 4
to zotero-dev
Any .ftl files you place in the locale subfolders will be automatically registered in Zotero's localization system.

That means they can be referenced using the file name, while you still need to insert them into the window.

> Which I shouldn't do I take it?

Do not use `flex=1` attribute on non-XUL elements, and only use `flex: 1;` CSS property on elements inside a flex box. In your case, set `flex: 1;` CSS property to the html:input element and set `display: flex;` CSS property to its parent element (the `body`).

> How can I know what item is being displayed? Should I remember that in the onRender?

The `onRender` and `onAsyncRender` have `item` in the props, as shown in the examples in make-it-red. If you need to access the item outside the render callbacks, e.g. in a notifier callback, you can set the item id as an attribute to an element, e.g. the `body`, in the `onItemChange` callback.

> Is there a similar way to refresh the item pane on Zotero 6?

No. The item pane on Zotero 6 is different, you'll need to manually update the UI.

Emiliano Heyns

unread,
May 5, 2024, 3:14:19 AMMay 5
to zotero-dev
On Sunday, May 5, 2024 at 5:09:22 AM UTC+2 XY Wong wrote:
Any .ftl files you place in the locale subfolders will be automatically registered in Zotero's localization system.

That means they can be referenced using the file name, while you still need to insert them into the window.

OK, got that. I've added the onMainWindowLoad function to add the ftl (https://github.com/retorquere/zotero-better-bibtex/blob/master/content/bootstrap.ts#L64), but it's still not showing up. I've tried to debug that, but running

const win = Zotero.getMainWindow()
win.document.documentElement.outerHTML

doesn't turn up a localization element for better bibtex. As an aside,  running this in the Run Javascript window reliably segfaults Zotero 7.0.0-beta.77+adaa61f2c for me (on MacOS Sonoma):

const win = Zotero.getMainWindow()
win.document

> How can I know what item is being displayed? Should I remember that in the onRender?

The `onRender` and `onAsyncRender` have `item` in the props, as shown in the examples in make-it-red. If you need to access the item outside the render callbacks, e.g. in a notifier callback, you can set the item id as an attribute to an element, e.g. the `body`, in the `onItemChange` callback.

According to https://github.com/zotero/zotero/blob/main/chrome/content/zotero/xpcom/itemPaneManager.js, `onItemChange` only gets passed `setEnabled`. I don't know how to derive the item being changed to from this.
 

Emiliano Heyns

unread,
May 5, 2024, 5:26:09 AMMay 5
to zotero-dev
My `onMainWindowLoad` function doesn't appear to be called.

XY Wong

unread,
May 5, 2024, 6:16:32 AMMay 5
to zotero-dev
> My `onMainWindowLoad` function doesn't appear to be called.

The `onMainWindowLoad` is only called when a main window is loaded after the plugin is initialized, while initializing the plugin may happen after a main window is already loaded. You'll need to manually execute the relevant logic on existing main windows (from Zotero.getMainWindows) in `startup` in  `bootstrap.js`. See make-it-red: https://github.com/zotero/make-it-red/blob/5a7ee1be2f147a327220c1e5a4129d6c6169999c/src-2.0/bootstrap.js#L22.

> According to https://github.com/zotero/zotero/blob/main/chrome/content/zotero/xpcom/itemPaneManager.js, `onItemChange` only gets passed `setEnabled`. I don't know how to derive the item being changed to from this.


Emiliano Heyns

unread,
May 5, 2024, 9:17:14 AMMay 5
to zotero-dev
On Sunday, May 5, 2024 at 12:16:32 PM UTC+2 XY Wong wrote:

The `onMainWindowLoad` is only called when a main window is loaded after the plugin is initialized, while initializing the plugin may happen after a main window is already loaded. You'll need to manually execute the relevant logic on existing main windows (from Zotero.getMainWindows) in `startup` in  `bootstrap.js`. See make-it-red: https://github.com/zotero/make-it-red/blob/5a7ee1be2f147a327220c1e5a4129d6c6169999c/src-2.0/bootstrap.js#L22.

OK, so now of the call to inject the ftl is happening, and I see this in the document:

<html:link rel="localization" href="better-bibtex.ftl" />

shouldn't that have a path in addition to the filename? In any case the strings don't appear yet.
That seems to work, great!

Emiliano Heyns

unread,
May 5, 2024, 1:15:59 PMMay 5
to zotero-dev
Can I test whether a filename is valid? Right now I'm getting errors I didn't use to because basename would accept invalid and relative paths.

XY Wong

unread,
May 6, 2024, 5:04:57 AMMay 6
to zotero-dev
> shouldn't that have a path in addition to the filename?

No. That is because
Any .ftl files you place in the locale subfolders will be automatically registered in Zotero's localization system.

> Can I test whether a filename is valid?

If the ftl is correctly inserted into the window, `document.l10n.formatMessages([{id: 'YOUR_L10N_ID'}])` should be able to return the corresponding string.

Emiliano Heyns

unread,
May 6, 2024, 6:08:17 AMMay 6
to zotero-dev
That works, and the label now shows up.

XY Wong

unread,
May 6, 2024, 11:51:22 PMMay 6
to zotero-dev
Good to know. Let me know if you have further issues with the item pane API.

FYR, the item pane API supports adding custom buttons to the section header, e.g. regenerate citeKey, copy citeKey, which might also be helpful to you and other plugin developers.

Dan Stillman

unread,
May 6, 2024, 11:53:56 PMMay 6
to zoter...@googlegroups.com
On 5/6/24 6:08 AM, Emiliano Heyns wrote:
> That works, and the label now shows up.

I think the two separate discussions here (filenames and localization)
got a bit mixed up, but to be clear, for localization, you generally
shouldn't need to use formatMessages() — most of the time you want to
just use data-l10n-id or data.l10n.setAttributes() and let the
localization system handle populating the UI with messages. You just
need to make sure you've called
MozXULElement.insertFTLIfNeeded('better-bibtex.ftl') before creating
elements or using document.l10n.setAttributes().

formatMessages() would be used for something like a confirmEx() call,
where you need to pass strings to display.

Covered in
https://www.zotero.org/support/dev/zotero_7_for_developers#replacing_properties_files

XY Wong

unread,
May 6, 2024, 11:59:10 PMMay 6
to zotero-dev
> you generally shouldn't need to use formatMessages() — most of the time you want to just use data-l10n-id or data.l10n.setAttributes() and let the localization system handle populating the UI with messages

Yes (I mentioned `formatMessages` to answer how to test if an FTL file is correctly inserted)

Emiliano Heyns

unread,
May 18, 2024, 3:28:56 AMMay 18
to zotero-dev
Is there a way to refresh the middle pane (for Zotero 6 and 7)? I might be displaying the citekey in the table, and it might change without the item changing.

Abe Jellinek

unread,
May 18, 2024, 10:03:30 AMMay 18
to zoter...@googlegroups.com
You could fire a 'refresh', 'item' notifier event to avoid having to dig into item tree internals.

On May 18, 2024, at 3:29 AM, Emiliano Heyns <emilian...@iris-advies.com> wrote:

Is there a way to refresh the middle pane (for Zotero 6 and 7)? I might be displaying the citekey in the table, and it might change without the item changing.
--
You received this message because you are subscribed to the Google Groups "zotero-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zotero-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/zotero-dev/1ed58b8c-cbdf-4ae9-b07d-fe7fe223a21dn%40googlegroups.com.

Emiliano Heyns

unread,
May 19, 2024, 4:42:26 AMMay 19
to zotero-dev
Doing that interferes with the item pane. If I edit the title of an item and press tab, Zotero gives the next field (author) focus, but if the item key updates because the title changed, and I issue a refresh, the author field loses focus, so I have to click the field again to edit the author.

Abe Jellinek

unread,
May 20, 2024, 12:46:38 PMMay 20
to zoter...@googlegroups.com

Emiliano Heyns

unread,
May 20, 2024, 1:10:10 PMMay 20
to zotero-dev
Can I query and set what item field is focused in Zotero 6? Then I could query, refresh, set focus. 

You received this message because you are subscribed to a topic in the Google Groups "zotero-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/zotero-dev/wirqnj_EQUQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to zotero-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/zotero-dev/6E5F2243-692D-4CA5-9E11-17758EB1B94A%40berkeley.edu.

Emiliano Heyns

unread,
May 20, 2024, 3:37:40 PMMay 20
to zotero-dev
I'm trying to sus out what the problem is here, and it looks like, after adding an item via the connector, I'm getting an `onRender` for one of the items for which I have an PDF open; I'm seeing this sequence of events:

selecting bentley_academic_2011
onItemChange:  -> 32 {"id":32,"type":"journalArticle","citekey":"bentley_academic_2011"}
onRender: 32 -> 32 {"id":32,"type":"journalArticle","citekey":"bentley_academic_2011"}

open PDF from bentley_academic_2011
not sure why there are so many renders, but should do no harm

onItemChange: 32 -> 32 {"id":32,"type":"journalArticle","citekey":"bentley_academic_2011"}
onRender: 32 -> 32 {"id":32,"type":"journalArticle","citekey":"bentley_academic_2011"}
onDestroy
onItemChange: 32 -> 32 {"id":32,"type":"journalArticle","citekey":"bentley_academic_2011"}
onRender: 32 -> 32 {"id":32,"type":"journalArticle","citekey":"bentley_academic_2011"}

select shelahNoteHanfNumbers1970
onItemChange: 32 -> 12 {"id":12,"type":"journalArticle","citekey":"shelahNoteHanfNumbers1970"}
onRender: 12 -> 12 {"id":12,"type":"journalArticle","citekey":"shelahNoteHanfNumbers1970"}

add new entry via connector
109 is the new item
onInit.items-changed = citation key changed. this is OK; 12 is currently being displayed, so no refresh

onInit.items-changed: [109] current: 12 refresh: false
onInit.items-changed: [109] current: 12 refresh: false
onInit.items-changed: [109] current: 12 refresh: false
onInit.items-changed: [109] current: 12 refresh: false

onItemChange: 12 -> 109 {"id":109,"type":"webpage","citekey":"Polars"}
onRender: 109 -> 109 {"id":109,"type":"webpage","citekey":"Polars"}
onInit.items-changed: [109] current: 109 refresh: true
onRender: 109 -> 109 {"id":109,"type":"webpage","citekey":"Polars"}
onInit.items-changed: [109] current: 109 refresh: true

so far so good

onRender: 109 -> 32 {"id":32,"type":"journalArticle","citekey":"bentley_academic_2011"} I'm currently displaying 109 (correct) but I'm getting an onRender for 32? If anything I would have expected 12
onItemChange: 32 -> 109 {"id":109,"type":"webpage","citekey":"Polars"} then a change from 32 to 109 (at least repairs the problem)
onItemChange: 109 -> 32 {"id":32,"type":"journalArticle","citekey":"bentley_academic_2011"} (but undoes the repair here).

The last 3 are the cause of the problem. This only occurs if I open the PDF for display, otherwise these last 3 do not occur.

Emiliano Heyns

unread,
May 20, 2024, 4:11:28 PMMay 20
to zotero-dev
Is there a way to hide the section depending on what item is shown? I don't want to have the section visible for feed items.

On Monday, April 29, 2024 at 5:00:01 AM UTC+2 XY Wong wrote:
> Is there also an API that would allow adding the citation key to the main item pane?

The API for the info section of the item pane (which I guess is the `main item pane` you mentioned`) is in progress; Currently, an alternative could be displaying the citation key in a custom section.

On Wednesday, April 24, 2024 at 3:21:33 AM UTC+8 Emiliano Heyns wrote:
Is there also an API that would allow adding the citation key to the main item pane?

On Saturday, March 30, 2024 at 3:18:17 PM UTC+1 Dan Stillman wrote:
We've just merged the branch we've been working on that updates Zotero
to be based on Firefox 115 ESR instead of Firefox 102 ESR. This will be
the ESR version of Firefox used for the initial public release of Zotero 7.

This is a work in progress with definite bugs, but we're hoping to push
out a Zotero 7 beta build based on this code on April 8. To give plugin
developers a chance to update their code first, we've pushed builds on
the 'dev' channel:

https://www.zotero.org/support/dev/zotero_7_for_developers#dev_builds

(As before, this channel will only be active until we push out a beta
with these changes.)

We've added a section to the Zotero 7 developer docs that covers the
biggest changes to the Mozilla platform from Firefox 102 to 115:

https://www.zotero.org/support/dev/zotero_7_for_developers#firefox_102_firefox_115

This version also includes the promised API for adding custom sections
to the item pane:

https://www.zotero.org/support/dev/zotero_7_for_developers#custom_item_pane_sections

Some of the Mozilla changes (IOUtils, Services.prompt, flexbox) already
work fine in 102, but for the rest, you can use
Zotero.platformMajorVersion to test whether a Zotero 7 build is based on
Firefox 102 or 115, which will allow you to update your plugin in
advance of the Zotero 7 beta that includes these changes.

Let us know if you have any questions!

Abe Jellinek

unread,
May 20, 2024, 4:15:21 PMMay 20
to zoter...@googlegroups.com
Set this.hidden in set item(). (See built-in sections like librariesCollectionsBox.js.)

-- 
You received this message because you are subscribed to the Google Groups "zotero-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zotero-dev+...@googlegroups.com.

Emiliano Heyns

unread,
May 20, 2024, 4:24:11 PMMay 20
to zotero-dev
Can `unixMode` be added to the OS.File.stat shim?

Emiliano Heyns

unread,
May 20, 2024, 4:28:37 PMMay 20
to zotero-dev
I'm sorry, but I don't know how that relates to the call to Zotero.ItemPaneManager.registerSection I'm using to register the section.

On Monday, May 20, 2024 at 10:15:21 PM UTC+2 Abe Jellinek wrote:

Abe Jellinek

unread,
May 20, 2024, 4:33:33 PMMay 20
to zoter...@googlegroups.com
Oh, sorry, right. It’s different for plugin sections. Implement the onItemChange hook. Something like:

onItemChange({ setEnabled, item }) {
setEnabled(item.isRegularItem());
}


Emiliano Heyns

unread,
May 20, 2024, 7:30:30 PMMay 20
to zotero-dev
This only occurs if I open the PDF attachment BTW. Without doing that, the problem does not occur.

XY Wong

unread,
May 21, 2024, 1:46:59 AMMay 21
to zotero-dev
Hi Emiliano, what's your Zotero version? Does it still happen on beta 79?

Dan Stillman

unread,
May 21, 2024, 1:59:08 AMMay 21
to zoter...@googlegroups.com
On 5/20/24 4:24 PM, Emiliano Heyns wrote:
> Can `unixMode` be added to the OS.File.stat shim?

Added for the next beta

Emiliano Heyns

unread,
May 21, 2024, 2:35:02 AMMay 21
to zoter...@googlegroups.com
I’m on 7.0.0-beta.79+95d5a5417

--
You received this message because you are subscribed to a topic in the Google Groups "zotero-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/zotero-dev/wirqnj_EQUQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to zotero-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/zotero-dev/40c7e2b8-babf-4176-b75c-6b54563d77cfn%40googlegroups.com.

Emiliano Heyns

unread,
May 24, 2024, 2:12:59 PMMay 24
to zotero-dev
I've found a way for Zotero 6, but not for 7. Is there a way I can find the rendered cell given the column and item ID? Then I can just update the DOM.
Reply all
Reply to author
Forward
0 new messages