on main help sign in
chore(ui): hypercrush small type treatment
d5b5a9eChristian Rocha
internal/ui/logo/logo.go+12−4
@@ -148,10 +148,18 @@ func Render(base lipgloss.Style, version string, compact bool, o Opts) string {
148
148
149// SmallRender renders a smaller version of the Crush logo, suitable for
149// SmallRender renders a smaller version of the Crush logo, suitable for
150// smaller windows or sidebar usage.
150// smaller windows or sidebar usage.
151−func SmallRender(t *styles.Styles, width int) string {
151+func SmallRender(t *styles.Styles, width int, o Opts) string {
152+ name := "Crush"
153+ if o.Hyper {
154+ name = "HYPERCRUSH"
155+ }
156+ charm := "Charm™"
157+ if !o.Hyper {
158+ charm = " " + charm
159+ }
152− title := t.Logo.SmallCharm.Render("Charm™")
160+ title := t.Logo.SmallCharm.Render(charm)
153− title = fmt.Sprintf("%s %s", title, styles.ApplyBoldForegroundGrad(t.Logo.GradCanvas, "Crush", t.Logo.SmallGradFromColor, t.Logo.SmallGradToColor))
161+ title = fmt.Sprintf("%s %s", title, styles.ApplyBoldForegroundGrad(t.Logo.GradCanvas, name, t.Logo.SmallGradFromColor, t.Logo.SmallGradToColor))
154− remainingWidth := width - lipgloss.Width(title) - 1 // 1 for the space after "Crush"
162+ remainingWidth := width - lipgloss.Width(title) - 1 // 1 for the space after the name
155 if remainingWidth > 0 {
163 if remainingWidth > 0 {
156 lines := strings.Repeat("╱", remainingWidth)
164 lines := strings.Repeat("╱", remainingWidth)
157 title = fmt.Sprintf("%s %s", title, t.Logo.SmallDiagonals.Render(lines))
165 title = fmt.Sprintf("%s %s", title, t.Logo.SmallDiagonals.Render(lines))
internal/ui/model/header.go+11−2
@@ -45,8 +45,17 @@ func newHeader(com *common.Common) *header {
45// after the theme changes.
45// after the theme changes.
46func (h *header) refresh() {
46func (h *header) refresh() {
47 t := h.com.Styles
47 t := h.com.Styles
48+ isHyper := h.com.IsHyper()
49+ charm := "Charm™"
50+ if !isHyper {
51+ charm = " " + charm
52+ }
53+ name := "CRUSH"
54+ if isHyper {
55+ name = "HYPERCRUSH"
56+ }
48− h.compactLogo = t.Header.Charm.Render("Charm™") + " " +
57+ h.compactLogo = t.Header.Charm.Render(charm) + " " +
49− styles.ApplyBoldForegroundGrad(t.Header.LogoGradCanvas, "CRUSH", t.Header.LogoGradFromColor, t.Header.LogoGradToColor) + " "
58+ styles.ApplyBoldForegroundGrad(t.Header.LogoGradCanvas, name, t.Header.LogoGradFromColor, t.Header.LogoGradToColor) + " "
50 // Force drawHeader to re-render the wide logo on the next frame.
59 // Force drawHeader to re-render the wide logo on the next frame.
51 h.width = 0
60 h.width = 0
52 h.logo = ""
61 h.logo = ""
internal/ui/model/sidebar.go+3−1
@@ -142,7 +142,9 @@ func (m *UI) drawSidebar(scr uv.Screen, area uv.Rectangle) {
142 cwd := common.PrettyPath(t, m.com.Workspace.WorkingDir(), width)
142 cwd := common.PrettyPath(t, m.com.Workspace.WorkingDir(), width)
143 sidebarLogo := m.sidebarLogo
143 sidebarLogo := m.sidebarLogo
144 if height < logoHeightBreakpoint {
144 if height < logoHeightBreakpoint {
145− sidebarLogo = logo.SmallRender(m.com.Styles, width)
145+ sidebarLogo = logo.SmallRender(m.com.Styles, width, logo.Opts{
146+ Hyper: m.com.IsHyper(),
147+ })
146 }
148 }
147 blocks := []string{
149 blocks := []string{
148 sidebarLogo,
150 sidebarLogo,