Toggle Expansion of all Peers of Selected Line

In v1.7 (93) I see the following behavior:

  1. list item with 10 children, all expanded with items in them
  2. cmd+click one of those 10 children’s disclosure indicators ▼
  3. what happens: Bike focuses on that single item, and hides all parent/sibling items
  4. what i expect: Bike collapses all sibling items and shows :arrow_forward: for each

I like the ability to focus on a single item, maybe option+cmd+click to focus? the option+click and cmd+click semantics I feel are fairly standard in tree UIs, I’m thinking of Xcode’s file tree as an example.

Thanks for creating Bike, just started using it and really enjoying it!

To toggle the expansion of all peers of the selected line, and all other lines at the same level, you could use a script like this:

Expand disclosure triangle to view JS source
(() => {
    "use strict";

    // Expand or Collapse all visible peers
    // of selected line in BIKE.

    // Rob Trew @2022

    const
        bike = Application("Bike"),
        doc = bike.documents.at(0);

    return doc.exists() ? (() => {
        const
            row = doc.selectionRow,
            nLevel = row.level(),
            peers = doc.rows.where({
                level: nLevel,
                visible: true
            }),
            k = row.collapsed() ? (
                "expand"
            ) : "collapse";

        return (
            bike[k](peers),
            `${k} ${peers.length} rows.`
        );
    })() : "No documents open in Bike";
})();

(To test in Script Editor, set the language selector at top left to JavaScript)

See: Using Scripts - Bike


(Perhaps binding it to a keyboard shortcut or other trigger using something like Keyboard Maestro or FastScripts)

1 Like

Interesting, I actually didn’t know about that shortcut.

I think for now I’m going to leave those shortcuts as they are. I feel like focus in is more important in Bike and would like to keep Command-Click as that shortcut for now.

With that said I expect most people don’t know about that shortcut, just as I didn’t know about the shortcut you describe. At some point I might revisit Bike’s handle functionality and see if I can make focus in/out easier to accomplish from the handle. Seems many outliners now default to focus in/out on handle click instead of expand/collapse. Anyway I might revisit that, but it will require some thought and testing before I come up with anything.

Last … (and I see @complexpoint has already posted a script… thanks!) for now you can add this sort of functionally through scripting.

Ah great! I hadn’t know about the scripting options, that’s a nice alternative. Thanks @complexpoint for the code, i’ll try that out.

Not sure how customizable you’re aiming to get this, but being able to customize the mouse click would be awesome too. i use option+click and cmd+click all the time in xcode, and sharing the muscle memory would be great. I can see the use of the zoom feature too - maybe double click? then single click to toggle, double to focus, and cmd/option/etc for the rarer options.

anyways, thanks for the app and for giving it a thought! and thanks @complexpoint again for the scripting code alternative

1 Like

I do plan to eventually add application side (as opposed to how AppleScript works) scripting… and that could pretty easily be handled with application side scripting. I still have a list of more basic features that I need to work on before I start more scripting work though.