feat: the changelog in the status pane, built in #12

Merged
keb merged 2 commits from feat/changelog-in-status into main 2026-10-11 13:12:51 +02:00
2 changed files with 15 additions and 3 deletions
Showing only changes of commit c129f22f5b - Show all commits

No files matched your search

+2 -1
View File
@@ -116,7 +116,8 @@ On top, the status pane (`0`) shows the version, a newer release and how
your accounts are doing. Focused, the right pane lists more: the version your accounts are doing. Focused, the right pane lists more: the version
and updates (`U`), each account (`L` on one that needs it signs in), the and updates (`U`), each account (`L` on one that needs it signs in), the
config, state and cache files (`e` opens one in your editor), and links config, state and cache files (`e` opens one in your editor), and links
to the docs, source and issues (`o` opens one), then the changelog of to the docs, source, issues, releases and changelog (`o` opens one; on
the version or update, its release), then the changelog of
every release up to yours, built in so it needs no network: `/` filters every release up to yours, built in so it needs no network: `/` filters
it (`/fixed`, `/search`). `y` copies any row. it (`/fixed`, `/search`). `y` copies any row.
+13 -2
View File
@@ -65,8 +65,17 @@ func (m Model) statusFields() []panes.Field {
out = append(out, f) out = append(out, f)
} }
} }
add(panes.Field{Label: "version", Value: cmpOr(m.versionLabel(), "dev")}) // A release's rows open its release page.
add(panes.Field{Label: "update", Value: m.updateStatus(), Info: m.newer == nil}) version := panes.Field{Label: "version", Value: cmpOr(m.versionLabel(), "dev")}
if strings.HasPrefix(version.Value, "v") {
version.URL = update.DefaultRepo + "/releases/tag/" + version.Value
}
add(version)
upd := panes.Field{Label: "update", Value: m.updateStatus(), Info: m.newer == nil}
if m.newer != nil {
upd.URL = update.DefaultRepo + "/releases/tag/" + m.newer.Tag
}
add(upd)
add(panes.Field{Label: "license", Value: "GPL-3.0-or-later · © 2026 Karl-Einar Bergstrøm", Info: true}) add(panes.Field{Label: "license", Value: "GPL-3.0-or-later · © 2026 Karl-Einar Bergstrøm", Info: true})
for i, p := range m.providers { for i, p := range m.providers {
@@ -94,6 +103,8 @@ func (m Model) statusFields() []panes.Field {
add(panes.Field{Label: "docs", Value: repo + "/…/docs", URL: update.DefaultRepo + "/src/branch/main/docs"}) add(panes.Field{Label: "docs", Value: repo + "/…/docs", URL: update.DefaultRepo + "/src/branch/main/docs"})
add(panes.Field{Label: "source", Value: repo, URL: update.DefaultRepo}) add(panes.Field{Label: "source", Value: repo, URL: update.DefaultRepo})
add(panes.Field{Label: "issues", Value: repo + "/issues", URL: update.DefaultRepo + "/issues"}) add(panes.Field{Label: "issues", Value: repo + "/issues", URL: update.DefaultRepo + "/issues"})
add(panes.Field{Label: "releases", Value: repo + "/releases", URL: update.DefaultRepo + "/releases"})
add(panes.Field{Label: "changelog", Value: repo + "/…/CHANGELOG.md", URL: update.DefaultRepo + "/src/branch/main/CHANGELOG.md"})
return append(out, m.changelog...) return append(out, m.changelog...)
} }