From d3b31f02c8ca86e26937974b8bbe1c6c57091b27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jose=20Luis=20Monta=C3=B1es=20Ojados?= Date: Mon, 19 Jan 2026 21:34:40 +0100 Subject: [PATCH] feat: Enhance export with IPs and add controls legend to TUI --- internal/tui/model.go | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/internal/tui/model.go b/internal/tui/model.go index 0ebc629..32f0c3b 100644 --- a/internal/tui/model.go +++ b/internal/tui/model.go @@ -401,7 +401,7 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { leftW := innerW / 2 rightW := innerW - leftW - leftTotalH := m.height - 3 + leftTotalH := m.height - 4 // -4 for Nav, Status, and Help Footer leftTopH := leftTotalH / 3 if leftTopH < 10 { leftTopH = 10 @@ -927,7 +927,7 @@ func (m Model) renderCallDetail() string { rightW := innerW - leftW // Left Pane Heights - leftTotalH := m.height - 3 // Nav + Status + leftTotalH := m.height - 4 // Nav + Status + Help Footer // Adjust for borders: we have two boxes stacked. // Let's say we split space 33% / 66%. leftTopH := leftTotalH / 3 @@ -1048,7 +1048,10 @@ func (m Model) renderCallDetail() string { rightContent := lipgloss.JoinVertical(lipgloss.Left, flowTitle, "\n", m.viewport.View()) rightRendered := rightStyle.Render(rightContent) - return lipgloss.JoinHorizontal(lipgloss.Top, leftCol, rightRendered) + content := lipgloss.JoinHorizontal(lipgloss.Top, leftCol, rightRendered) + + help := m.styles.Help.Render("[Tab] Switch Pane • [↑/↓] Scroll • [e] Export Log • [Esc] Back") + return lipgloss.JoinVertical(lipgloss.Left, content, help) } func (m Model) renderNav() string { @@ -1481,7 +1484,14 @@ func (m *Model) exportCallToLog(flow *sip.CallFlow, filename string) error { // Resolve IPs src := m.networkMap.LabelForIP(pkt.SourceIP) + if src != pkt.SourceIP { + src = fmt.Sprintf("%s (%s)", src, pkt.SourceIP) + } + dst := m.networkMap.LabelForIP(pkt.DestIP) + if dst != pkt.DestIP { + dst = fmt.Sprintf("%s (%s)", dst, pkt.DestIP) + } fmt.Fprintf(f, "%d. [%s] %s %s %s (%s line %d)\n", i+1,