detached aecc277

fix(daemon): wake headless bar preview subscribers

commit
aecc277857f88507fcb7ce8124cc8e3bbac95cfa
author
brice · · 2026-07-12 07:24 UTC
parent
e3435a7
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
2 files · +16 -3
M internal/usecase/daemon/bar_refresh.go +4 -3
@@ -309,7 +309,8 @@ func (d *Daemon) pokeSessionRender(sess *session) {
309309 sess.mu.Lock()
310310 ac := sess.client
311311 sess.mu.Unlock()
312- if ac != nil {
313- d.invalidateRender(sess, ac, false, "bar_refresh.go")
314- }
312+ // A headless session can still supply a picker preview to an attachment
313+ // owned by another session. Its coordinator fans this wake out to those
314+ // preview subscribers even though no primary attachment is bound.
315+ d.invalidateRender(sess, ac, false, "bar_refresh.go")
315316 }
@@ -309,7 +309,8 @@ func (d *Daemon) pokeSessionRender(sess *session) {
309 sess.mu.Lock()309 sess.mu.Lock()
310 ac := sess.client310 ac := sess.client
311 sess.mu.Unlock()311 sess.mu.Unlock()
312- if ac != nil {312+ // A headless session can still supply a picker preview to an attachment
313- d.invalidateRender(sess, ac, false, "bar_refresh.go")313+ // owned by another session. Its coordinator fans this wake out to those
314- }314+ // preview subscribers even though no primary attachment is bound.
315+ d.invalidateRender(sess, ac, false, "bar_refresh.go")
315 }316 }
M internal/usecase/daemon/bar_refresh_test.go +12 -0
@@ -277,6 +277,18 @@ func TestBarScriptRunIgnoresStaleConfigVersion(t *testing.T) {
277277 require.Empty(t, state.bottomRight)
278278 }
279279
280+func TestPokeSessionRenderWakesHeadlessPreviewCoordinator(t *testing.T) {
281+ d := newBarRefreshTestDaemon(nil, time.Second)
282+ sess := newBarRefreshTestSession()
283+ var invalidations int
284+ rc := newRenderCoordinator(renderCoordinatorOptions{onInvalidate: func(renderInvalidation) { invalidations++ }})
285+ sess.installRenderCoordinator(rc)
286+
287+ d.pokeSessionRender(sess)
288+
289+ require.Equal(t, 1, invalidations)
290+}
291+
280292 func TestBarScriptRefreshIsPerSession(t *testing.T) {
281293 r := &fakeBarRunner{outs: []string{"top-a", "bottom-a", "top-b", "bottom-b"}}
282294 d := newBarRefreshTestDaemon(r, time.Second)
@@ -277,6 +277,18 @@ func TestBarScriptRunIgnoresStaleConfigVersion(t *testing.T) {
277 require.Empty(t, state.bottomRight)277 require.Empty(t, state.bottomRight)
278 }278 }
279 279
280+func TestPokeSessionRenderWakesHeadlessPreviewCoordinator(t *testing.T) {
281+ d := newBarRefreshTestDaemon(nil, time.Second)
282+ sess := newBarRefreshTestSession()
283+ var invalidations int
284+ rc := newRenderCoordinator(renderCoordinatorOptions{onInvalidate: func(renderInvalidation) { invalidations++ }})
285+ sess.installRenderCoordinator(rc)
286+
287+ d.pokeSessionRender(sess)
288+
289+ require.Equal(t, 1, invalidations)
290+}
291+
280 func TestBarScriptRefreshIsPerSession(t *testing.T) {292 func TestBarScriptRefreshIsPerSession(t *testing.T) {
281 r := &fakeBarRunner{outs: []string{"top-a", "bottom-a", "top-b", "bottom-b"}}293 r := &fakeBarRunner{outs: []string{"top-a", "bottom-a", "top-b", "bottom-b"}}
282 d := newBarRefreshTestDaemon(r, time.Second)294 d := newBarRefreshTestDaemon(r, time.Second)

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