on main help sign in
feat(ui): switch to hyper theme when provider hyper is chosen
a4488caChristian Rocha
internal/ui/common/common.go+6
@@ -55,6 +55,12 @@ func largeModelProviderID(ws workspace.Workspace) string {
55 return cfg.Models[config.SelectedModelTypeLarge].Provider
55 return cfg.Models[config.SelectedModelTypeLarge].Provider
56}
56}
57
57
58+// IsHyper reports whether the currently selected large model is provided
59+// by Hyper.
60+func (c *Common) IsHyper() bool {
61+ return largeModelProviderID(c.Workspace) == "hyper"
62+}
63+
58// CenterRect returns a new [Rectangle] centered within the given area with the
64// CenterRect returns a new [Rectangle] centered within the given area with the
59// specified width and height.
65// specified width and height.
60func CenterRect(area uv.Rectangle, width, height int) uv.Rectangle {
66func CenterRect(area uv.Rectangle, width, height int) uv.Rectangle {
internal/ui/model/header.go+1−1
@@ -63,7 +63,7 @@ func (h *header) drawHeader(
63) {
63) {
64 t := h.com.Styles
64 t := h.com.Styles
65 if width != h.width || compact != h.compact {
65 if width != h.width || compact != h.compact {
66− h.logo = renderLogo(h.com.Styles, compact, width)
66+ h.logo = renderLogo(h.com.Styles, compact, h.com.IsHyper(), width)
67 }
67 }
68
68
69 h.width = width
69 h.width = width
internal/ui/model/ui.go+3−2
@@ -2984,7 +2984,7 @@ func (m *UI) renderEditorView(width int) string {
2984
2984
2985// cacheSidebarLogo renders and caches the sidebar logo at the specified width.
2985// cacheSidebarLogo renders and caches the sidebar logo at the specified width.
2986func (m *UI) cacheSidebarLogo(width int) {
2986func (m *UI) cacheSidebarLogo(width int) {
2987− m.sidebarLogo = renderLogo(m.com.Styles, true, width)
2987+ m.sidebarLogo = renderLogo(m.com.Styles, true, m.com.IsHyper(), width)
2988}
2988}
2989
2989
2990// applyTheme replaces the active styles with the given theme and
2990// applyTheme replaces the active styles with the given theme and
@@ -3691,7 +3691,7 @@ func (m *UI) disableDockerMCP() tea.Msg {
3691}
3691}
3692
3692
3693// renderLogo renders the Crush logo with the given styles and dimensions.
3693// renderLogo renders the Crush logo with the given styles and dimensions.
3694−func renderLogo(t *styles.Styles, compact bool, width int) string {
3694+func renderLogo(t *styles.Styles, compact, hyper bool, width int) string {
3695 return logo.Render(t.Logo.GradCanvas, version.Version, compact, logo.Opts{
3695 return logo.Render(t.Logo.GradCanvas, version.Version, compact, logo.Opts{
3696 FieldColor: t.Logo.FieldColor,
3696 FieldColor: t.Logo.FieldColor,
3697 TitleColorA: t.Logo.TitleColorA,
3697 TitleColorA: t.Logo.TitleColorA,
@@ -3699,5 +3699,6 @@ func renderLogo(t *styles.Styles, compact bool, width int) string {
3699 CharmColor: t.Logo.CharmColor,
3699 CharmColor: t.Logo.CharmColor,
3700 VersionColor: t.Logo.VersionColor,
3700 VersionColor: t.Logo.VersionColor,
3701 Width: width,
3701 Width: width,
3702+ Hyper: hyper,
3702 })
3703 })
3703}
3704}