Bike 2.0 (Preview 275)

  • Added setting to disable animations in Low Power Mode
  • Fixed paste crash when inserting empty text
  • Fixed link button being unclickable due to style
  • Fixed hang when closing document with active filter
  • Improved breadcrumb trimming to respect word boundaries

Extensions

  • Added JSRowRun bridge so the run:: axis works from JS extensions
  • Fixed parent:: axis returning grandparent when evaluated from a run

Download:

2 Likes

for the non-reponsive folding triangle bug, i still occasionally run into it, and i have the logs all activated. if i run into the bug again, what should i do? copy and paste the logs here?

Right after it happens switch to the logs window, select all log entries, copy, and paste into an email or this forum. Truthfully, I’m not all that hopeful that the logs will point to the problem, but it’s worth a try.

Also, try to review in your mind when it does happen… what is the sequence of actions that is causing this? If you can give me steps to reproduce the problem myself then I’m sure I can fix.

1 Like

What are your thoughts about allowing the URL value of a link, in Bike, to consist simply of the number sign (#) followed by a fragment identifier (unique row id) ?

We can do this on web pages, where RFC 3986 presents it as an assumption that the referenced id is in the same document.

Section 4.4. Same-Document Reference

The href=#unique_mnemonic_identifier pattern is attractive for things like footnote management, particularly now that the .persistentId can be user-defined, and I was able to achieve this via custom styling in 274, while link decorations were in a different z-plane, but since that was fixed for 275, my draft style code still enables same-document jumps to a bare #identifier reference if I click on blued text, but a click on the link decoration icon now triggers Bike’s core URL opening logic, and the message:


What seems like a sensible approach here ? Should my styling code

Expand disclosure triangle to view JS source
import { Color, defineEditorStyleModifier } from 'bike/style'


defineEditorStyleModifier('footnote-jumper', 'Internal Link Jumper')
  .layer('run-formatting', (_, run) => {

    // Outline path matching runs that have an 
    // 'a' (link) attribute starting with a hash (#).
    run('.@a beginswith "#"', (_, runStyle) => {

      runStyle.color = Color.systemBlue();
      runStyle.underline.single = true;


      runStyle.decoration('footnote-click-target', (decoration, layout) => {
        decoration.width = layout.width;
        decoration.height = layout.height;

        // Route clicks to registered command
        decoration.commandName = 'pandoc:jump-to-footnote';

        decoration.zPosition = 10;
      });
    });
  });

find some way of competing to define decorator-click behaviour, perhaps via z-axis priority,
or might it, perhaps, be possible to allow Bike’s general Open Link logic to treat

href="#row_identifier"

as a synonym of

href="bike://this_doc/row_identifier"

in the pattern of RFC 3986, Section 4.4?

I need to look into the details of implementation, but I think this is OK and makes sense.

1 Like

Thinking on this more… I think it might be a good idea, but it also opens up a bunch of questions.

First the good parts as I see (let me know if I’m missing any):

  • Shorter, don’t need to contain document ID
  • Links work natively when .html encoding is opened in browser
  • Maybe work with Pandoc? I’m not sure, but that would be nice

Second the problems/questions

  • Can’t just use them directly with URL api, they need to be resolved against an outline first.
  • How smart/aggressive should code be about creating them. For example when I use Format > Add Link to Row… should I create a bike:// or a # style link?
  • Same question when using drag and drop to create links.
  • What about Copy > Row Link… I think that should copy bike:// style link since I expect it will be used for pasting a link externally most often, but then it creates a bit of weirdness where Add Link to Row might create one sort of link and Copy Row Link has another sort.
1 Like

Thank you for giving thought to this so quickly !

On the questions side,

It seems sensible to me to default to the explicit bike:// form, with literal document identifier, since this works well in many contexts.

Perhaps the #abbreviated form is something for Go > Open Link, and Format > Add Link to allow, rather than enforce or draw attention to, with the full bike://doc_id/row_id remaining the default ?


On the good side,

I might add FWIW, that where a user has chosen to use the abbreviated #persistentId form, the abbreviated links may benefit from a kind of advantage for copy and paste (to other documents), in that they don’t contain an absolute document identifier, and can more simply inherit the relative context of the new document, rather than (possibly) opening up the old document.


PS, yes you are right, the #persistentId pattern is used by Pandoc, and very helpful when exporting footnote, figure, header, and table references etc, to other formats through Pandoc.

Generally, perhaps there’s a quadrant here:

(Relative vs Absolute)
* (#mnemonic vs NanoID)

Deliberately relative links will tend, I guess, to be mmemonic.

Absolute links, between documents, probably auto-generated and highly unique NanoIDs ?


In terms of styling, I think may give local (relative) links a distinct appearance – a slightly different or decoration, for example.

In latest release I’ve added support to use #id links, but Bike code isn’t creating them:

Thanks for the additional logs that you’ve sent. The latest 276 release, has a fix! Maybe. Please try it out for a few days and let me know if you still see the problem or not.

will do