summaryrefslogtreecommitdiff
path: root/internal/tui/dashboard
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-03-06 16:38:41 +0200
committerPaul Buetow <paul@buetow.org>2026-03-06 16:38:41 +0200
commit1d72e80ed340564c6c2d37366e20896aa00341e2 (patch)
treef59ece0abc4b8d7de77a8f8214e0c7392a6bf700 /internal/tui/dashboard
parent91c0d807274defe2bc62db773f2ac0695dbb91c5 (diff)
refactor: use interfaces for TUI runtime binding sources (task 382)
Diffstat (limited to 'internal/tui/dashboard')
-rw-r--r--internal/tui/dashboard/model.go11
1 files changed, 5 insertions, 6 deletions
diff --git a/internal/tui/dashboard/model.go b/internal/tui/dashboard/model.go
index 10d8b49..d10a91a 100644
--- a/internal/tui/dashboard/model.go
+++ b/internal/tui/dashboard/model.go
@@ -4,7 +4,6 @@ import (
"strings"
"time"
- coreflamegraph "ior/internal/flamegraph"
"ior/internal/statsengine"
common "ior/internal/tui/common"
"ior/internal/tui/eventstream"
@@ -41,7 +40,7 @@ type Model struct {
engine SnapshotSource
latest *statsengine.Snapshot
- liveTrie *coreflamegraph.LiveTrie
+ liveTrie flamegraphtui.LiveTrieSource
width int
height int
@@ -62,12 +61,12 @@ type Model struct {
}
// NewModel creates a dashboard model with default refresh cadence.
-func NewModel(engine SnapshotSource, streamSource *eventstream.RingBuffer) Model {
+func NewModel(engine SnapshotSource, streamSource eventstream.Source) Model {
return NewModelWithConfig(engine, streamSource, defaultRefreshMs, common.Keys)
}
// NewModelWithConfig creates a dashboard model with explicit refresh and keys.
-func NewModelWithConfig(engine SnapshotSource, streamSource *eventstream.RingBuffer, refreshMs int, keys common.KeyMap) Model {
+func NewModelWithConfig(engine SnapshotSource, streamSource eventstream.Source, refreshMs int, keys common.KeyMap) Model {
if refreshMs <= 0 {
refreshMs = defaultRefreshMs
}
@@ -362,12 +361,12 @@ func (m Model) BlocksGlobalShortcuts(msg tea.KeyPressMsg) bool {
}
// SetStreamSource updates the live stream source used by the stream tab.
-func (m *Model) SetStreamSource(source *eventstream.RingBuffer) {
+func (m *Model) SetStreamSource(source eventstream.Source) {
m.streamModel.SetSource(source)
}
// SetLiveTrie updates the live trie source used by the flamegraph tab.
-func (m *Model) SetLiveTrie(liveTrie *coreflamegraph.LiveTrie) {
+func (m *Model) SetLiveTrie(liveTrie flamegraphtui.LiveTrieSource) {
m.liveTrie = liveTrie
m.flamegraphModel.SetLiveTrie(liveTrie)
if m.width > 0 && m.height > 0 {