Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,19 @@ permissions:
contents: write

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v5
with:
go-version-file: go.mod

- run: go test ./...

release:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
13 changes: 7 additions & 6 deletions internal/ui/tui/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,10 @@ const (
)

var (
// row background — transparent so rows inherit the terminal's native background
rowBg = lipgloss.NoColor{}
headerBg = lipgloss.Color("232")
// All views share a uniform near-black background. The status bar overrides
// this with its own darker grey at the bottom of the screen.
headerBg lipgloss.Color = "232"
rowBg = headerBg

// Status colours — applied as foreground to the entire row
attentionFg = lipgloss.Color("196") // bright red
Expand Down Expand Up @@ -113,16 +114,16 @@ var (

// Column header
colHdrStyle = lipgloss.NewStyle().
Background(lipgloss.NoColor{}).
Background(headerBg).
Foreground(colorSubduedGray).
Bold(true)
colHdrSortedStyle = lipgloss.NewStyle().
Background(lipgloss.NoColor{}).
Background(headerBg).
Foreground(colorCyan).
Bold(true)

// Misc
sepStyle = lipgloss.NewStyle().Foreground(colorDarkGray)
sepStyle = lipgloss.NewStyle().Foreground(colorDarkGray).Background(headerBg)
boldStyle = lipgloss.NewStyle().Bold(true).Foreground(colorText)
textStyle = lipgloss.NewStyle().Foreground(colorText)
dimStyle = lipgloss.NewStyle().Foreground(staleFg)
Expand Down
27 changes: 21 additions & 6 deletions internal/ui/tui/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,12 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {

case fetchDoneMsg:
updated := git.RepoInfo(msg)
// Detail view follows the active repo across re-sorts so the user
// keeps looking at the repo they just pulled.
activePath := ""
if m.state == stateDetail && m.cursor < len(m.repos) {
activePath = m.repos[m.cursor].Path
}
for i, r := range m.repos {
if r.Path == updated.Path {
m.repos[i] = updated
Expand All @@ -121,7 +127,16 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
m.fetchingPR = false
m.statusMsg = "pulled " + updated.Name
git.SortReposByCol(m.repos, m.sortCol, m.sortDesc)
m.cursor = min(m.cursor, max(0, len(m.repos)-1))
if activePath != "" {
for i, r := range m.repos {
if r.Path == activePath {
m.cursor = i
break
}
}
} else {
m.cursor = min(m.cursor, max(0, len(m.repos)-1))
}
if m.state == stateDetail {
// Reload behind commits — upstream may have changed after a fetch/pull.
m.behindLoaded = false
Expand Down Expand Up @@ -359,7 +374,7 @@ func (m model) handleListKey(key string) (tea.Model, tea.Cmd) {
m.offset = 0
}

case "c":
case "z":
m.state = stateSettings

case "r":
Expand Down Expand Up @@ -457,7 +472,7 @@ func (m model) handleDetailKey(key string) (tea.Model, tea.Cmd) {
return m, tea.Batch(m.spinner.Tick, refreshSingleRepoCmd(m.repos[m.cursor].Path))
}

case "c":
case "z":
m.state = stateSettings
}
return m, nil
Expand Down Expand Up @@ -522,10 +537,10 @@ func (m model) handleSettingsKey(key string) (tea.Model, tea.Cmd) {
}

// headerHeight returns the number of lines the header occupies.
// = max(len(listHeaderLines), len(logoLines)) + 1 legend line.
// listHeaderLines produces 6 items; logoLines has 8 → max = 8 + 1 = 9.
// Rows 0..len(logoLines)-1 hold the logo (and the info / shortcut columns),
// and the last row holds the legend.
func (m model) headerHeight() int {
return max(6, len(logoLines)) + 1 // +1 for the legend line
return len(logoLines)
}

func (m model) visibleRows() int {
Expand Down
Loading
Loading