Work>review and tool panes; panes re-sync their size; the Work pane follows the Board again

This commit is contained in:
Sam
2026-11-10 18:06:07 +11:00
parent ec7e907b2e
commit 4a23f05d20
18 changed files with 884 additions and 25 deletions

View File

@@ -49,6 +49,8 @@ type boardModel struct {
activity []paperclip.Activity
needsTab int
tools bool
toolAt int
zones *zone.Manager
filter string
typing bool
@@ -71,7 +73,7 @@ func newBoardModel(c *paperclip.Client, proj paperclip.Project, folder string) b
}
func (m boardModel) Init() tea.Cmd {
return tea.Batch(m.reload(), tickEvery(5*time.Second))
return tea.Batch(m.reload(), tickEvery(5*time.Second), tea.WindowSize())
}
func (m boardModel) reload() tea.Cmd {
@@ -157,6 +159,27 @@ func (m boardModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
return m, nil
case tea.KeyMsg:
if m.tools {
switch msg.String() {
case "esc", "q", "t":
m.tools = false
return m, nil
case "up", "k":
m.toolAt = max(0, m.toolAt-1)
return m, nil
case "down", "j":
m.toolAt = min(len(tools)-1, m.toolAt+1)
return m, nil
case "enter":
t := tools[m.toolAt]
m.tools = false
if err := openTool(m.folder, t.name); err != nil {
m.err = err
}
return m, nil
}
return m, nil
}
if m.showHelp {
m.showHelp = false
return m, nil
@@ -192,6 +215,9 @@ func (m boardModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
case "?":
m.showHelp = true
return m, nil
case "t":
m.tools = true
return m, nil
case "/":
m.typing = true
return m, nil
@@ -424,6 +450,7 @@ func (m boardModel) footerLine() string {
keyHint("enter", "show it everywhere"),
keyHint("a", "assign"),
keyHint("u", "unblock"),
keyHint("t", "tools"),
keyHint("/", "filter"),
keyHint("?", "keys"),
keyHint("tab", "next panel"),