dendronhq / dendron

The personal knowledge management (PKM) tool that grows as you do!
https://wiki.dendron.so
Apache License 2.0
6.68k stars 252 forks source link

Ways To View Subtrees -- Hoisting #664

Open manunamz opened 3 years ago

manunamz commented 3 years ago

Please Select if your Request is Either something new or an Enhancement

Please select the area your request applys to. (Multiple selections are Possible)

Is your feature request related to a problem? Please describe

This is more of a conceptual request than a feature request because it depends on the form Dendron takes as time goes on. Basically, it would be nice to have the ability to focus on different levels and subtrees -- see Trilium's hoist feature.

I would consider this very low priority, but it's notable that this feature would give Dendron an edge over other apps that support bidrectional/wiki [[links]]: If there is no hierarchy, there is no hoisting. (I suppose one could probably generate sub-graphs tho -- like obsidian's local graph...So maybe I'm wrong on this...🤔)

ghost commented 3 years ago

Hey, I like the sound of that idea, but to clarify, do you mean the hosting for the dendron tree view only? Or do you want this hoisting to do more than to be a UI thing changing what gets shown.

Secondly, as far as I Understand, this hoisting / soloing would be a way to focus on one hierarchy and its children? So it would act like an easy-to-access filter the UI part.


But based on this, we could do more, like the following:

You have a project hierarchy and multiple Projects. Now you Hoist a Specific project (projects.dendron). If you open the lookup now, should the lookup have projects.dendron. be prefilled and editable? Or should it show projects.dendron. but not let you change it? (So you would need to exit the Hoist to look up something from a different Project.) Or should it hide the hoisted Hierarchie assuming you know your hoisted and want to create or look up a note inside the hoisted hierarchy?

aleksey-rowan commented 3 years ago

Hoisting is arguably the best feature of Workflowy (and Dynalist) and seeing something like it in Dendron would be wonderful:

@flammehawk, I think it should do both: filter the hierarchy tree and restrict the lookup to the currently hoisted hierarchy. However, for the lookup restriction to work properly, ^ should be allowed in lookup regex expressions. Right now, projects.dendron., will match both projects.dendron.todo and archive.projects.dendron.todo with the latter being from a different, not hoisted hierarchy. Actually, maybe supporting carets could be a separate, smaller request since it's not directly related to hoisting.

Another use case for hoisting would be working with a multi-vault setup where you want to focus on a single vault and filter results from other vaults from the lookup. The lookup could use the same format as cross-vault links for consistency (although this is a bit verbose and having a shortcut would be nice) dendron://$vaultName/projects.dendron to hoist/filter a specific vault.

There is an outstanding request to consolidate file trees in a multi-value environment (https://github.com/dendronhq/dendron/issues/399), so if the same hierarchy structure is used across all vaults, the visual tree will group notes from different vaults together. If this is implemented, hoisting vaults could be a useful feature to slice through the consolidated tree and work with original hierarchies. Or there could be simply a command to un-merge visual trees 🙂.

If you open the lookup now, should the lookup have projects.dendron. be prefilled and editable?

I would prefer to have it prefilled and editable to lower friction--no need to specifically un-hoist a hierarchy when you want to go back. So, you would have something like a Dendron: Hoist command where you type the name of a hierarchy to focus on. This will automatically filter the Dendron tree view and prefill the lookup with ^projects.dendron (similar to how Go down command works actually only without caret support at the moment). And if you change the hoisted part of the lookup, the focus could revert to the full view. There also could be Dendron: Un-hoist command, just to cover everything.

The Dendron tree view needs a visual indicator to show that a hierarchy is hoisted and probably some UI controls for hoisting/un-hoisting hierarchies for people preferring mouse over keyboard for navigation.

kevinslin commented 3 years ago

I used to be a big workflowy user and being able to hoist hierarchies would be super. we are going to be updating the sidebar next month so that'll be a good time to update the hiearchy view to support hoisting.

I like @aleksey-rowan suggestion about the hoisting implementation. it might be implemented as a lookup modifier instead of a command, something akin to the directChildOnly filter

manunamz commented 3 years ago

@flammehawk I had no specific implementation details in mind: I was solely thinking of the general concept of providing any aperture mechanism to set a sort of radius/subtree-of-focus. 📷

...Not sure how to phrase that more succinctly. 😅

aleksey-rowan commented 3 years ago

@kevinslin

... the hoisting implementation. it might be implemented as a lookup modifier instead of a command, something akin to the directChildOnly filter

As long as the modifier can be enabled via keyboard without having to tab a bunch of time, I'll be happy 🙃 What if you add keybindings to toggle specific modifiers and scope them under inQuickOpen context, so they are only active when the lookup panel is open?