v0.9.0 84a0b9d

json_activity_test.go RawHistoryFolder

1package modes
2
3import (
4	"testing"
5	"time"
6
7	"github.com/bnema/zut/packages/core"
8)
9
10func TestEventToJSONActivityLifecycle(t *testing.T) {
11	request := EventToJSON(core.EvRequestStarted{
12		Provider:    "anthropic",
13		Model:       "claude-test",
14		Scope:       core.RetryScopeProvider,
15		Attempt:     2,
16		MaxAttempts: 3,
17	})
18	if got, want := request["type"], "request_started"; got != want {
19		t.Fatalf("type = %q, want %q", got, want)
20	}
21	for key, want := range map[string]any{
22		"provider":     "anthropic",
23		"model":        "claude-test",
24		"scope":        "provider",
25		"attempt":      2,
26		"max_attempts": 3,
27	} {
28		if got := request[key]; got != want {
29			t.Errorf("request[%q] = %#v, want %#v", key, got, want)
30		}
31	}
32
33	retry := EventToJSON(core.EvRetryScheduled{
34		Scope: core.RetryScopeAgent, Attempt: 2, MaxAttempts: 4, Delay: 1500 * time.Millisecond,
35	})
36	if got, want := retry["delay_ms"], int64(1500); got != want {
37		t.Fatalf("delay_ms = %#v, want %#v", got, want)
38	}
39	if _, exists := retry["delay"]; exists {
40		t.Fatal("retry event must not serialize a duration")
41	}
42
43	tool := EventToJSON(core.EvToolExecutionStarted{ID: "call-1", Name: "read"})
44	if got, want := tool["type"], "tool_execution_started"; got != want {
45		t.Fatalf("type = %q, want %q", got, want)
46	}
47	if tool["id"] != "call-1" || tool["name"] != "read" {
48		t.Fatalf("tool event = %#v", tool)
49	}
50}

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 476

↑↓ moveenter openesc close