Code Monkey home page Code Monkey logo

Comments (6)

wmertens avatar wmertens commented on July 28, 2024 1

Ok, plain search is fine, but I'd indeed like to have this focus mode 🙂
It's just really helpful to see things in a tree structure.

from nix-tree.

utdemir avatar utdemir commented on July 28, 2024 1

Okay, I think this is a good idea. The implementation is going to be a bit tricky, because it affects many places. So I'll probably only start to look at it the next weekend.

from nix-tree.

utdemir avatar utdemir commented on July 28, 2024 1

So, here's some bad news. I think the trivial way to implement this (hide everything which is not either an ancestor or descendent of the "focused" store path) won't be as nice.

Because, imagine having the focused path at the middle pane. You'd expect the left pane to contain the parents of that path, but the above approach does not do that (it'll only show the children of the previously selected grandparent).

I think the ideal would be flipping the dependency graph and apply the mechanism for the right panes to the left pane; so having all parents of the focused path on the left, and their parents on the left of the left and so on (it's hard to explain, sorry).

However, it is tricky to implement. Also it introduces a lot of design issues (what will the sizes mean in that case, how will why-depends/search will work). So, I don't think I'll be able to spend necessary time on it soon enough. However I will keep considering it and maybe we'll figure out a nice way to do this.

from nix-tree.

utdemir avatar utdemir commented on July 28, 2024

Here's how I'd do this right now:

  • nix-tree has already has a search functionality (shortcut s), so I'd use it to search the store path I'm looking for. But it's just a case-insensitive plain text search, so no fancy expressions there.
  • Store paths directly depend on it are on the bottom status bar, called Immediate Parents.
  • nix-tree also has a why-depends mode (shortcut w), and you can see the store path transitively depend on it there. You can even navigate to one of those, highlighting the part there on the main panes.

Does that work for you?

Otherwise, we can have something like a "focus mode", where a shortcut marks the current selected store path "focused"; then only its ancestors and descendents will be visible. Then probably pressing it again will remove the focus. It kind of make sense to me, but I'm afraid of adding too many confusing functionality to it. But please let me know if you prefer something like that, or if you have another suggestion.

from nix-tree.

wmertens avatar wmertens commented on July 28, 2024

Ok, you know best :) although I don't understand the middle pane explanation. Won't you only see connected parts of the graph?

from nix-tree.

utdemir avatar utdemir commented on July 28, 2024

So, let's think about this graph:

example graph

And say, you navigated to node e through root -> a -> b -> e. Your panes would look like this in the current state of nix-tree.

------------------
| [b] | [e] | f |
------------------

But, this does not mean that b is the only parent of e, it merely means that the previous pane contained only b.

I think, if you were to now use the hypothetical "focus" feature on e, you'd prefer to see something like:

-----------------
| [b] | [e] | f |
|  c  |     |   |
|  d  |     |   |
-----------------

This'd make it easier to see which packages depend on e, which I think is closer to what you want. However, implementing this is tricky (mostly UX-wise).

from nix-tree.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.