v0.4.0 2de4e1d

demo_theme_test.go RawHistoryFolder

1//go:build linux
2
3package systemtest
4
5import (
6	"encoding/json"
7	"image/color"
8	"os"
9	"path/filepath"
10	"testing"
11	"time"
12
13	"github.com/bnema/nefergui/internal/harness"
14)
15
16func TestDemoThemeAndPreferences(t *testing.T) {
17	requireHarness(t)
18	bin := demoBinary(t)
19	script := filepath.Join(t.TempDir(), "input.txt")
20	if err := os.WriteFile(script, []byte("sleep 8s\nmove 890 24\nclick left\nsleep 500ms\nmove 80 166\nclick left\nsleep 500ms\nmove 600 580\nsleep 1s\n"), 0600); err != nil {
21		t.Fatal(err)
22	}
23	res := runDemo(t, bin, 1, 400, script, 12*time.Second)
24	data, err := os.ReadFile(filepath.Join(res.Artifacts["debug"], "demo-state.json"))
25	if err != nil {
26		t.Fatal(err)
27	}
28	var state struct {
29		Page     string
30		DarkMode bool
31	}
32	if err := json.Unmarshal(data, &state); err != nil {
33		t.Fatal(err)
34	}
35	if !state.DarkMode || state.Page != "settings" {
36		t.Fatalf("theme/navigation did not update: %+v", state)
37	}
38	img := lastMappedFrame(t, res.Artifacts["frames"])
39	for _, p := range []struct {
40		x, y int
41		want color.NRGBA
42	}{{600, 80, color.NRGBA{24, 24, 27, 255}}, {240, 230, color.NRGBA{24, 24, 27, 255}}} {
43		if err := harness.PixelProbe(img, p.x, p.y, p.want, 3); err != nil {
44			t.Error(err)
45		}
46	}
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 1

Tags 12

↑↓ moveenter openesc close