office: say exactly what to do next; l opens lazygit and t opens the tool chooser everywhere; a remote run gets a terminal to ask in

This commit is contained in:
Sam
2026-11-13 07:21:23 +11:00
parent 4be72dae2e
commit cba45f82f8
12 changed files with 779 additions and 54 deletions

View File

@@ -215,3 +215,40 @@ func switchWorkspace(name string) error {
}
return fmt.Errorf("no workspace called %q", name)
}
// toolMenu is the chooser used by every pane that offers `t`. It lives here so
// the board and the project screen cannot drift apart in how they list the same
// tools.
func toolMenu(at, width, height int) string {
entries := make([][2]string, 0, len(tools))
for i, t := range tools {
mark := " "
if i == at {
mark = "▸ "
}
entries = append(entries, [2]string{mark + t.name, t.about})
}
return helpOverlay("open a tool pane here", entries, width, height)
}
// toolPickerKeys handles the chooser and says whether the key was consumed.
// `selected` is the tool to open, or empty.
func toolPickerKeys(key string, at *int) (consumed bool, selected string) {
switch key {
case "up", "k":
*at = max(0, *at-1)
return true, ""
case "down", "j":
*at = min(len(tools)-1, *at+1)
return true, ""
case "g":
*at = 0
return true, ""
case "G":
*at = len(tools) - 1
return true, ""
case "enter":
return true, tools[*at].name
}
return false, ""
}