Help on every panel, task filter, unblock key, mouse zones, safe add-only rebuild

This commit is contained in:
Sam
2026-11-10 15:59:42 +11:00
parent 972d4c0184
commit 09e32da046
13 changed files with 587 additions and 16 deletions

View File

@@ -46,6 +46,7 @@ type workModel struct {
scroll int
readAt time.Time
showHelp bool
width, height int
}
@@ -122,7 +123,14 @@ func (m workModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
return m, tea.Batch(m.load(), tickEvery(5*time.Second))
case tea.KeyMsg:
if m.showHelp {
m.showHelp = false
return m, nil
}
switch msg.String() {
case "?":
m.showHelp = true
return m, nil
case "q", "ctrl+c":
return m, tea.Quit
case "r":
@@ -188,6 +196,18 @@ func (m workModel) View() string {
fmt.Sprintf("This workspace needs 80 × 24.\nThis panel is %d × %d.", m.width, m.height))
}
if m.showHelp {
return helpOverlay("the work", [][2]string{
{"[ ] h l", "switch between runs, change and facts"},
{"↑ ↓ j k", "scroll"},
{"g / G", "top / bottom"},
{"r", "read again"},
{"R", "rebuild every pane"},
{"q", "leave"},
{"?", "this list"},
}, m.width, m.height)
}
head := titleStyle.Render("Work") + mutedStyle2().Render(" · ")
if m.task.Identifier != "" {
head += lipgloss.NewStyle().Foreground(lipgloss.Color(active.Text)).Render(m.task.Identifier)