notcurses icon indicating copy to clipboard operation
notcurses copied to clipboard

tfman: add structural browser

Open dankamongmen opened this issue 3 years ago • 10 comments

ncman should take the section+subsection structure and stick it into an nctree. this nctree will be anchored at the bottom. it ought be able to toggle the nctree's visibility via some key. some other key ought allow navigation using this nctree. when we navigate through the page not using this tree, it ought still advance the tree, keeping it up to date with what's closest to visible.

dankamongmen avatar Dec 12 '21 03:12 dankamongmen

i've written the necessary hookup code; we need implement nctree_add() now (#2458).

dankamongmen avatar Dec 12 '21 04:12 dankamongmen

some progress has been made

dankamongmen avatar Dec 14 '21 23:12 dankamongmen

notes:

  • ~~they're in the wrong order following the title -- error in nctree_add()?~~
  • ~~make the plane transparent wherever there's no text~~
  • left/right move between main browser and structure browser
  • ~~update structure browser focus as we move through the regular browser~~
  • ~~colorize based on distance from focus~~
  • throw a perimeter around the actual text
  • ~~add a key to toggle the structure menu's visibility~~

dankamongmen avatar Dec 14 '21 23:12 dankamongmen

  ▁▁▁▁▁▁▁                                                                                                                           
 ▕ECRAPPO▏                                                                                                                          
 ▁🮀🮀🭨NAME▏                                                                                                                          
▕SYNOPSIS▏     

dankamongmen avatar Dec 15 '21 02:12 dankamongmen

ok, lots of progress. we can't yet drive from the structure browser, but that's about it. we definitely want a perimeter or some other means to set it off from the rest.

dankamongmen avatar Dec 15 '21 07:12 dankamongmen

i'm retarded. rather than this being a vertical tree, it ought be a ribbon. that way there's no modality, because left/right move along the ribbon, and up/down move within the page. duh. yeah, this was obviously the thing to do. stupid!

dankamongmen avatar Dec 15 '21 07:12 dankamongmen

yeah, we'll do this in dankamongmen/tfman-horizontal-structure

dankamongmen avatar Dec 15 '21 07:12 dankamongmen

so for the horizontal bar...ideally we would show all on-screen topics, right? but we might not have room. so instead, we want whatever's in the center of the screen to be in the center of the bar. except then we might never be able to show the extrema. so how about: when we've most recently moved down, we show the bottommost section on the rightmost part of the bar, and then whatever else can fit. when we've most recently moved up (and when we start), we show the topmost section on the leftmost part of the bar, and then whatever else can fit. we always keep some minimum spacing between elements, and expand the spacing if there are too few elements. we show partial elements, so the amount of spacing never need change.

dankamongmen avatar Dec 16 '21 21:12 dankamongmen

basics now work. need to polish.

dankamongmen avatar Dec 16 '21 23:12 dankamongmen

looking pretty dope

2021-12-16-182016_1453x1410_scrot

dankamongmen avatar Dec 16 '21 23:12 dankamongmen