feat: UI legend

This commit is contained in:
2026-01-25 22:28:53 -06:00
parent 6165a10481
commit 7964d4e183
3 changed files with 124 additions and 1 deletions

View File

@@ -13,6 +13,7 @@ import (
"playback/internal/srt"
"playback/internal/ui"
"playback/internal/ui/header"
"playback/internal/ui/legend"
"playback/internal/ui/transcript"
"playback/internal/ui/waveform"
)
@@ -33,6 +34,7 @@ type Model struct {
// UI Components
header header.Model
legend legend.Model
waveform waveform.Model
transcript transcript.Model
@@ -56,6 +58,7 @@ func New(audioPath, transcriptPath string) Model {
audioPath: audioPath,
transcriptPath: transcriptPath,
header: header.New(),
legend: legend.New(),
waveform: waveform.New(),
transcript: transcript.New(),
}
@@ -231,13 +234,17 @@ func (m *Model) updateLayout() {
// Waveform: 5 lines
waveformHeight := 5
// Legend: 1 line
legendHeight := 1
// Status bar: 1 line
statusHeight := 1
// Transcript: remaining space
transcriptHeight := m.height - headerHeight - waveformHeight - statusHeight - 2
transcriptHeight := m.height - headerHeight - waveformHeight - legendHeight - statusHeight - 2
m.header.SetWidth(m.width)
m.legend.SetWidth(m.width)
m.waveform.SetSize(m.width, waveformHeight)
m.transcript.SetSize(m.width, transcriptHeight)
}
@@ -287,6 +294,9 @@ func (m Model) View() string {
// Transcript
transcriptView := m.transcript.View()
// Legend
legendView := m.legend.View()
// Status bar
statusView := m.renderStatus()
@@ -296,6 +306,7 @@ func (m Model) View() string {
"",
waveformView,
transcriptView,
legendView,
statusView,
)
}