Add task sidebar workflow
This commit is contained in:
@@ -168,6 +168,7 @@ func (st *uiState) drawSidebar() {
|
||||
palOpen := st.palette != nil
|
||||
focus := st.focusedID
|
||||
focusPad := st.focusedPad
|
||||
focusTask := st.focusedTaskID
|
||||
activeAgent := st.activeAgentID
|
||||
st.mu.Unlock()
|
||||
if palOpen {
|
||||
@@ -262,6 +263,42 @@ func (st *uiState) drawSidebar() {
|
||||
}
|
||||
}
|
||||
|
||||
// Tasks section — manual project-local tasks. Task selection is a real
|
||||
// focus target, but it does not implicitly scope generic spawns.
|
||||
writeHeader("Tasks")
|
||||
tasks := st.tasksList()
|
||||
if len(tasks) == 0 {
|
||||
write(" " + styleDim + "(Ctrl-K create task)" + styleReset)
|
||||
}
|
||||
for _, t := range tasks {
|
||||
if row > maxRow {
|
||||
break
|
||||
}
|
||||
focused := t.ID == focusTask
|
||||
var prefix, openStyle string
|
||||
if focused {
|
||||
prefix = " " + styleAccent + "▎" + styleReset + " "
|
||||
openStyle = styleBold
|
||||
} else {
|
||||
prefix = " "
|
||||
openStyle = styleHint
|
||||
}
|
||||
suffix := ""
|
||||
if n := len(t.Worktrees); n > 0 {
|
||||
suffix = " " + styleDim + fmt.Sprintf("%dw", n) + styleReset
|
||||
}
|
||||
budget := width - visibleLen(prefix) - visibleLen(suffix)
|
||||
if budget < 1 {
|
||||
budget = 1
|
||||
}
|
||||
nameCell := st.rowNameSlot("task:"+t.ID, t.Title, budget, focused)
|
||||
write(prefix + openStyle + nameCell + styleReset + suffix)
|
||||
}
|
||||
|
||||
if row+2 <= maxRow {
|
||||
write("")
|
||||
}
|
||||
|
||||
// Processes section — top-level command/terminal processes,
|
||||
// session-wide (does not change when the user switches agent tabs).
|
||||
writeHeader("Processes")
|
||||
|
||||
Reference in New Issue
Block a user