detached 81f384a

test: isolate timestamp settings tests from terminal environment

commit
81f384a17c710aea38411129a88012ec5fc9282a
author
patriceckhart · · 2026-09-22 14:26 UTC
parent
40a7947
signature
unsigned
refs
tag: v0.3.86
1 file · +6 -2
M packages/agent/modes/chat_timestamps_test.go +6 -2
@@ -35,8 +35,10 @@ func (s *timestampSettingsTestStore) SetChatTimestampDate(mode string) error {
3535 }
3636
3737 func TestChatTimestampDateSetting(t *testing.T) {
38+ // Exercise repainting independently of the developer's terminal environment.
39+ t.Setenv("TERM_PROGRAM", "")
3840 store := &timestampSettingsTestStore{}
39- i := NewInteractive(InteractiveConfig{SettingsStore: store})
41+ i := NewInteractive(InteractiveConfig{Terminal: &cleanupTestTerminal{}, SettingsStore: store})
4042 item := i.chatTimestampDateSetting()
4143 if item.options[item.choice].value != "day_start" {
4244 t.Fatal("incorrect date default")
@@ -62,8 +64,10 @@ func TestChatTimestampDateSetting(t *testing.T) {
6264 }
6365
6466 func TestChatTimestampSettings(t *testing.T) {
67+ // Exercise repainting independently of the developer's terminal environment.
68+ t.Setenv("TERM_PROGRAM", "")
6569 store := &timestampSettingsTestStore{}
66- i := NewInteractive(InteractiveConfig{SettingsStore: store})
70+ i := NewInteractive(InteractiveConfig{Terminal: &cleanupTestTerminal{}, SettingsStore: store})
6771 if i.view.ChatTimestamps || tui.ChatTimestampInterval(i.view.ChatTimestampIntervalMinutes) != 0 {
6872 t.Fatal("incorrect startup defaults")
6973 }
@@ -35,8 +35,10 @@ func (s *timestampSettingsTestStore) SetChatTimestampDate(mode string) error {
35 }35 }
36 36
37 func TestChatTimestampDateSetting(t *testing.T) {37 func TestChatTimestampDateSetting(t *testing.T) {
38+ // Exercise repainting independently of the developer's terminal environment.
39+ t.Setenv("TERM_PROGRAM", "")
38 store := &timestampSettingsTestStore{}40 store := &timestampSettingsTestStore{}
39- i := NewInteractive(InteractiveConfig{SettingsStore: store})41+ i := NewInteractive(InteractiveConfig{Terminal: &cleanupTestTerminal{}, SettingsStore: store})
40 item := i.chatTimestampDateSetting()42 item := i.chatTimestampDateSetting()
41 if item.options[item.choice].value != "day_start" {43 if item.options[item.choice].value != "day_start" {
42 t.Fatal("incorrect date default")44 t.Fatal("incorrect date default")
@@ -62,8 +64,10 @@ func TestChatTimestampDateSetting(t *testing.T) {
62 }64 }
63 65
64 func TestChatTimestampSettings(t *testing.T) {66 func TestChatTimestampSettings(t *testing.T) {
67+ // Exercise repainting independently of the developer's terminal environment.
68+ t.Setenv("TERM_PROGRAM", "")
65 store := &timestampSettingsTestStore{}69 store := &timestampSettingsTestStore{}
66- i := NewInteractive(InteractiveConfig{SettingsStore: store})70+ i := NewInteractive(InteractiveConfig{Terminal: &cleanupTestTerminal{}, SettingsStore: store})
67 if i.view.ChatTimestamps || tui.ChatTimestampInterval(i.view.ChatTimestampIntervalMinutes) != 0 {71 if i.view.ChatTimestamps || tui.ChatTimestampInterval(i.view.ChatTimestampIntervalMinutes) != 0 {
68 t.Fatal("incorrect startup defaults")72 t.Fatal("incorrect startup defaults")
69 }73 }

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