detached 26241db

test(palette): synchronize displaced target feedback

commit
26241db9f268d2d82cfb489a14c48945327e1d9f
author
brice · · 2026-07-27 17:14 UTC
committer
brice · · 2026-07-27 17:17 UTC
parent
47d7f8d
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
1 file · +11 -3
M internal/usecase/daemon/palette_test.go +11 -3
@@ -409,14 +409,22 @@ func TestPaletteJRSDisplacedTargetKeepsInteractionOpen(t *testing.T) {
409409 }
410410 d.handleInput(sess, ac, []byte("\x1b "))
411411 awaitFrame(t, sends, ports.MsgOutput)
412- go d.handleInput(sess, ac, []byte("JRS 1\r"))
413- <-validated
412+ inputHandled := make(chan struct{})
413+ go func() {
414+ d.handleInput(sess, ac, []byte("JRS 1\r"))
415+ close(inputHandled)
416+ }()
417+ awaitTestCompletion(t, validated, "JRS did not validate its captured target")
414418 d.mu.Lock()
415419 delete(d.sessions, target.id)
416420 d.mu.Unlock()
417421 close(releaseHandoff)
418422
419- awaitFrame(t, sends, ports.MsgOutput)
423+ // switchToTarget repaints its failed hand-off before handlePaletteInput
424+ // records the generation-safe feedback and schedules the feedback repaint.
425+ // Wait for the input transaction, rather than mistaking that intermediate
426+ // repaint for publication of the final palette state.
427+ awaitTestCompletion(t, inputHandled, "JRS displaced-target input did not complete")
420428 require.True(t, ac.overlays.paletteActive())
421429 ac.overlays.paletteMu.Lock()
422430 require.Equal(t, "JRS 1", ac.overlays.palette.Query())
@@ -409,14 +409,22 @@ func TestPaletteJRSDisplacedTargetKeepsInteractionOpen(t *testing.T) {
409 }409 }
410 d.handleInput(sess, ac, []byte("\x1b "))410 d.handleInput(sess, ac, []byte("\x1b "))
411 awaitFrame(t, sends, ports.MsgOutput)411 awaitFrame(t, sends, ports.MsgOutput)
412- go d.handleInput(sess, ac, []byte("JRS 1\r"))412+ inputHandled := make(chan struct{})
413- <-validated413+ go func() {
414+ d.handleInput(sess, ac, []byte("JRS 1\r"))
415+ close(inputHandled)
416+ }()
417+ awaitTestCompletion(t, validated, "JRS did not validate its captured target")
414 d.mu.Lock()418 d.mu.Lock()
415 delete(d.sessions, target.id)419 delete(d.sessions, target.id)
416 d.mu.Unlock()420 d.mu.Unlock()
417 close(releaseHandoff)421 close(releaseHandoff)
418 422
419- awaitFrame(t, sends, ports.MsgOutput)423+ // switchToTarget repaints its failed hand-off before handlePaletteInput
424+ // records the generation-safe feedback and schedules the feedback repaint.
425+ // Wait for the input transaction, rather than mistaking that intermediate
426+ // repaint for publication of the final palette state.
427+ awaitTestCompletion(t, inputHandled, "JRS displaced-target input did not complete")
420 require.True(t, ac.overlays.paletteActive())428 require.True(t, ac.overlays.paletteActive())
421 ac.overlays.paletteMu.Lock()429 ac.overlays.paletteMu.Lock()
422 require.Equal(t, "JRS 1", ac.overlays.palette.Query())430 require.Equal(t, "JRS 1", ac.overlays.palette.Query())

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