fix: Resolve call selection index mismatch by using sorted flows everywhere

This commit is contained in:
Jose Luis Montañes Ojados
2026-01-19 23:29:38 +01:00
parent 65a7cd10f6
commit 1fb7d447a4

View File

@@ -960,7 +960,7 @@ func (m Model) renderAddNodeForm() string {
} }
func (m Model) renderCallDetail() string { func (m Model) renderCallDetail() string {
flows := m.callFlowStore.GetRecentFlows(20) flows := m.callFlowStore.GetSortedFlows()
if m.selectedFlow >= len(flows) || len(flows) == 0 { if m.selectedFlow >= len(flows) || len(flows) == 0 {
return m.styles.Box.Render("No call selected\n\nPress Esc to go back") return m.styles.Box.Render("No call selected\n\nPress Esc to go back")
} }
@@ -1359,7 +1359,7 @@ func (m Model) styleForNode(node *config.NetworkNode) lipgloss.Style {
} }
func (m *Model) updateCallDetailView() { func (m *Model) updateCallDetailView() {
flows := m.callFlowStore.GetRecentFlows(20) flows := m.callFlowStore.GetSortedFlows()
if m.selectedFlow >= len(flows) || len(flows) == 0 { if m.selectedFlow >= len(flows) || len(flows) == 0 {
m.detailsViewport.SetContent("No call selected") m.detailsViewport.SetContent("No call selected")
m.viewport.SetContent("") m.viewport.SetContent("")