Bike 2.0 (Preview 271)

  • Fixed ordered list number alignment with row text
  • Fixed hide interface re-entrancy issue on macOS 26.4
  • Fixed imported markdown handling in pasteboard decoding
  • Fixed crash on quit when drag pasteboard had promises
  • Fixed links in DOM contexts (inspector, settings, sheets) not opening in browser
  • Fixed rowIndexFrom character index conversion with multi-byte characters

Extensions

  • Added Keychain API for secure password/token storage
  • Added Extension settings API (Bike > Settings > Extensions)
  • Namespaced globals (such as extensionURL) to bike.extensionURL, etc

Note If you are an extension developer don’t forget to npm update to get latest version of the extension kit.

Download:

2 Likes

If you are an extension developer, in addition to npm update note that I broke some things, if you were using extensionURL, you should now instead use bike.extensionURL. The reason for this is you can also now more easily find other Bike globals such as bike.defaults and bike.keychain, etc. Also, don’t miss the new extension settings API and see the Core calendar extension for example of how to use.

Besides the extension API most everything else is a bug fix in this release. Keep sending crash reports. This one fixes some bugs with multibyte strings that I wasn’t testing well.

1 Like

A minor edge case with data- custom attributes:

  1. A value for the key data-id can bet set and read through the api, and
  2. does show up in the .bike file source, but
  3. does not seem to be read back in from .bike files.

osascript for checking:

  • Row.setAttribute and Row.getAttribute with the argument 'id'
  • that Row.id is not overwritten when this argument is used.
Expand disclosure triangle to view JS source
(() => {
    "use strict";

    // `data-id` value settable and written to .bike file
    // but not read back from .bike file.

    const bikeAppContext = () => {
        const selectedRow = bike.frontmostOutlineEditor.selection.row;

        // A value can be set for `data-id`
        selectedRow.setAttribute('id', 'customValueFor_data-id');

        // and retrieved for `data-id`
        return JSON.stringify(
            {
                "rowString": selectedRow.text.string,
                "data-id": selectedRow.getAttribute("id"),
                "id": selectedRow.id
            },
            null, 2
        );

        // And inspection of the resulting .bike source shows 
        // that `data-id` has been successfully written out.

        // But when the Bike document is closed, 
        // and the .bike file read back in,
        // `data-id` seems to have been lost or discarded.
    };

    // For osascript / Script Editor (JavaScript) evaluation

    return Application("Bike").evaluate({ script: `${bikeAppContext}` });
})();

Context

Noticed while experimenting with ways of setting a unique (custom, user-chosen) mnemonic identifier for a given row, in the spirit of Pandoc’s annotation of headings etc with {#foo}.