From 33b5fe236a204a3d1d935a94e1d1d5f3a6f312a8 Mon Sep 17 00:00:00 2001 From: adamdottv <2363879+adamdottv@users.noreply.github.com> Date: Tue, 1 Jul 2025 07:57:31 -0500 Subject: fix(tui): better message rendering performance --- packages/tui/internal/theme/loader.go | 4 ++++ packages/tui/internal/theme/system.go | 4 ++++ packages/tui/internal/theme/theme.go | 2 ++ 3 files changed, 10 insertions(+) (limited to 'packages/tui/internal/theme') diff --git a/packages/tui/internal/theme/loader.go b/packages/tui/internal/theme/loader.go index 82c2fcd24..b3d2f0982 100644 --- a/packages/tui/internal/theme/loader.go +++ b/packages/tui/internal/theme/loader.go @@ -27,6 +27,10 @@ type LoadedTheme struct { name string } +func (t *LoadedTheme) Name() string { + return t.name +} + type colorRef struct { value any resolved bool diff --git a/packages/tui/internal/theme/system.go b/packages/tui/internal/theme/system.go index 7524bb3f9..8dd48cfec 100644 --- a/packages/tui/internal/theme/system.go +++ b/packages/tui/internal/theme/system.go @@ -27,6 +27,10 @@ func NewSystemTheme(terminalBg color.Color, isDark bool) *SystemTheme { return theme } +func (t *SystemTheme) Name() string { + return "system" +} + // initializeColors sets up all theme colors func (t *SystemTheme) initializeColors() { // Generate gray scale based on terminal background diff --git a/packages/tui/internal/theme/theme.go b/packages/tui/internal/theme/theme.go index 9b5b7b915..d5d27a1e1 100644 --- a/packages/tui/internal/theme/theme.go +++ b/packages/tui/internal/theme/theme.go @@ -8,6 +8,8 @@ import ( // All colors must be defined as compat.AdaptiveColor to support // both light and dark terminal backgrounds. type Theme interface { + Name() string + // Background colors Background() compat.AdaptiveColor // Radix 1 BackgroundPanel() compat.AdaptiveColor // Radix 2 -- cgit v1.2.3