Skip to content

Commit 307ae42

Browse files
authored
feat(tui): restyle the editor, settings, and dialogs (#143) (#149)
* feat(tui): restyle the card editor and settings pane onto theme widgets * feat(tui): restyle the task action dialogs and adopt huh fields
1 parent 9cfed54 commit 307ae42

24 files changed

Lines changed: 1160 additions & 499 deletions

internal/tui/cardeditor/model.go

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
"github.com/RandomCodeSpace/kb/internal/board"
2121
"github.com/RandomCodeSpace/kb/internal/store"
2222
"github.com/RandomCodeSpace/kb/internal/tui/pointer"
23+
"github.com/RandomCodeSpace/kb/internal/tui/theme"
2324
)
2425

2526
const (
@@ -163,16 +164,35 @@ type Model struct {
163164
scroll int
164165
manualScroll bool
165166
pointerState pointer.State
167+
styles *theme.Styles
166168
}
167169

168170
// New creates a closed editor. A nil store keeps the feature unavailable in
169171
// lightweight root-model tests.
170172
func New(st Store, user string) Model {
171-
m := Model{store: st, user: user, now: time.Now, ctx: context.Background()}
173+
m := Model{store: st, user: user, now: time.Now, ctx: context.Background(), styles: theme.New(true)}
172174
m.resetInputs()
173175
return m
174176
}
175177

178+
// SetStyles hands the editor the resolved design system. Spec section 6.2: the
179+
// root builds it once per terminal background and threads it down; the editor
180+
// never constructs one per frame.
181+
func (m *Model) SetStyles(styles *theme.Styles) {
182+
if styles != nil {
183+
m.styles = styles
184+
}
185+
}
186+
187+
// themeStyles is the resolved design system, defaulting to the dark reference
188+
// palette for a zero-value editor that no root has handed one to.
189+
func (m *Model) themeStyles() *theme.Styles {
190+
if m.styles == nil {
191+
m.styles = theme.New(true)
192+
}
193+
return m.styles
194+
}
195+
176196
// SetAIRunner wires the shared runner and the root program context. A nil
177197
// runner hides the draft controls while leaving ordinary editing available.
178198
func (m *Model) SetAIRunner(runner SkillRunner, ctx context.Context) {
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
 EDIT CARD #90
3+
  Blocked: yes space toggle  
4+
  Labels: label or scope::value  
5+
  selected: [tui] [type::feature]  
6+
  Checklist (x prefix = done):  
7+
  write tests  
8+
  x ship  
9+
    
10+
   
11+
  [Cancel]  
12+
 > [Save card]  
13+
 tab navigate | ctrl+s/ctrl+enter sa… 19/19
14+
Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,30 @@
1-
╭──────────────────────────────────────────────────────────────────────────╮
2-
│ EDIT CARD #90 │
3-
│ │
4-
│ Title: Map the editor │
5-
│ Emoji: 🧭 │
6-
│ Description: │
7-
│ First line │
8-
│ Second line │
9-
│ │
10-
│ Priority: 1 (urgent) left/right │
11-
│ Due: 2026-08-20 [/] day; ctrl+x clear │
12-
│ Effort: M left/right; ctrl+x clear │
13-
│ Blocked: yes space toggle │
14-
│ Labels: label or scope::value │
15-
│ selected: [tui] [type::feature] │
16-
│ Checklist (x prefix = done): │
17-
│ write tests │
18-
│ x ship │
19-
│ │
20-
│ │
21-
│ similar items (2): │
22-
│ [killed 2026-07-01 — superseded] Map old editor [Enter dismiss] │
23-
│ [import] Editor planning [Enter dismiss] │
24-
│ [Dismiss all similar items] │
25-
│ │
26-
│ [Cancel] │
27-
│ > [Save card] │
28-
│ tab navigate | ctrl+s/ctrl+enter save | esc close │
29-
╰──────────────────────────────────────────────────────────────────────────╯
1+
EDIT CARD #90
2+
Title: Map the editor
3+
Emoji: 🧭
4+
Description:
5+
First line
6+
Second line
7+
8+
Priority: 1 (urgent) left/right
9+
Due: 2026-08-20 [/] day; ctrl+x clear
10+
Effort: M left/right; ctrl+x clear
11+
Blocked: yes space toggle
12+
Labels: label or scope::value
13+
selected: [tui] [type::feature]
14+
Checklist (x prefix = done):
15+
write tests
16+
x ship
17+
18+
19+
similar items (2):
20+
[killed 2026-07-01 — superseded] Map old editor [Enter dismiss]
21+
[import] Editor planning [Enter dismiss]
22+
[Dismiss all similar items]
23+
24+
[Cancel]
25+
> [Save card]
26+
27+
28+
29+
30+
tab navigate | ctrl+s/ctrl+enter save | esc close

0 commit comments

Comments
 (0)