Archived
The update check ran at most once a day and only printed a line after the TUI exited. Now the registry is asked on every start (in the background, 3 s timeout, no cache) and the result reaches the TUI as a message. With a newer release, the footer shows `q quit and update to vX` right of help and quit, on a highlighted background (Theme.Highlight). `q` quits and `main` installs the release once the terminal is restored, sharing the code of `submarine update`; plain quit moves to `Q`, ctrl+c never updates. Drop LatestCached and CheckInterval. Add D27 and F58. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
33 lines
758 B
Go
33 lines
758 B
Go
package tui
|
|
|
|
import "submarine/internal/submodule"
|
|
|
|
type treeLoadedMsg struct {
|
|
repo *submodule.Repo
|
|
err error
|
|
}
|
|
|
|
type statusLoadedMsg struct {
|
|
path string
|
|
status *submodule.Status
|
|
err error
|
|
}
|
|
|
|
// fetchDoneMsg reports one finished fetch. It only updates the fetch
|
|
// progress; refreshing is left to the watcher, which also sees fetches made
|
|
// outside the application.
|
|
type fetchDoneMsg struct {
|
|
path string // "" is the superproject
|
|
err error
|
|
}
|
|
|
|
// changeMsg is a change reported by the provider's watcher.
|
|
type changeMsg struct {
|
|
change submodule.Change
|
|
closed bool // the watcher stopped
|
|
}
|
|
|
|
// updateMsg carries the result of the startup update check; version is ""
|
|
// if there is no newer release.
|
|
type updateMsg struct{ version string }
|