Cleanup pane, Pi session tools, review from the UI, project registry, needs panel acts
This commit is contained in:
37
tui/work.go
37
tui/work.go
@@ -294,6 +294,18 @@ func (m workModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||
}
|
||||
return pickTasksMsg{issues: mine}
|
||||
}
|
||||
case "v":
|
||||
// A review is cheap to start and posts its verdict on the task, so
|
||||
// the record lives with the work.
|
||||
if m.task.Identifier == "" {
|
||||
return m, nil
|
||||
}
|
||||
if err := startReview(m.folder, m.task.Identifier); err != nil {
|
||||
m.err = err
|
||||
return m, nil
|
||||
}
|
||||
m.tab = 3
|
||||
return m, m.load()
|
||||
case "m":
|
||||
// Merging is a decision, so it asks first and shows what it will do.
|
||||
if m.task.Identifier == "" {
|
||||
@@ -314,13 +326,13 @@ func (m workModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||
return m, nil
|
||||
}
|
||||
return m, tea.Quit
|
||||
case "[", "h":
|
||||
case "(", "[", "h":
|
||||
if m.tab > 0 {
|
||||
m.tab--
|
||||
m.scroll = 0
|
||||
}
|
||||
return m, nil
|
||||
case "]", "l", "tab":
|
||||
case ")", "]", "l", "tab":
|
||||
if m.tab < len(workTabs)-1 {
|
||||
m.tab++
|
||||
m.scroll = 0
|
||||
@@ -519,11 +531,12 @@ func (m workModel) View() string {
|
||||
|
||||
footer := hintLine([]string{
|
||||
keyHint("n p", "task"),
|
||||
keyHint("[ ]", "tab"),
|
||||
keyHint("( )", "tab"),
|
||||
keyHint("↑↓", "scroll"),
|
||||
keyHint("enter", "log"),
|
||||
keyHint("o", "pick"),
|
||||
keyHint("m", "merge"),
|
||||
keyHint("v", "review"),
|
||||
keyHint("t", "tools"),
|
||||
keyHint("r", "refresh"),
|
||||
keyHint("R", "rebuild"),
|
||||
@@ -639,6 +652,13 @@ func (m workModel) diffLines(width int) []string {
|
||||
// written as a comment, so the record lives with the work and survives us.
|
||||
func (m workModel) reviewLines(width int) []string {
|
||||
out := []string{"", dimStyle().Render(" verdicts recorded on this task")}
|
||||
if rl := reviewLogTailFor(m.task.Identifier); len(rl) > 0 {
|
||||
out = append(out, "")
|
||||
out = append(out, dimStyle().Render(" the last review started from here:"))
|
||||
for _, ln := range rl {
|
||||
out = append(out, " "+mutedStyle2().Render(truncateVisible(ln, width-2)))
|
||||
}
|
||||
}
|
||||
if m.task.Identifier == "" {
|
||||
return append(out, mutedStyle2().Render(" no task chosen"))
|
||||
}
|
||||
@@ -776,3 +796,14 @@ func firstLineWith(lines []string, marker string) string {
|
||||
}
|
||||
return "none"
|
||||
}
|
||||
|
||||
// reviewLogTailFor returns the last review log, but only when it was for this
|
||||
// task: another task's review is not evidence about this one.
|
||||
func reviewLogTailFor(identifier string) []string {
|
||||
tail := reviewLogTail(8)
|
||||
joined := strings.Join(tail, "\n")
|
||||
if !strings.Contains(joined, identifier) {
|
||||
return nil
|
||||
}
|
||||
return tail
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user