fixed list items

This commit is contained in:
2025-02-12 18:16:57 +01:00
parent 157a215e87
commit 8e257639e0
5 changed files with 72 additions and 17 deletions

View File

@@ -2,6 +2,7 @@ package ui
import (
"log"
"log/slog"
"github.com/charmbracelet/bubbles/key"
"github.com/charmbracelet/bubbles/list"
@@ -16,9 +17,11 @@ func newItemDelegate(keys *delegateKeyMap, config *cfg.Config) list.DefaultDeleg
d.UpdateFunc = func(msg tea.Msg, m *list.Model) tea.Cmd {
var title string
if entry, ok := m.SelectedItem().(app.DbEntry); ok {
if entry, ok := m.SelectedItem().(item); ok {
title = entry.Title()
slog.Debug("active entry", "entry", title)
} else {
slog.Debug("no active entry")
return nil
}