Skip to content

Commit 1614243

Browse files
fix: ensure edit preview panel respects configuration settings and implement model state management updates
1 parent 6811ef5 commit 1614243

5 files changed

Lines changed: 18 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ 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.6.2] (2026-05-09)
9+
10+
### Fixed
11+
* **Edit Preview Configuration**: Fixed an issue where the `[edit] preview` configuration setting in `config.toml` was ignored. The preview panel now correctly respects the configured default state during both task creation and editing.
12+
813
## v1.6.1 (2026-05-09)
914

1015
### Added

VERSION.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.6.1
1+
1.6.2

internal/app/model.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,10 @@ func (m *Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
586586
m.set.SetStyles(m.s)
587587
m.list.Animations = m.cfg.App.Animations // Sync animations setting to tasklist
588588

589+
if m.edit != nil {
590+
m.edit.SetPreview(m.cfg.Edit.Preview)
591+
}
592+
589593
m.rebuildViews()
590594
m.rebuildPaletteIndex()
591595

@@ -953,7 +957,7 @@ func (m *Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
953957
return m, nil
954958

955959
case openEditMsg:
956-
e := editor.New(m.s, editor.ModeEdit, x.Task, true)
960+
e := editor.New(m.s, editor.ModeEdit, x.Task, m.cfg.Edit.Preview)
957961
m.edit = &e
958962
m.rebuildComponentSizes()
959963
m.mode = ModeEditor
@@ -1406,7 +1410,7 @@ func (m *Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
14061410
case keymapMatch(m.km.NewTask, km):
14071411
task := core.Task{Status: core.StatusTodo, Priority: core.P1}
14081412
m.activeFilter().ApplyToTask(&task)
1409-
e := editor.New(m.s, editor.ModeNew, task, false)
1413+
e := editor.New(m.s, editor.ModeNew, task, m.cfg.Edit.Preview)
14101414
m.edit = &e
14111415
m.rebuildComponentSizes()
14121416
m.mode = ModeEditor
@@ -2724,7 +2728,7 @@ func utilTruncate(s string, w int) string {
27242728
func (m *Model) runCommand(id string) tea.Cmd {
27252729
switch id {
27262730
case "cmd:new":
2727-
e := editor.New(m.s, editor.ModeNew, core.Task{Status: core.StatusTodo, Priority: core.P1}, false)
2731+
e := editor.New(m.s, editor.ModeNew, core.Task{Status: core.StatusTodo, Priority: core.P1}, m.cfg.Edit.Preview)
27282732
m.edit = &e
27292733
m.rebuildComponentSizes()
27302734
m.mode = ModeEditor

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.6.1"))
64+
L.SetField(kairo, "version", lua.LString("1.6.2"))
6565

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

internal/ui/editor/model.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,10 @@ func (m *Model) SetParentID(id string) {
245245

246246
func (m Model) Init() tea.Cmd { return nil }
247247

248+
func (m *Model) SetPreview(preview bool) {
249+
m.showPreview = preview
250+
}
251+
248252
func (m Model) Update(msg tea.Msg) (Model, tea.Cmd) {
249253
switch x := msg.(type) {
250254
case tea.KeyMsg:

0 commit comments

Comments
 (0)