leojs icon indicating copy to clipboard operation
leojs copied to clipboard

The GNX displayed above body text should be a path-based UNL

Open tbpassin opened this issue 2 years ago • 9 comments

Showing a GNX above the panel with the body text is not helpful since it doesn't help the user know anything useful. Either it should be a path-based UNL or it should be removed. See screen shot below: example-marked-gnx

Also, I tend to mistake this node identifier for actual body text. I am unsure if it's text that accidentally got there and that I can delete, or what.

I suggest reconsidering what purpose this serves.

tbpassin avatar Jan 02 '24 17:01 tbpassin

@tbpassin Thanks!

Yes it's a good idea to have the body pane 'breadcrumbs' start with the full path of the selected commander, exactly like a full path UNL !

Thanks again for this suggestion!

boltex avatar Jan 03 '24 00:01 boltex

@tbpassin You can also turn off breadcrumbs for your editor panels in vscode's settings.

boltex avatar Jan 03 '24 00:01 boltex

@tbpassin Aha! this might be implementable with a simple trick!

I only have to make a "translation table" for gnx <- -> headline (they have to be unique, so maybe with added number at the end if more than one opened gnx has the same exact headline to differentiate them) , and then keeping the gnx hidden and instead using the headline string as the actual file name so that the breadcrumb displays the node's headline instead of its gnx.

Hmm.... Would not be that hard or complicated to implement after all! Stay tuned! 😉

boltex avatar Apr 29 '24 23:04 boltex

If you've implemented it, there is a legacy form of the UNL, and that has the path to the node. You could truncate that or leave off the outline part of the path.

Having a separate legacy form of the UNL is relatively new to Leo/Python.

tbpassin avatar Apr 29 '24 23:04 tbpassin

@tbpassin Of course I have! :D haha! (Hover your mouse over the Unl:Gnx item at the bottom of the status bar in leojs or leointeg )

image

boltex avatar Apr 30 '24 00:04 boltex

Nevermind all that : I've just discovered that the VSCODE API possibly has something for controlling the breadcrumbs! The "document symbol provider" part of the API seems to be useful for that.

boltex avatar Apr 30 '24 00:04 boltex

@tbpassin

Progress! but, some constraints : The body panes (and detached body panes) are working on a per-VNode basis (gnx) , not per Position. Since UNLs refer to a position I cant's use them.

So I went for a compromise: The breadcrumbs will show the (short) filename, followed by the headline. 😄 This is very similar to a 'short legacy' UNL...

The only difference with a short legacy unl, is that all the middle headlines leading to the final node are hidden, which would anyways be too long in most cases, if the node is even slightly deep in a tree, the unl would be cut for being too long and we'd miss the headline. So seeing the headline is more useful and practical in some way after all rather than having the whole list of parent's headline preceding the headline. :)

boltex avatar Apr 30 '24 03:04 boltex

After experimenting, the most readable and useful breadcrumb above body text in all circumstances is the headline only, without filename.

I may add a option(s) to also have the short/long filename, etc. before the headline. but the default will be headline only.

boltex avatar Apr 30 '24 03:04 boltex

Only problem now is that the breadcrumbs do not refresh if the headline changes, unless the body changes. Even fireing 'file has changed' event does nothing if the content does not actually change. I'll have to find a way around that!

boltex avatar Apr 30 '24 05:04 boltex