chore(ui): hypercrush small type treatment

Christian Rocha created

Change summary

internal/ui/logo/logo.go     | 16 ++++++++++++----
internal/ui/model/header.go  | 13 +++++++++++--
internal/ui/model/sidebar.go |  4 +++-
3 files changed, 26 insertions(+), 7 deletions(-)

Detailed changes

internal/ui/logo/logo.go 🔗

@@ -148,10 +148,18 @@ func Render(base lipgloss.Style, version string, compact bool, o Opts) string {
 
 // SmallRender renders a smaller version of the Crush logo, suitable for
 // smaller windows or sidebar usage.
-func SmallRender(t *styles.Styles, width int) string {
-	title := t.Logo.SmallCharm.Render("Charm™")
-	title = fmt.Sprintf("%s %s", title, styles.ApplyBoldForegroundGrad(t.Logo.GradCanvas, "Crush", t.Logo.SmallGradFromColor, t.Logo.SmallGradToColor))
-	remainingWidth := width - lipgloss.Width(title) - 1 // 1 for the space after "Crush"
+func SmallRender(t *styles.Styles, width int, o Opts) string {
+	name := "Crush"
+	if o.Hyper {
+		name = "HYPERCRUSH"
+	}
+	charm := "Charm™"
+	if !o.Hyper {
+		charm = " " + charm
+	}
+	title := t.Logo.SmallCharm.Render(charm)
+	title = fmt.Sprintf("%s %s", title, styles.ApplyBoldForegroundGrad(t.Logo.GradCanvas, name, t.Logo.SmallGradFromColor, t.Logo.SmallGradToColor))
+	remainingWidth := width - lipgloss.Width(title) - 1 // 1 for the space after the name
 	if remainingWidth > 0 {
 		lines := strings.Repeat("╱", remainingWidth)
 		title = fmt.Sprintf("%s %s", title, t.Logo.SmallDiagonals.Render(lines))

internal/ui/model/header.go 🔗

@@ -45,8 +45,17 @@ func newHeader(com *common.Common) *header {
 // after the theme changes.
 func (h *header) refresh() {
 	t := h.com.Styles
-	h.compactLogo = t.Header.Charm.Render("Charm™") + " " +
-		styles.ApplyBoldForegroundGrad(t.Header.LogoGradCanvas, "CRUSH", t.Header.LogoGradFromColor, t.Header.LogoGradToColor) + " "
+	isHyper := h.com.IsHyper()
+	charm := "Charm™"
+	if !isHyper {
+		charm = " " + charm
+	}
+	name := "CRUSH"
+	if isHyper {
+		name = "HYPERCRUSH"
+	}
+	h.compactLogo = t.Header.Charm.Render(charm) + " " +
+		styles.ApplyBoldForegroundGrad(t.Header.LogoGradCanvas, name, t.Header.LogoGradFromColor, t.Header.LogoGradToColor) + " "
 	// Force drawHeader to re-render the wide logo on the next frame.
 	h.width = 0
 	h.logo = ""

internal/ui/model/sidebar.go 🔗

@@ -142,7 +142,9 @@ func (m *UI) drawSidebar(scr uv.Screen, area uv.Rectangle) {
 	cwd := common.PrettyPath(t, m.com.Workspace.WorkingDir(), width)
 	sidebarLogo := m.sidebarLogo
 	if height < logoHeightBreakpoint {
-		sidebarLogo = logo.SmallRender(m.com.Styles, width)
+		sidebarLogo = logo.SmallRender(m.com.Styles, width, logo.Opts{
+			Hyper: m.com.IsHyper(),
+		})
 	}
 	blocks := []string{
 		sidebarLogo,