charmbracelet / bubbletea

A powerful little TUI framework 🏗
MIT License
26.72k stars 771 forks source link

Compositing #309

Open antonmedv opened 2 years ago

antonmedv commented 2 years ago

Hi,

I’d like to add autocomplete with dropdown to fx. But find if really difficult. Will be cool if bubbletea has some API to simplify dropdowns/popovers.

For example, I have already colored lines with lipgloss, will be cool to have API to override part of line with differently colored string, but save original colors for beginning and end of string.

meowgorithm commented 2 years ago

No ETA yet, but this in development. It’s a very important feature for us as well. We’ll keep this issue updated with progress.

Related: #79 and https://github.com/charmbracelet/lipgloss/issues/65.

pnsvk commented 2 weeks ago

can you please post the updates (if any) on this ? its more than 2 years now.

meowgorithm commented 2 weeks ago

Hi! So doing this right is fairly complex task because of things like grapheme clusters, emojis, double-width characters, and so on. We're taking a three-step approach, guided somewhat by our own need:

  1. We're building a library for cell-based operations
  2. That library will back a new Bubble Tea renderer
  3. Then we'll use the library to build compositing into Lip Gloss

We're actively working on and testing the first two items right now and, while they're not quite ready yet, things are looking very good.

If you want do simple overlays right now have a look at https://github.com/charmbracelet/lipgloss/pull/102. The code in the example is concise enough that you can just copy the necessary functions to your codebase. We've seen several developers do this in their applications.

antonmedv commented 2 weeks ago

We're building a library for cell-based operations

This is awesome! Does it mean we going to have flex based layout?