Skip to content

Commit 4c1aed3

Browse files
feat: implement modular task architecture and Lua-based plugin engine
- closes #42 finally
1 parent 77a8c51 commit 4c1aed3

20 files changed

Lines changed: 819 additions & 47 deletions

File tree

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,18 @@ 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+
## v1.5.6 (2026-05-08)
9+
10+
### Added
11+
* **Safe Task Deletion**: Refactored task deletion to be context-aware and safer.
12+
* `t` → deletes tasks in current tab/filter.
13+
* `a` → deletes all tasks database-wide with robust confirmation.
14+
* **Configurable Edit Preview**: Added `[edit] preview = true` to `config.toml` to toggle live markdown preview during task editing, matching consistency with the creation flow.
15+
* **Undo/Redo System**: Integrated a robust history engine that allows for seamless undo and redo of almost all task operations.
16+
* Supports: Task creation, single/bulk deletion, editing, status toggles, priority changes, and deadline updates.
17+
* **Live Synchronization**: Reversions are applied instantly to the database and reflected in the TUI without requiring a restart.
18+
* **Configurable Shortcuts**: Added `[history] undo = "ctrl+z"` and `[history] redo = "ctrl+y"` to `config.toml` to configure undo/redo shortcuts.
19+
820
## [1.5.5]
921

1022
### Added

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,14 @@ Press `s` to open a next-gen "Command Center". Visualize your **Productivity DNA
9292
Gemini integration (`gemini-3.1-flash-lite-preview` / `gemini-2.5-flash-lite` / `gemini-2.0-flash-lite`). Toggle with `ctrl+a`. Create and manage complex recurring tasks with natural language, including assigning to specific projects. Invisible until you need it.
9393

9494
### 🎨 Beautiful by Default
95-
32 built-in themes with edge-to-edge background coverage. Live switching with `t`. Bento-style layout. Real-time Markdown preview (`ctrl+p`). Cinematic create/complete/delete animations — or disable them entirely in `config.toml`.
95+
32 built-in themes with edge-to-edge background coverage. Live switching with `t`. Bento-style layout. Real-time Markdown preview (`ctrl+p`), with configurable default state in `config.toml` under `[edit]`. Cinematic create/complete/delete animations — or disable them entirely in `config.toml`.
9696

9797
### 🧩 Extensible to the Core
9898
A Lua plugin system hooks into task events. A headless CLI API enables full scripting. An MCP server opens Kairo to AI agents — with complete support for recurring schedules and nested hierarchies.
9999

100+
### ↩️ Undo & Redo
101+
Kairo now tracks your every move with a local history engine. Instantly reverse mistakes with `ctrl+z` or re-apply undone actions with `ctrl+y`. Supports task creation, deletion (including bulk), editing, and status changes. Everything is synchronized live with the database.
102+
100103
### 🎨 Tag Highlighting
101104
Color-code your tags directly in `config.toml`. Supports hex codes or theme-aware `ui-*` aliases (e.g., `ui-accent`).
102105

@@ -129,6 +132,8 @@ diy = "bg=ui-accent"
129132
| `ctrl+s` | Settings |
130133
| `x` | Import / Export |
131134
| `?` | Help |
135+
| `ctrl+z` | Undo last action |
136+
| `ctrl+y` | Redo last undone |
132137
| `ctrl+w` | Welcome tour |
133138

134139
<div align="center">

VERSION.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.5.5
1+
1.5.6

configs/kairo.example.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ auto_push = true
3636
enabled = true
3737
dir = "plugins"
3838

39+
[edit]
40+
preview = true
41+
3942
[keymap]
4043
palette = "ctrl+p"
4144
task_search = "/"
@@ -65,3 +68,5 @@ import_export = "x"
6568
ai_panel_toggle = "ctrl+a"
6669
stats = "s"
6770
project_switcher = "ctrl+e"
71+
undo = "ctrl+z"
72+
redo = "ctrl+y"

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ require (
5757
github.com/pkg/errors v0.8.1 // indirect
5858
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
5959
github.com/rivo/uniseg v0.4.7 // indirect
60+
github.com/sahilm/fuzzy v0.1.1 // indirect
6061
github.com/spf13/cast v1.7.1 // indirect
6162
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
6263
github.com/yosida95/uritemplate/v3 v3.0.2 // indirect

go.sum

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
111111
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
112112
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
113113
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
114+
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
115+
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
114116
github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY=
115117
github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
116118
github.com/mark3labs/mcp-go v0.49.0 h1:7Ssx4d7/T86qnWoJIdye7wEEvUzv39UIbnZb/FqUZMY=
@@ -153,6 +155,8 @@ github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
153155
github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
154156
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
155157
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
158+
github.com/sahilm/fuzzy v0.1.1 h1:ceu5RHF8DGgoi+/dR5PsECjCDH1BE3Fnmpo7aVXOdRA=
159+
github.com/sahilm/fuzzy v0.1.1/go.mod h1:VFvziUEIMCrT6A6tw2RFIXPXXmzXbOsSHF0DOI8ZK9Y=
156160
github.com/spf13/cast v1.7.1 h1:cuNEagBQEHWN1FnbGEjCXL2szYEXqfJPbP2HNUaca9Y=
157161
github.com/spf13/cast v1.7.1/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo=
158162
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=

internal/app/delete_helper.go

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package app
2+
3+
import (
4+
tea "github.com/charmbracelet/bubbletea"
5+
"github.com/programmersd21/kairo/internal/core"
6+
"github.com/programmersd21/kairo/internal/history"
7+
)
8+
9+
func (m *Model) deleteTasksCmd(ids []string) tea.Cmd {
10+
return func() tea.Msg {
11+
// Get the tasks before deleting them for history
12+
var before []core.Task
13+
for _, id := range ids {
14+
if task, err := m.svc.GetByID(m.ctx, id); err == nil {
15+
before = append(before, task)
16+
}
17+
}
18+
19+
if err := m.svc.DeleteTasks(m.ctx, ids); err != nil {
20+
return errMsg{Err: err}
21+
}
22+
23+
// Record deletion in history
24+
op := history.CreateOperation(history.OpBulkDelete, "", ids, before, nil)
25+
m.hist.Record(op)
26+
27+
return taskUpdatedMsg{}
28+
}
29+
}

0 commit comments

Comments
 (0)