Skip to content

Commit 8923c16

Browse files
feat: implement Lua extensibility engine for task management and event hooks
- closes #33 - closes #34 - closes #35
1 parent f12c0aa commit 8923c16

5 files changed

Lines changed: 48 additions & 17 deletions

File tree

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.5.3]
9+
10+
### Fixed
11+
- Column alignment broken by selector `|` icon only rendering on active task: now renders dim pipe for all tasks, bright/bold for selected task
12+
- Due field variable width causing column misalignment in list view: now uses fixed 16-character width for consistent alignment
13+
- Edit mode active input field background highlight now uses more prominent Overlay color for improved visibility
14+
15+
### Improved
16+
- Edit mode cursor position visibility: enabled visible blinking cursor combined with enhanced background highlighting for active input fields
17+
- All input fields in edit mode now have consistent high-visibility focus indication
18+
819
## [1.5.2]
920

1021
### Added

VERSION.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.5.2
1+
1.5.3

internal/lua/engine.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func (e *Engine) SetupKairoAPI(L *lua.LState) {
6161
L.SetField(kairo, "notify", L.NewFunction(e.luaNotify))
6262

6363
// Meta
64-
L.SetField(kairo, "version", lua.LString("1.5.2"))
64+
L.SetField(kairo, "version", lua.LString("1.5.3"))
6565

6666
// Set as global
6767
L.SetGlobal("kairo", kairo)

internal/ui/editor/model.go

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ func New(s styles.Styles, mode Mode, t core.Task) Model {
8080
in.PromptStyle = s.Accent.Bold(true)
8181
in.TextStyle = s.Text
8282

83-
// Hide the cursor to avoid rendering artifacts, as we use background
84-
// highlighting for focus indication.
85-
in.Cursor.SetMode(cursor.CursorHide)
83+
// Show a blinking cursor for better cursor position visibility, combined with
84+
// background highlighting for improved focus indication.
85+
in.Cursor.SetMode(cursor.CursorBlink)
8686
}
8787
ti := textinput.New()
8888
ti.Prompt = ""
@@ -330,13 +330,19 @@ func (m Model) View() string {
330330

331331
// Helper for rendering structured fields
332332
renderField := func(icon, label string, input string, focused bool) string {
333-
s := lipgloss.NewStyle().Padding(0, 1)
333+
s := lipgloss.NewStyle()
334334

335335
// Style prompt icon and label based on focus
336336
promptStyle := m.styles.Muted
337337
if focused {
338338
promptStyle = promptStyle.Foreground(m.styles.Theme.Accent).Bold(true)
339-
input = lipgloss.NewStyle().Background(m.styles.Theme.Border).Render(input)
339+
// Use Overlay color for better focus visibility, with bold accent border for extra emphasis
340+
input = lipgloss.NewStyle().
341+
Background(m.styles.Theme.Overlay).
342+
Foreground(m.styles.Theme.Accent).
343+
Bold(true).
344+
Padding(0, 1).
345+
Render(input)
340346
}
341347

342348
prompt := lipgloss.JoinHorizontal(lipgloss.Left, icon, label)

internal/ui/tasklist/model.go

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -438,14 +438,14 @@ func (m Model) renderRow(item TaskItem, selected bool) string {
438438
statusStyle = lipgloss.NewStyle().Foreground(m.styles.Theme.Good).Background(rowBg)
439439
}
440440

441-
// Selection indicator — only the thick left border
442-
indicator := lipgloss.NewStyle().Background(rowBg).Render("")
441+
// Selection indicator — render only for selected task
442+
indicator := " "
443443
if selected {
444444
indicator = lipgloss.NewStyle().
445-
Border(lipgloss.NormalBorder(), false, false, false, true).
446-
BorderForeground(m.styles.Theme.Accent).
445+
Foreground(m.styles.Theme.Accent).
447446
Background(rowBg).
448-
Render(" ")
447+
Bold(true).
448+
Render("│")
449449
}
450450

451451
// Hierarchy indentation and icons
@@ -516,7 +516,7 @@ func (m Model) renderRow(item TaskItem, selected bool) string {
516516
// Clean left-to-right strikethrough wipe
517517
title = m.renderStrikeWipe(titleText, animProgress, rowBg)
518518
} else {
519-
titleWidth := max(20, m.width-40-lipgloss.Width(indent)-lipgloss.Width(expandIcon))
519+
titleWidth := max(20, m.width-40-lipgloss.Width(indicator)-lipgloss.Width(indent)-lipgloss.Width(expandIcon))
520520
title = titleStyle.Render(truncate(titleText, titleWidth))
521521
}
522522

@@ -539,11 +539,25 @@ func (m Model) renderRow(item TaskItem, selected bool) string {
539539
if t.Deadline != nil {
540540
now := time.Now()
541541
deadText := humanDeadline(*t.Deadline, now)
542-
deadStyle := m.styles.Muted
542+
deadStyleColor := m.styles.Theme.Muted
543543
if t.Deadline.Before(now) && t.Status != core.StatusDone {
544-
deadStyle = lipgloss.NewStyle().Foreground(m.styles.Theme.Bad).Background(rowBg)
544+
deadStyleColor = m.styles.Theme.Bad
545545
}
546-
rightParts = append(rightParts, deadStyle.Render(styles.IconDeadline+deadText))
546+
547+
dueContent := styles.IconDeadline + deadText
548+
549+
// Create pill badge for due date
550+
badge := m.styles.BadgeMuted.
551+
Background(m.styles.Theme.Muted).
552+
Foreground(m.styles.Theme.Bg).
553+
Padding(0, 1)
554+
555+
pill := lipgloss.JoinHorizontal(lipgloss.Left,
556+
m.styles.TagLeft.Foreground(deadStyleColor).Render(),
557+
badge.Background(deadStyleColor).Render(dueContent),
558+
m.styles.TagRight.Foreground(deadStyleColor).Render(),
559+
)
560+
rightParts = append(rightParts, pill)
547561
}
548562
case "tags":
549563
if len(t.Tags) > 0 {
@@ -566,7 +580,7 @@ func (m Model) renderRow(item TaskItem, selected bool) string {
566580
}
567581
}
568582

569-
right := strings.Join(rightParts, lipgloss.NewStyle().Background(rowBg).Render(" "))
583+
right := strings.Join(rightParts, " ")
570584

571585
// Use render.BarLine: fills the gap between left and right with bg-styled spaces.
572586
// Subtract 2 for the Padding(0,1) applied by rowStyle below.

0 commit comments

Comments
 (0)