Skip to content

Commit 4700e34

Browse files
chore: Improve build and UI elements
- Add OS-specific build logic to Makefile - Use consistent icon constants in UI - Remove unused humanTime function
1 parent 5a6cd5b commit 4700e34

4 files changed

Lines changed: 25 additions & 30 deletions

File tree

Makefile

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
1-
.PHONY: build test lint clean run fmt
1+
.PHONY: build test lint clean run fmt install
22

33
BINARY_NAME=kairo
44

5+
ifeq ($(OS),Windows_NT)
6+
EXE=.exe
7+
RM=del /Q
8+
RUN=.\$(BINARY_NAME)$(EXE)
9+
else
10+
EXE=
11+
RM=rm -f
12+
RUN=./$(BINARY_NAME)
13+
endif
14+
515
fmt:
616
go fmt ./...
717

818
build:
9-
go build -trimpath -ldflags "-s -w" -o $(BINARY_NAME) ./cmd/kairo
19+
go build -trimpath -ldflags "-s -w" -o $(BINARY_NAME)$(EXE) ./cmd/kairo
1020

1121
test:
1222
go test ./...
@@ -16,11 +26,10 @@ lint:
1626

1727
clean:
1828
go clean
19-
rm -f $(BINARY_NAME)
20-
rm -f $(BINARY_NAME).exe
29+
$(RM) $(BINARY_NAME)$(EXE)
2130

2231
run: build
23-
./$(BINARY_NAME)
32+
$(RUN)
2433

2534
install:
2635
go install ./cmd/kairo

internal/app/model.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -721,12 +721,12 @@ func (m *Model) renderFooter() string {
721721
left = m.s.BadgeBad.Render(" UNINSTALL? ") + " " + m.s.Muted.Render("y/enter confirm • n/esc cancel")
722722
default:
723723
left = " " + m.s.Muted.Render(
724-
fk(m.km.Palette)+" 󰘥 • "+
725-
fk(m.km.NewTask)+" 󰈄 • "+
726-
"g 󰑐 • "+
727-
fk(m.km.DeleteTask)+" 󰅙 • "+
728-
fk(m.km.Help)+" 󰋼 • "+
729-
fk(m.km.ViewInbox)+"-"+fk(m.km.ViewPriority)+" 󰈈 ",
724+
fk(m.km.Palette)+" "+styles.IconPalette+" • "+
725+
fk(m.km.NewTask)+" "+styles.IconNew+" • "+
726+
"g "+styles.IconSync+" • "+
727+
fk(m.km.DeleteTask)+" "+styles.IconDelete+" • "+
728+
fk(m.km.Help)+" "+styles.IconHelp+" • "+
729+
fk(m.km.ViewInbox)+"-"+fk(m.km.ViewPriority)+" "+styles.IconView+" ",
730730
)
731731
}
732732

internal/ui/detail/model.go

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
package detail
22

33
import (
4-
"fmt"
54
"strings"
6-
"time"
75

86
"github.com/charmbracelet/glamour"
97
"github.com/charmbracelet/lipgloss"
@@ -179,20 +177,3 @@ func (m *Model) renderMarkdown(src string) string {
179177
m.mdCache = strings.TrimRight(out, "\n")
180178
return m.mdCache
181179
}
182-
183-
func humanTime(t time.Time, now time.Time) string {
184-
d := now.Sub(t)
185-
if d < 0 {
186-
d = -d
187-
}
188-
switch {
189-
case d < time.Minute:
190-
return "just now"
191-
case d < time.Hour:
192-
return fmt.Sprintf("%dm ago", int(d.Minutes()))
193-
case d < 24*time.Hour:
194-
return fmt.Sprintf("%dh ago", int(d.Hours()))
195-
default:
196-
return fmt.Sprintf("%dd ago", int(d.Hours()/24))
197-
}
198-
}

internal/ui/styles/styles.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ const (
2828
IconHelp = "? "
2929
IconTask = "❖ "
3030
IconPlugin = "🧩 "
31+
// Additional safe icons for UI affordances
32+
IconPalette = "🔎 "
33+
IconNew = "✚ "
34+
IconDelete = "🗑 "
35+
IconView = "▣ "
3136
)
3237

3338
// Design System Constants

0 commit comments

Comments
 (0)