detached 31d36ea

refactor(daemon): group primary render capture inputs

commit
31d36eae4b962823357f60f9115e91e73bd39024
author
brice · · 2026-07-14 19:48 UTC
parent
c4381db
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
4 files · +52 -5
M internal/usecase/daemon/render.go +8 -1
@@ -325,7 +325,14 @@ func (d *Daemon) paint(sess *session, ac *attachedClient, reset bool, lease *att
325325 copyFeedback: overlays.copyFeedback,
326326 }
327327 endCapture := marks.span(ports.RuntimeCaptureStart, ports.RuntimeCaptureEnd, 0)
328- state, ok := capturePrimaryRenderState(sess, ac, bars, capturedOverlays, preview, floatingCfg, reset, lease)
328+ state, ok := capturePrimaryRenderState(sess, ac, primaryCaptureRequest{
329+ bars: bars,
330+ overlays: capturedOverlays,
331+ preview: preview,
332+ floatingCfg: floatingCfg,
333+ reset: reset,
334+ lease: lease,
335+ })
329336 endCapture(0, ok)
330337 if !ok {
331338 ac.sendMu.Unlock()
@@ -325,7 +325,14 @@ func (d *Daemon) paint(sess *session, ac *attachedClient, reset bool, lease *att
325 copyFeedback: overlays.copyFeedback,325 copyFeedback: overlays.copyFeedback,
326 }326 }
327 endCapture := marks.span(ports.RuntimeCaptureStart, ports.RuntimeCaptureEnd, 0)327 endCapture := marks.span(ports.RuntimeCaptureStart, ports.RuntimeCaptureEnd, 0)
328- state, ok := capturePrimaryRenderState(sess, ac, bars, capturedOverlays, preview, floatingCfg, reset, lease)328+ state, ok := capturePrimaryRenderState(sess, ac, primaryCaptureRequest{
329+ bars: bars,
330+ overlays: capturedOverlays,
331+ preview: preview,
332+ floatingCfg: floatingCfg,
333+ reset: reset,
334+ lease: lease,
335+ })
329 endCapture(0, ok)336 endCapture(0, ok)
330 if !ok {337 if !ok {
331 ac.sendMu.Unlock()338 ac.sendMu.Unlock()
M internal/usecase/daemon/render_capture.go +20 -1
@@ -166,11 +166,30 @@ func uncertainDamage(damage []renderer.Damage, width, height int) bool {
166166 return false
167167 }
168168
169+type primaryCaptureRequest struct {
170+ bars barState
171+ overlays capturedOverlayRenderState
172+ preview picker.Preview
173+ floatingCfg domain.FloatingConfig
174+ reset bool
175+ lease *attachmentLease
176+}
177+
169178 // capturePrimaryRenderState is the ownership boundary for a primary render
170179 // transaction. Callers hold attachment sendMu; this function then follows
171180 // session -> tab -> pane lock order. ACK-blocked capture returns before touching
172181 // VT damage, and every captured pane records a receipt for successful emission.
173-func capturePrimaryRenderState(sess *session, ac *attachedClient, bars barState, overlays capturedOverlayRenderState, preview picker.Preview, floatingCfg domain.FloatingConfig, reset bool, lease *attachmentLease) (*capturedRenderState, bool) {
182+func capturePrimaryRenderState(
183+ sess *session,
184+ ac *attachedClient,
185+ request primaryCaptureRequest,
186+) (*capturedRenderState, bool) {
187+ bars := request.bars
188+ overlays := request.overlays
189+ preview := request.preview
190+ floatingCfg := request.floatingCfg
191+ reset := request.reset
192+ lease := request.lease
174193 if sess == nil || ac == nil || (ac.output != nil && ac.output.atCapacity()) {
175194 return nil, false
176195 }
@@ -166,11 +166,30 @@ func uncertainDamage(damage []renderer.Damage, width, height int) bool {
166 return false166 return false
167 }167 }
168 168
169+type primaryCaptureRequest struct {
170+ bars barState
171+ overlays capturedOverlayRenderState
172+ preview picker.Preview
173+ floatingCfg domain.FloatingConfig
174+ reset bool
175+ lease *attachmentLease
176+}
177+
169 // capturePrimaryRenderState is the ownership boundary for a primary render178 // capturePrimaryRenderState is the ownership boundary for a primary render
170 // transaction. Callers hold attachment sendMu; this function then follows179 // transaction. Callers hold attachment sendMu; this function then follows
171 // session -> tab -> pane lock order. ACK-blocked capture returns before touching180 // session -> tab -> pane lock order. ACK-blocked capture returns before touching
172 // VT damage, and every captured pane records a receipt for successful emission.181 // VT damage, and every captured pane records a receipt for successful emission.
173-func capturePrimaryRenderState(sess *session, ac *attachedClient, bars barState, overlays capturedOverlayRenderState, preview picker.Preview, floatingCfg domain.FloatingConfig, reset bool, lease *attachmentLease) (*capturedRenderState, bool) {182+func capturePrimaryRenderState(
183+ sess *session,
184+ ac *attachedClient,
185+ request primaryCaptureRequest,
186+) (*capturedRenderState, bool) {
187+ bars := request.bars
188+ overlays := request.overlays
189+ preview := request.preview
190+ floatingCfg := request.floatingCfg
191+ reset := request.reset
192+ lease := request.lease
174 if sess == nil || ac == nil || (ac.output != nil && ac.output.atCapacity()) {193 if sess == nil || ac == nil || (ac.output != nil && ac.output.atCapacity()) {
175 return nil, false194 return nil, false
176 }195 }
M internal/usecase/daemon/render_damage_receipt_test.go +16 -2
@@ -26,7 +26,14 @@ func TestPrimaryCaptureAloneRecordsDamageReceipts(t *testing.T) {
2626 p.mu.Unlock()
2727
2828 ac.sendMu.Lock()
29- state, ok := capturePrimaryRenderState(sess, ac, barState{}, capturedOverlayRenderState{}, pickerPreviewEmpty(), domain.FloatingConfig{}, false, nil)
29+ state, ok := capturePrimaryRenderState(sess, ac, primaryCaptureRequest{
30+ bars: barState{},
31+ overlays: capturedOverlayRenderState{},
32+ preview: pickerPreviewEmpty(),
33+ floatingCfg: domain.FloatingConfig{},
34+ reset: false,
35+ lease: nil,
36+ })
3037 ac.sendMu.Unlock()
3138 require.True(t, ok)
3239 require.Len(t, state.receipts, 1)
@@ -120,7 +127,14 @@ func TestRenderDamageReceiptStaleGenerationForcesFullRedraw(t *testing.T) {
120127 func captureComposeForReceiptTest(t *testing.T, sess *session, ac *attachedClient) (*capturedRenderState, composedRenderFrame) {
121128 t.Helper()
122129 ac.sendMu.Lock() // emitFrame releases the transaction lock.
123- state, ok := capturePrimaryRenderState(sess, ac, barState{}, capturedOverlayRenderState{}, pickerPreviewEmpty(), domain.FloatingConfig{}, false, nil)
130+ state, ok := capturePrimaryRenderState(sess, ac, primaryCaptureRequest{
131+ bars: barState{},
132+ overlays: capturedOverlayRenderState{},
133+ preview: pickerPreviewEmpty(),
134+ floatingCfg: domain.FloatingConfig{},
135+ reset: false,
136+ lease: nil,
137+ })
124138 require.True(t, ok)
125139 return state, composeFrame(*state, ac.pipelineCache, ac.pipelineScratch)
126140 }
@@ -26,7 +26,14 @@ func TestPrimaryCaptureAloneRecordsDamageReceipts(t *testing.T) {
26 p.mu.Unlock()26 p.mu.Unlock()
27 27
28 ac.sendMu.Lock()28 ac.sendMu.Lock()
29- state, ok := capturePrimaryRenderState(sess, ac, barState{}, capturedOverlayRenderState{}, pickerPreviewEmpty(), domain.FloatingConfig{}, false, nil)29+ state, ok := capturePrimaryRenderState(sess, ac, primaryCaptureRequest{
30+ bars: barState{},
31+ overlays: capturedOverlayRenderState{},
32+ preview: pickerPreviewEmpty(),
33+ floatingCfg: domain.FloatingConfig{},
34+ reset: false,
35+ lease: nil,
36+ })
30 ac.sendMu.Unlock()37 ac.sendMu.Unlock()
31 require.True(t, ok)38 require.True(t, ok)
32 require.Len(t, state.receipts, 1)39 require.Len(t, state.receipts, 1)
@@ -120,7 +127,14 @@ func TestRenderDamageReceiptStaleGenerationForcesFullRedraw(t *testing.T) {
120 func captureComposeForReceiptTest(t *testing.T, sess *session, ac *attachedClient) (*capturedRenderState, composedRenderFrame) {127 func captureComposeForReceiptTest(t *testing.T, sess *session, ac *attachedClient) (*capturedRenderState, composedRenderFrame) {
121 t.Helper()128 t.Helper()
122 ac.sendMu.Lock() // emitFrame releases the transaction lock.129 ac.sendMu.Lock() // emitFrame releases the transaction lock.
123- state, ok := capturePrimaryRenderState(sess, ac, barState{}, capturedOverlayRenderState{}, pickerPreviewEmpty(), domain.FloatingConfig{}, false, nil)130+ state, ok := capturePrimaryRenderState(sess, ac, primaryCaptureRequest{
131+ bars: barState{},
132+ overlays: capturedOverlayRenderState{},
133+ preview: pickerPreviewEmpty(),
134+ floatingCfg: domain.FloatingConfig{},
135+ reset: false,
136+ lease: nil,
137+ })
124 require.True(t, ok)138 require.True(t, ok)
125 return state, composeFrame(*state, ac.pipelineCache, ac.pipelineScratch)139 return state, composeFrame(*state, ac.pipelineCache, ac.pipelineScratch)
126 }140 }
M internal/usecase/daemon/status_test.go +8 -1
@@ -1040,7 +1040,14 @@ func TestCapturePrimaryRenderStatePreservesContextualMRUModeThroughScratchReuse(
10401040 _, sess, ac, _ := newManualSessionWithPTYs(t, nil)
10411041 capture := func(bars barState) capturedRenderState {
10421042 t.Helper()
1043- state, ok := capturePrimaryRenderState(sess, ac, bars, capturedOverlayRenderState{}, picker.Preview{}, domain.FloatingConfig{}, false, nil)
1043+ state, ok := capturePrimaryRenderState(sess, ac, primaryCaptureRequest{
1044+ bars: bars,
1045+ overlays: capturedOverlayRenderState{},
1046+ preview: picker.Preview{},
1047+ floatingCfg: domain.FloatingConfig{},
1048+ reset: false,
1049+ lease: nil,
1050+ })
10441051 require.True(t, ok)
10451052 return *state
10461053 }
@@ -1040,7 +1040,14 @@ func TestCapturePrimaryRenderStatePreservesContextualMRUModeThroughScratchReuse(
1040 _, sess, ac, _ := newManualSessionWithPTYs(t, nil)1040 _, sess, ac, _ := newManualSessionWithPTYs(t, nil)
1041 capture := func(bars barState) capturedRenderState {1041 capture := func(bars barState) capturedRenderState {
1042 t.Helper()1042 t.Helper()
1043- state, ok := capturePrimaryRenderState(sess, ac, bars, capturedOverlayRenderState{}, picker.Preview{}, domain.FloatingConfig{}, false, nil)1043+ state, ok := capturePrimaryRenderState(sess, ac, primaryCaptureRequest{
1044+ bars: bars,
1045+ overlays: capturedOverlayRenderState{},
1046+ preview: picker.Preview{},
1047+ floatingCfg: domain.FloatingConfig{},
1048+ reset: false,
1049+ lease: nil,
1050+ })
1044 require.True(t, ok)1051 require.True(t, ok)
1045 return *state1052 return *state
1046 }1053 }

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