fix(ui): refresh activity panel when switching selected job
The "Selected job activity" list kept showing the previous job's entries when a different job was selected. dp.update() reassigned the backing slice but never refreshed the widget.List, and only the refreshView path appended an explicit refresh. Move d.logs.Refresh() into update()/clear() so every caller redraws the panel. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -87,6 +87,10 @@ func (d *detailsPanel) update(j job, rt *domain.JobRuntime, globalOverlapPolicy
|
|||||||
d.stats.SetText(app.DisplayStats(rt))
|
d.stats.SetText(app.DisplayStats(rt))
|
||||||
d.commandOutput.SetText(rt.Output)
|
d.commandOutput.SetText(rt.Output)
|
||||||
d.selectedLogs = lastJobLogs(rt.Logs)
|
d.selectedLogs = lastJobLogs(rt.Logs)
|
||||||
|
// The activity list renders d.selectedLogs but, unlike the labels above whose
|
||||||
|
// SetText refreshes them, only its backing slice changed. Refresh it here so
|
||||||
|
// switching jobs immediately redraws the panel instead of keeping stale rows.
|
||||||
|
d.logs.Refresh()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *detailsPanel) clear() {
|
func (d *detailsPanel) clear() {
|
||||||
@@ -103,6 +107,7 @@ func (d *detailsPanel) clear() {
|
|||||||
d.stats.SetText("")
|
d.stats.SetText("")
|
||||||
d.commandOutput.SetText("")
|
d.commandOutput.SetText("")
|
||||||
d.selectedLogs = nil
|
d.selectedLogs = nil
|
||||||
|
d.logs.Refresh()
|
||||||
}
|
}
|
||||||
|
|
||||||
// container assembles the details pane layout: metadata rows pin to the top,
|
// container assembles the details pane layout: metadata rows pin to the top,
|
||||||
|
|||||||
Reference in New Issue
Block a user