missing type default

This commit is contained in:
booleanmaybe 2026-04-19 00:32:46 -04:00
parent 2a50feb6fb
commit 936942d7b5
6 changed files with 29 additions and 6 deletions

View file

@ -48,6 +48,12 @@ views:
- key: "Y" - key: "Y"
label: "Copy content" label: "Copy content"
action: select title, description where id = id() | clipboard() action: select title, description where id = id() | clipboard()
- key: "+"
label: "Priority up"
action: update where id = id() set priority = priority - 1
- key: "-"
label: "Priority down"
action: update where id = id() set priority = priority + 1
plugins: plugins:
- name: Kanban - name: Kanban
description: "Move tiki to new status, search, create or delete" description: "Move tiki to new status, search, create or delete"

View file

@ -272,7 +272,7 @@ func DefaultGlobalActions() *ActionRegistry {
r.Register(Action{ID: ActionQuit, Key: tcell.KeyRune, Rune: 'q', Label: "Quit", ShowInHeader: true}) r.Register(Action{ID: ActionQuit, Key: tcell.KeyRune, Rune: 'q', Label: "Quit", ShowInHeader: true})
r.Register(Action{ID: ActionRefresh, Key: tcell.KeyRune, Rune: 'r', Label: "Refresh", ShowInHeader: true}) r.Register(Action{ID: ActionRefresh, Key: tcell.KeyRune, Rune: 'r', Label: "Refresh", ShowInHeader: true})
r.Register(Action{ID: ActionToggleHeader, Key: tcell.KeyF10, Label: "Toggle Header", ShowInHeader: true}) r.Register(Action{ID: ActionToggleHeader, Key: tcell.KeyF10, Label: "Toggle Header", ShowInHeader: true})
r.Register(Action{ID: ActionOpenPalette, Key: tcell.KeyRune, Rune: '?', Label: "Actions", ShowInHeader: false, HideFromPalette: true}) r.Register(Action{ID: ActionOpenPalette, Key: tcell.KeyRune, Rune: '?', Label: "All", ShowInHeader: true, HideFromPalette: true})
return r return r
} }

View file

@ -419,11 +419,14 @@ func TestDefaultGlobalActions(t *testing.T) {
} }
} }
// ActionOpenPalette should NOT show in header // ActionOpenPalette should show in header with label "All"
for _, a := range actions { for _, a := range actions {
if a.ID == ActionOpenPalette { if a.ID == ActionOpenPalette {
if a.ShowInHeader { if !a.ShowInHeader {
t.Error("ActionOpenPalette should have ShowInHeader=false") t.Error("ActionOpenPalette should have ShowInHeader=true")
}
if a.Label != "All" {
t.Errorf("ActionOpenPalette label = %q, want %q", a.Label, "All")
} }
continue continue
} }

View file

@ -121,10 +121,12 @@ func (s *TikiStore) loadTaskFile(path string, authorMap map[string]*git.AuthorIn
return nil, err return nil, err
} }
// validate type strictly — missing or unknown types are load errors
taskType, typeOK := taskpkg.ParseType(fm.Type) taskType, typeOK := taskpkg.ParseType(fm.Type)
if !typeOK { if !typeOK {
return nil, fmt.Errorf("invalid or missing type %q", fm.Type) if fm.Type != "" {
return nil, fmt.Errorf("unknown type %q", fm.Type)
}
taskType = taskpkg.DefaultType()
} }
task := &taskpkg.Task{ task := &taskpkg.Task{

View file

@ -68,6 +68,12 @@ views:
- key: "Y" - key: "Y"
label: "Copy content" label: "Copy content"
action: select title, description where id = id() | clipboard() action: select title, description where id = id() | clipboard()
- key: "+"
label: "Priority up"
action: update where id = id() set priority = priority - 1
- key: "-"
label: "Priority down"
action: update where id = id() set priority = priority + 1
- key: "R" - key: "R"
label: "Mark regression" label: "Mark regression"
action: update where id = id() set regression=true action: update where id = id() set regression=true

View file

@ -49,6 +49,12 @@ views:
- key: "Y" - key: "Y"
label: "Copy content" label: "Copy content"
action: select title, description where id = id() | clipboard() action: select title, description where id = id() | clipboard()
- key: "+"
label: "Priority up"
action: update where id = id() set priority = priority - 1
- key: "-"
label: "Priority down"
action: update where id = id() set priority = priority + 1
plugins: plugins:
- name: Kanban - name: Kanban
description: "Move tiki to new status, search, create or delete" description: "Move tiki to new status, search, create or delete"