Archived
Make the superproject selectable via the header
The header stands for the root repository: it is selected on startup, shows the root's own state word, and the detail pane shows its state like a submodule's (HEAD vs. upstream, changes, unpushed, leftover submodule clones as untracked repositories). Submodules are ignored in the root's changes; their rows show them. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -21,9 +21,13 @@ type Fetch struct {
|
||||
}
|
||||
|
||||
// View renders repo info, state counts and fetch state on one line. spinner
|
||||
// is the current spinner frame.
|
||||
func View(t theme.Theme, repo *submodule.Repo, fetch Fetch, spinner string, width int) string {
|
||||
// is the current spinner frame. The header stands for the superproject: with
|
||||
// selected it is drawn like a selected tree row.
|
||||
func View(t theme.Theme, repo *submodule.Repo, fetch Fetch, spinner string, width int, selected bool) string {
|
||||
bar := lipgloss.NewStyle().Background(t.Bar)
|
||||
if selected {
|
||||
bar = lipgloss.NewStyle().Background(t.Selected).Bold(true)
|
||||
}
|
||||
seg := func(c lipgloss.TerminalColor, s string) string { return bar.Foreground(c).Render(s) }
|
||||
|
||||
if repo == nil {
|
||||
@@ -34,6 +38,9 @@ func View(t theme.Theme, repo *submodule.Repo, fetch Fetch, spinner string, widt
|
||||
if d := t.Delta(submodule.PinInfo{Ahead: repo.Ahead, Behind: repo.Behind, Pushed: true}, bar); d != "" {
|
||||
left += seg(t.Text, " ") + d
|
||||
}
|
||||
if repo.Root != nil {
|
||||
left += seg(t.Text, " ") + t.StatusWord(repo.Root, bar, spinner)
|
||||
}
|
||||
|
||||
// count submodules per issue kind (most severe first), plus staged pins
|
||||
var total, loading, errored, staged int
|
||||
|
||||
Reference in New Issue
Block a user