From a4488ca06a3e0f7427fc2979b54aeb3877272e72 Mon Sep 17 00:00:00 2001 From: Christian Rocha Date: Mon, 27 Apr 2026 14:32:47 -0400 Subject: [PATCH] feat(ui): switch to hyper theme when provider hyper is chosen --- internal/ui/common/common.go | 6 ++++++ internal/ui/model/header.go | 2 +- internal/ui/model/ui.go | 5 +++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/internal/ui/common/common.go b/internal/ui/common/common.go index 43a195826097daa368af7d7b7e93fb4fdecc2f23..88d6f1f64312a48dde5474ac77e4bcef0a141b9a 100644 --- a/internal/ui/common/common.go +++ b/internal/ui/common/common.go @@ -55,6 +55,12 @@ func largeModelProviderID(ws workspace.Workspace) string { return cfg.Models[config.SelectedModelTypeLarge].Provider } +// IsHyper reports whether the currently selected large model is provided +// by Hyper. +func (c *Common) IsHyper() bool { + return largeModelProviderID(c.Workspace) == "hyper" +} + // CenterRect returns a new [Rectangle] centered within the given area with the // specified width and height. func CenterRect(area uv.Rectangle, width, height int) uv.Rectangle { diff --git a/internal/ui/model/header.go b/internal/ui/model/header.go index 7c15f58e1f1784f385dce61d1166fd7131b3f959..24af9e5ba622c74e3e3d81149197b58460e9fcb2 100644 --- a/internal/ui/model/header.go +++ b/internal/ui/model/header.go @@ -63,7 +63,7 @@ func (h *header) drawHeader( ) { t := h.com.Styles if width != h.width || compact != h.compact { - h.logo = renderLogo(h.com.Styles, compact, width) + h.logo = renderLogo(h.com.Styles, compact, h.com.IsHyper(), width) } h.width = width diff --git a/internal/ui/model/ui.go b/internal/ui/model/ui.go index 9cc33a339fa268ce9dddba668e7f5ed289bbb57a..5cec262b8fc8cdbd5619f05c764056ecff0d926e 100644 --- a/internal/ui/model/ui.go +++ b/internal/ui/model/ui.go @@ -2984,7 +2984,7 @@ func (m *UI) renderEditorView(width int) string { // cacheSidebarLogo renders and caches the sidebar logo at the specified width. func (m *UI) cacheSidebarLogo(width int) { - m.sidebarLogo = renderLogo(m.com.Styles, true, width) + m.sidebarLogo = renderLogo(m.com.Styles, true, m.com.IsHyper(), width) } // applyTheme replaces the active styles with the given theme and @@ -3691,7 +3691,7 @@ func (m *UI) disableDockerMCP() tea.Msg { } // renderLogo renders the Crush logo with the given styles and dimensions. -func renderLogo(t *styles.Styles, compact bool, width int) string { +func renderLogo(t *styles.Styles, compact, hyper bool, width int) string { return logo.Render(t.Logo.GradCanvas, version.Version, compact, logo.Opts{ FieldColor: t.Logo.FieldColor, TitleColorA: t.Logo.TitleColorA, @@ -3699,5 +3699,6 @@ func renderLogo(t *styles.Styles, compact bool, width int) string { CharmColor: t.Logo.CharmColor, VersionColor: t.Logo.VersionColor, Width: width, + Hyper: hyper, }) }