omniJS (OG 7.3 Test) won't add new shapes to an unlocked invisible layer

In JXA, we can do something useful which is not working at the moment in OmniJS

  1. Suspend the visibility of the top layer of a canvas
  2. Add further graphics to that layer
  3. Restore visibility and reveal the added graphics.

(See successful JXA snippet below, below the OmniJS code which shows the problem)

Writing to an invisible layer, and revealing later, has various applications, including the
avoidance of confusing or distracting displays while the screen is updated
unnecessarily during the scripted generation of a document.

This currently fails to work in OmniJS, which seems to bypass an unlocked layer if it is invisible,
and either writes to the first available visible layer, or creates an unrequested new layer.

OmniJS code which fails to write to an unlocked but invisible top layer (creating instead an additional layer).

(() => {
    'use strict';
    // Omni JS Code - writing to an invisible but unlocked layer fails
    // (an unrequested new layer is created, or the first visible layer is used)

    // TEST WITH A ONE-LAYER CANVAS
    const
        cnv = document.windows[0].selection.canvas,
        topLayer = cnv.layers[0];

    console.log('Version: ', app.version);

    topLayer.visible = false;

    console.log('Number of layers at start: ', cnv.layers.length);

    if (cnv.layers.length > 1) {
        return "This script is for testing with single-layer canvases";
    }

    const shp = cnv.newShape();

    shp.text = "hello world";
    shp.textSize = 12;
    shp.geometry = new Rect(250.00, 100.00, 100.00, 100.00);

    topLayer.visible = true;

    console.log('Number of layers now: ', cnv.layers.length);

    // The single invisible layer was avoided, as if it were locked
    // and an unrequested second layer has been created
    return shp.text;
})();

JXA code which writes successfully to an invisible layer:

(() => {
    'use strict';

    const
        og = Application('OmniGraffle'),
        cnv = og.documents[0].canvases[0],
        lr = cnv.layers[0];

    // HIDE
    lr.visible = false;

    // WRITE
    cnv.graphics.push(og.Shape({
        name: 'Rectangle',
        origin: [100, 100],
        size: [100, 100],
        text: 'hello world'
    }));

    // REVEAL
    lr.visible = true;

    og.activate;
})();