feat(ui): switch to hyper theme when provider hyper is chosen

Christian Rocha created

Change summary

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(-)

Detailed changes

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 {

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

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,
 	})
 }