Comments (8)
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.
Yes thank you! File picker bubble was added in #343!
from bubbles.
@mahadevans87 sounds great, could you please visualise your idea or sort of? i mean, in ascii graphics 😄
from bubbles.
@quenbyako Is it possible to build something like this?
Source : https://github.com/jarun/nnn
from bubbles.
@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:
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.
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 theModel
.
Wdyt?
from bubbles.
FYI because I just stumbled upon this:
It seems part of an file picker is already available through teacup.
from bubbles.
Was this closed in #343?
from bubbles.
Related Issues (20)
- List interface bug for downstream packages
- `Bug`: Pasting String Bypasses CharLimit in textarea HOT 2
- Table cell padding no longer works since 1ba1200 HOT 15
- Viewport may not scroll down to the end of large text inputs HOT 8
- feat: Add NumberInput in bubbles HOT 4
- textinput: add support for wrapping the prompt HOT 2
- How to define the color of a specified cell in a table
- List : list panel pushed into title/status panels by padding on items HOT 1
- Table cell selection
- table printing breaks in narrow windows HOT 2
- styled placeholders HOT 2
- Slim cursor HOT 2
- viewport: ANSI color information seems to be bleeding into surrounding text
- Running on Windows 7 results in an error. HOT 1
- textinput: when `Width` is larger than the capacity of the placeholder, it causes a panic
- table: SelectedStyle is not inherited for `StyleFunc`
- [Feature Request] Directory Picker
- List `Model` `Index` returns index offset based on filtered list, but `SetItem` expects global offset in items list. HOT 2
- JoinHorizontal should use top/bottom not left/right HOT 4
- textarea: height and buffer-level max line settings
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bubbles.