charmbracelet / bubbles

TUI components for Bubble Tea 🫧

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Artifact on second view

noahfraiture opened this issue · comments

commented

Describe the bug
Hey,
I have a problem with my list rendering, my second model display an artifact from the first one like you can see on the images. Sometimes it it's 'test' but 'jon' which proove that it isn't an element from the second model wrongly render.

func (m model) viewConv() string {
    return m.conv.style.Render(m.conv.list.View()) + "\n"
}

func (m model) updateConv(msg tea.Msg) (tea.Model, tea.Cmd) {
    if msg, ok := msg.(tea.KeyMsg); ok {
        switch msg.Type {
        case tea.KeyEnter:
            if i, ok := m.conv.list.SelectedItem().(itemConv); ok {
              m.chat.conversation = (*Conversation)(&i)
              m.switchToChat()
              m.conv.choice = (*Conversation)(&i) 
            }
        }
    }

    var cmd tea.Cmd
    m.conv.list, cmd = m.conv.list.Update(msg)
    return m, cmd
}

With a view for ai basically the same and an update that does nothing in particular which update the list like here.

Setup

  • Arch linux
  • Kitty with zsh

To Reproduce
Steps to reproduce the behavior:

image_2023-11-13_104341569
image_2023-11-13_104350126