From 04861acf93ebeffdb5beeee78e33ba0ddfad899c Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 22 Feb 2026 23:50:15 +0000 Subject: [PATCH] feat(tui): add custom bubbletea message types Co-Authored-By: Charon --- tui/messages.go | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 tui/messages.go diff --git a/tui/messages.go b/tui/messages.go new file mode 100644 index 0000000..1e6c22c --- /dev/null +++ b/tui/messages.go @@ -0,0 +1,28 @@ +// Copyright (c) 2017-2026 Lethean (https://lt.hn) +// +// Licensed under the European Union Public Licence (EUPL) version 1.2. +// SPDX-License-Identifier: EUPL-1.2 + +package tui + +import ( + "time" + + "forge.lthn.ai/core/go-blockchain/types" +) + +// NodeStatusMsg carries a periodic status snapshot from the Node goroutine +// into the bubbletea update loop. +type NodeStatusMsg struct { + Height uint64 + TopHash types.Hash + Difficulty uint64 + PeerCount int + SyncPct float64 + TipTime time.Time +} + +// ViewChangedMsg tells the footer to update its key hints. +type ViewChangedMsg struct { + Hints []string +}