Skip to content

Commit fdc2a0c

Browse files
authored
Merge pull request #44 from kpumuk/remove-nerd-font-glyph
Stop requiring a Nerd Font for a single glyph
2 parents 100cf33 + 1a08eab commit fdc2a0c

7 files changed

Lines changed: 19 additions & 35 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
> Latest installation instructions for different platforms are available on the [Lazykiq website](https://kpumuk.github.io/lazykiq/docs/getting-started/installation/).
2929
3030
> [!NOTE]
31-
> Lazykiq uses special glyphs in the UI; without a Nerd Font in your terminal some characters may render incorrectly.
31+
> Lazykiq uses Unicode box-drawing and chart glyphs in the UI; a modern UTF-8 terminal font is recommended.
3232
3333
You can download the latest release from the [Releases](https://github.com/kpumuk/lazykiq/releases) page for your platform.
3434

doc/docs/getting-started/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Download the latest release for your platform from the
1515
[GitHub Releases page](https://github.com/kpumuk/lazykiq/releases).
1616

1717
{{< callout context="note" title="Note" icon="outline/info-circle" >}}
18-
Lazykiq uses special glyphs in the UI; without a Nerd Font in your terminal some characters may render incorrectly.
18+
Lazykiq uses Unicode box-drawing and chart glyphs in the UI; a modern UTF-8 terminal font is recommended.
1919
{{< /callout >}}
2020

2121
## Homebrew Tap

internal/ui/app.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,8 @@ func New(client sidekiq.API, version string, dangerousActionsEnabled bool, devTr
193193
),
194194
stackbar: stackbar.New(
195195
stackbar.WithStyles(stackbar.Styles{
196-
Bar: styles.StackBar,
197-
Item: styles.StackItem,
198-
Arrow: styles.StackArrow,
196+
Bar: styles.StackBar,
197+
Item: styles.StackItem,
199198
}),
200199
stackbar.WithStack([]string{viewRegistry[viewDashboard].Name()}),
201200
),

internal/ui/components/stackbar/stackbar.go

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,15 @@ import (
1010

1111
// Styles holds the styles needed by the stack bar.
1212
type Styles struct {
13-
Bar lipgloss.Style
14-
Item lipgloss.Style
15-
Arrow lipgloss.Style
13+
Bar lipgloss.Style
14+
Item lipgloss.Style
1615
}
1716

1817
// DefaultStyles returns default styles for the stack bar.
1918
func DefaultStyles() Styles {
2019
return Styles{
21-
Bar: lipgloss.NewStyle().Padding(0, 1),
22-
Item: lipgloss.NewStyle().Padding(0, 1),
23-
Arrow: lipgloss.NewStyle(),
20+
Bar: lipgloss.NewStyle().Padding(0, 1),
21+
Item: lipgloss.NewStyle().Padding(0, 1),
2422
}
2523
}
2624

@@ -122,5 +120,5 @@ func (m Model) View() string {
122120
}
123121

124122
func formatLabel(styles Styles, label string) string {
125-
return styles.Item.Render(label) + styles.Arrow.Render("")
123+
return styles.Item.Render(label)
126124
}

internal/ui/components/stackbar/stackbar_test.go

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@ import (
1111

1212
func TestViewDimensions(t *testing.T) {
1313
styles := Styles{
14-
Bar: lipgloss.NewStyle(),
15-
Item: lipgloss.NewStyle(),
16-
Arrow: lipgloss.NewStyle(),
14+
Bar: lipgloss.NewStyle(),
15+
Item: lipgloss.NewStyle(),
1716
}
1817

1918
tests := map[string]struct {
@@ -47,19 +46,13 @@ func TestViewDimensions(t *testing.T) {
4746
}
4847

4948
func TestViewFormatsStack(t *testing.T) {
50-
const arrow = ""
5149
labels := []string{"Errors", "Detail"}
52-
items := []string{
53-
labels[0] + arrow,
54-
labels[1] + arrow,
55-
}
56-
expected := strings.Join(items, " ")
50+
expected := strings.Join(labels, " ")
5751

5852
m := New(
5953
WithStyles(Styles{
60-
Bar: lipgloss.NewStyle(),
61-
Item: lipgloss.NewStyle(),
62-
Arrow: lipgloss.NewStyle(),
54+
Bar: lipgloss.NewStyle(),
55+
Item: lipgloss.NewStyle(),
6356
}),
6457
WithStack(labels),
6558
)
@@ -72,9 +65,8 @@ func TestViewFormatsStack(t *testing.T) {
7265
func TestGoldenStackBar(t *testing.T) {
7366
m := New(
7467
WithStyles(Styles{
75-
Bar: lipgloss.NewStyle(),
76-
Item: lipgloss.NewStyle(),
77-
Arrow: lipgloss.NewStyle(),
68+
Bar: lipgloss.NewStyle(),
69+
Item: lipgloss.NewStyle(),
7870
}),
7971
WithWidth(40),
8072
WithStack([]string{"Errors", "Detail", "Payload"}),
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Errors Detail Payload
1+
Errors Detail Payload

internal/ui/theme/theme.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,8 @@ type Styles struct {
201201
NavBrand lipgloss.Style
202202

203203
// Stack bar
204-
StackBar lipgloss.Style
205-
StackItem lipgloss.Style
206-
StackArrowLeft lipgloss.Style
207-
StackArrow lipgloss.Style
204+
StackBar lipgloss.Style
205+
StackItem lipgloss.Style
208206

209207
// Content
210208
ViewTitle lipgloss.Style
@@ -318,9 +316,6 @@ func NewStyles() Styles {
318316
Background(t.StackBarBg).
319317
Padding(0, 1),
320318

321-
StackArrow: lipgloss.NewStyle().
322-
Foreground(t.StackBarBg),
323-
324319
// Content
325320
ViewTitle: lipgloss.NewStyle().
326321
Foreground(t.Primary).

0 commit comments

Comments
 (0)