v0.23.3 fc8669a

update.go RawHistoryFolder

1// Package entity defines domain entities for dumber.
2package entity
3
4import "time"
5
6// UpdateInfo holds information about an available update.
7type UpdateInfo struct {
8	// CurrentVersion is the version of the running binary.
9	CurrentVersion string
10	// LatestVersion is the latest available version from GitHub.
11	LatestVersion string
12	// IsNewer is true if LatestVersion is newer than CurrentVersion.
13	IsNewer bool
14	// ReleaseURL is the URL to the GitHub release page.
15	ReleaseURL string
16	// DownloadURL is the direct download URL for the binary archive.
17	DownloadURL string
18	// PublishedAt is when the release was published.
19	PublishedAt time.Time
20	// ReleaseNotes contains the release changelog (optional).
21	ReleaseNotes string
22}
23
24// UpdateStatus represents the current state of the update process.
25type UpdateStatus int
26
27const (
28	// UpdateStatusUnknown means update status hasn't been checked yet.
29	UpdateStatusUnknown UpdateStatus = iota
30	// UpdateStatusUpToDate means the current version is the latest.
31	UpdateStatusUpToDate
32	// UpdateStatusAvailable means a newer version is available.
33	UpdateStatusAvailable
34	// UpdateStatusDownloading means the update is being downloaded.
35	UpdateStatusDownloading
36	// UpdateStatusReady means the update is downloaded and staged for exit.
37	UpdateStatusReady
38	// UpdateStatusFailed means the update check or download failed.
39	UpdateStatusFailed
40)
41
42// String returns a human-readable string for the update status.
43func (s UpdateStatus) String() string {
44	switch s {
45	case UpdateStatusUnknown:
46		return "unknown"
47	case UpdateStatusUpToDate:
48		return "up-to-date"
49	case UpdateStatusAvailable:
50		return "available"
51	case UpdateStatusDownloading:
52		return "downloading"
53	case UpdateStatusReady:
54		return "ready"
55	case UpdateStatusFailed:
56		return "failed"
57	default:
58		return "unknown"
59	}
60}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 8

Tags 42

↑↓ moveenter openesc close