blessed-contrib icon indicating copy to clipboard operation
blessed-contrib copied to clipboard

Export examples/explorer as a requirable widget

Open dbkaplun opened this issue 9 years ago • 6 comments

Can you please elaborate a bit further? I am willing to take some of this on, but would like to understand your use case so I can figure out a few things like...

What sort of configuration options would you like to see available? What events do you want to be able to hook into? (just file selections, directories, up/down, etc) Does it need to be refreshable? Do things need to be marked as 'selected'?

digitallyserviced avatar Jun 27 '15 18:06 digitallyserviced

Theoretically I would be using this in slap to replace the lightly customized but mostly default blessed.FileManager.

Amenable to discussion:

  • Should hook into a select event where a row is clicked or Enter is pressed while one is focused
  • file and directory events cool too
  • Ability to get current focused row
  • Selecting a directory by clicking on it or pressing Enter should unfold the directory
    • Maybe make this cancelable?
  • Should be able to refresh an arbitrary level, only one level deep would be good enough
  • Each row's display value from beginning to end should be editable, regardless of internal state
  • Multiple selections would be great but not necessary
  • Root should be selectable via API

dbkaplun avatar Jun 27 '15 19:06 dbkaplun

cc @theredcat

yaronn avatar Jun 29 '15 20:06 yaronn

Don't look complicated. The select event is already here and can be hooked to handle higher-levels events.

I may have a simple way to integrate this just by overloading the constructor of Tree

theredcat avatar Jun 29 '15 21:06 theredcat

@dbkaplun would you like to have the file stats object as a event callback parameter? Or the path will be enough?

theredcat avatar Jun 29 '15 21:06 theredcat

For the sake of performance, simply a path will be enough, but if you already get a Stats object then it's nice to have.

dbkaplun avatar Jun 29 '15 23:06 dbkaplun