v0.3.0 99dc266

session_back_route_test.go RawHistoryFolder

1package daemon
2
3import (
4	"testing"
5
6	"github.com/bnema/vev/internal/ports"
7	"github.com/stretchr/testify/require"
8)
9
10func TestBackSessionUsesClientPreviousRouteAfterSnapshotPublication(t *testing.T) {
11	d, source, ac, _ := newManualSessionWithPTYs(t, nil)
12	transport := &closeTrackingTransport{}
13	ac.replaceTransport(transport)
14	rc := d.attachCoordinator(source, nil, ac, true)
15	token := source.attachmentToken(ac, transport)
16	token.lease = rc.attachmentLease(ac)
17	ac.publishAttachmentCapability(token)
18	effect, admitted := ac.beginAttachmentEffect(token)
19	require.True(t, admitted)
20	defer effect.End()
21	token.effect = effect
22	ac.setRouteSnapshot(ports.RecentRouteSnapshot{
23		Generation: 5,
24		Active:     ports.RouteRef{Key: 9, Generation: 5},
25		Previous:   ports.RouteRef{Key: 7, Generation: 3},
26		Entries: []ports.RecentRouteEntry{{
27			Key: 7, Generation: 3, Name: "previous", Kind: ports.RouteKindLocal,
28		}},
29	})
30
31	require.NoError(t, d.backSessionForAttachment(token))
32	frames := transport.Sends()
33	require.NotEmpty(t, frames)
34	var action ports.RouteNavigationAction
35	found := false
36	for _, frame := range frames {
37		if frame.Type != ports.MsgNavigateRecentRoute {
38			continue
39		}
40		var err error
41		action, err = ports.UnmarshalRouteNavigationAction(frame.Payload)
42		require.NoError(t, err)
43		found = true
44	}
45	require.True(t, found)
46	require.Equal(t, ports.RouteNavigationAction{SnapshotGeneration: 5, Key: 7, Generation: 3}, action)
47}

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