gui-cs / Terminal.Gui

Cross Platform Terminal UI toolkit for .NET
MIT License
9.59k stars 685 forks source link

Hierarchical table view #2683

Closed LPeter1997 closed 1 month ago

LPeter1997 commented 1 year ago

This is more of a suggestion request, as I don't think this control would be general enough that too many applications could benefit from it. Feel free to close it, if it's not something you want to deal with in this library directly, which is understandable.

My problem arose, when I wanted to visualize local values in our debugger. In something like VS, this is solved by a table view, where names are in the first column and values are in the second. If a value is compound (like an instance), the row becomes expandable, and subelements are shown as table rows indented. Example: image

A table view is not enough here, as if I understood from #1285, I can't just embed a tree-view in the second column or something. A tree-view feels very noisy, and values are hard to align after the field names. It's also harder to read, because there's no visual hint about separating names and values anymore.

Could table view be extended somehow to support this? If so, what would it involve? I'd imagine it would have to be a pretty hefty change, considering it builds on DataTable.

tznind commented 1 year ago

Could table view be extended somehow to support this? If so, what would it involve? I'd imagine it would have to be a pretty hefty change, considering it builds on DataTable.

In v2 the DataTable layer has been abstracted away and there is a new ITableSource which might be able to support this kind of thing.

I can have a think about it

tznind commented 1 year ago

Ok I think this approach might work.

https://github.com/gui-cs/Terminal.Gui/pull/2685

TODO: Need to make the first column use the TreeView actual draw so it gets branch lines etc

Its sort of working but would need a lot of polish

tableOfTrees