recent_route_presentation.go RawHistoryFolder

1package daemon
2
3import "github.com/bnema/vev/internal/domain"
4
5// recentRouteKind identifies the origin represented by a presentation value.
6// It is intentionally daemon-local in this layer; ports route kinds are
7// projected into this render-only value at the daemon boundary.
8type recentRouteKind uint8
9
10const (
11	recentRouteLocal recentRouteKind = iota
12	recentRouteRemote
13)
14
15// recentRoutePresentation is the compact immutable value shared by snapshot
16// projection and formatting. It contains only display data; it never carries
17// session ownership, selection identity, transport capabilities, credentials,
18// or attach targets.
19type recentRoutePresentation struct {
20	name      string
21	hostLabel string
22	kind      recentRouteKind
23	ephemeral bool
24	attention bool
25}
26
27// recentRouteDisplay is a formatted, render-ready copy of a presentation. The
28// source value is never mutated while duplicate names are qualified.
29type recentRouteDisplay struct {
30	name      string
31	kind      recentRouteKind
32	ephemeral bool
33	attention bool
34}
35
36// formatRecentRoutePresentations is the single label formatter used by the
37// normal MRU bar and ranked recent-session palette rendering. It returns an
38// owned slice so callers can retain the result without consulting live state.
39func formatRecentRoutePresentations(entries []recentRoutePresentation) []recentRouteDisplay {
40	if entries == nil {
41		return nil
42	}
43	out := make([]recentRouteDisplay, len(entries))
44	for i, entry := range entries {
45		out[i] = recentRouteDisplay{
46			name:      formatRecentRouteName(entry),
47			kind:      entry.kind,
48			ephemeral: entry.ephemeral,
49			attention: entry.attention,
50		}
51	}
52	return out
53}
54
55func formatRecentRouteName(entry recentRoutePresentation) string {
56	name := entry.name
57	if entry.ephemeral {
58		name += "*"
59	}
60	if entry.kind != recentRouteRemote {
61		return name
62	}
63
64	host := entry.hostLabel
65	if host == "" {
66		host = "remote"
67	}
68	return domain.RemoteSessionDisplay(name, host)
69}

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 12

Tags 11

↑↓ moveenter openesc close