diff --git a/internal/logging/writer.go b/internal/logging/writer.go index 9e597f5c95b1207d7c4530a216b72259cf092ea9..06a5330e314093235e2976d709b5d61e26a223ab 100644 --- a/internal/logging/writer.go +++ b/internal/logging/writer.go @@ -18,7 +18,8 @@ func (w *writer) Write(p []byte) (int, error) { d := logfmt.NewDecoder(bytes.NewReader(p)) for d.ScanRecord() { msg := LogMessage{ - ID: fmt.Sprintf("%d", time.Now().UnixNano()), + ID: fmt.Sprintf("%d", time.Now().UnixNano()), + Time: time.Now(), } for d.ScanKeyval() { switch string(d.Key()) { diff --git a/internal/tui/components/core/status.go b/internal/tui/components/core/status.go index 6c4dda0a42350a3da0f082ce9eba108065656827..d2f14ad00e26c7c97bee9e602acb1d546ac3b4b2 100644 --- a/internal/tui/components/core/status.go +++ b/internal/tui/components/core/status.go @@ -97,6 +97,6 @@ func (m statusCmp) model() string { func NewStatusCmp() tea.Model { return &statusCmp{ - messageTTL: 15 * time.Second, + messageTTL: 10 * time.Second, } } diff --git a/internal/tui/components/repl/sessions.go b/internal/tui/components/repl/sessions.go index 093337b188f3bac6a08a77ced937b6dc4500fb7b..d47c2a19ec27f55c8aa49460d9a5fbafc0ca82b1 100644 --- a/internal/tui/components/repl/sessions.go +++ b/internal/tui/components/repl/sessions.go @@ -123,6 +123,7 @@ func (i *sessionsCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) { case tea.KeyMsg: switch { case key.Matches(msg, sessionKeyMapValue.Select): + i.app.Logger.PersistInfo("Session selected") selected := i.list.SelectedItem() if selected == nil { return i, nil diff --git a/internal/tui/tui.go b/internal/tui/tui.go index c94a6b02073a51e3fb62b496ca85ddb8ec2d879d..233b189dd1de917aa784dda80f2d05cf746a2017 100644 --- a/internal/tui/tui.go +++ b/internal/tui/tui.go @@ -131,6 +131,7 @@ func (a appModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) { TTL: msg.Payload.PersistTime, }) } + cmds = append(cmds, cmd) } case util.ClearStatusMsg: a.status, _ = a.status.Update(msg) @@ -205,8 +206,6 @@ func (a appModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) { } } - a.status, cmd = a.status.Update(msg) - cmds = append(cmds, cmd) if a.dialogVisible { d, cmd := a.dialog.Update(msg) a.dialog = d.(core.DialogCmp)