Coder Social home page Coder Social logo

Comments (8)

meowgorithm avatar meowgorithm commented on August 20, 2024 2

Yeah, it's very possible to build something like that with Bubble Tea. I'd put the file listing in a viewport component so it can scroll.

Modu is a good reference on how to do implement something like that from a UI standpoint.

We're big fans of nnn, btw.

from bubbles.

maaslalani avatar maaslalani commented on August 20, 2024 1

Yes thank you! File picker bubble was added in #343!

from bubbles.

quenbyako avatar quenbyako commented on August 20, 2024

@mahadevans87 sounds great, could you please visualise your idea or sort of? i mean, in ascii graphics 😄

from bubbles.

mahadevans87 avatar mahadevans87 commented on August 20, 2024

@quenbyako Is it possible to build something like this?

image

Source : https://github.com/jarun/nnn

from bubbles.

quenbyako avatar quenbyako commented on August 20, 2024

@meowgorithm @mahadevans87 quick ask: does go has some package that you know, which is providing icon utilities or any font stuff, which we can use?

i've created already file toolbox and ls-alternative looks like this result on you screenshot:
image

It's looks not sooooo cool looking, but it might be a goof start point on working with this feature. My general problem was on managin all icons from font, for example: this project allows you to add custom font with icon glyphs in private unicode area. Cool? Cool. But main problem is that you generally don't know which unicode glyph id contains specific icon. So i have abadoned this toolbox, cause i didn't find nice framework for terminal ui rendering. Maybe we can find/implement this feature and add icons support for bubbletea?

Also, it's off topic generally, but i working on cli argument parser, this filetools project use it, i want to make typical project structure, which can be used as template for any cli app. But it's really off topic, i just want warn you about a lot of problems with this toolbox, if i'll opensource it

from bubbles.

mrusme avatar mrusme commented on August 20, 2024

I'm in need for a file picker as well and I came across this issue. I'm wondering whether it makes sense to actually build a file picker from scratch or instead integrate something that supports running arbitary commands, display their output within a specified area while the command runs and then read a temporary file after the command has exited. It would also need to forward input to the command for as long as the command is still running.

With this generic implementation users could run any terminal file manager they're comfortable with (e.g. lf -selection-path /tmp/bla, nnn -p -, ranger something something, ...) and the bubble wouldn't actually need to implement all the logic that usually goes into a good file manager. It could offer some presets for popular file managers like lf, nnn, ranger, mc, etc.

The flow would be:

  • Render a "Select file ..." button somewhere that would activate the file picker bubble (this doesn't have to be part of the implementation though as button interactions haven't yet been clearly specififed by Bubble Tea)
  • Display the virtual terminal bubble area that outputs the command's stdout and forward all stdin to the command, until the command has quit
  • Run the command with a temporary file for outputting the selected file(s), e.g. lf -selection-path /tmp/bla
  • Wait for the command to quit, then read /tmp/bla and provide its content as []string via a .Value() function on the Model.

Wdyt?

from bubbles.

mrusme avatar mrusme commented on August 20, 2024

FYI because I just stumbled upon this:

It seems part of an file picker is already available through teacup.

from bubbles.

KaiAragaki avatar KaiAragaki commented on August 20, 2024

Was this closed in #343?

from bubbles.

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.