detached b0baaac

fix(capture): use the named output errors and empty the list on Stop

commit
b0baaac67744386300608c61d1cf7d69b9ae5298
author
brice · · 2026-10-08 19:49 UTC
parent
0640328
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
3 files · +4 -3
M internal/adapters/outputkit/capture/offscreen.go +1 -1
@@ -354,7 +354,7 @@ func (p *Pipeline) SubmitHidden(s ports.Scene, surfaces map[ports.WindowID]ports
354354 fail(ErrSecurityState, reqs)
355355 return
356356 case s.Off:
357- fail(errors.New("output off"), reqs)
357+ fail(ErrOutputOff, reqs)
358358 return
359359 case s.CaptureScene == nil || s.Capture == nil || s.Capture.Workspace == 0 && s.Capture.Window == 0:
360360 fail(ErrOffscreenUnavailable, reqs)
@@ -354,7 +354,7 @@ func (p *Pipeline) SubmitHidden(s ports.Scene, surfaces map[ports.WindowID]ports
354 fail(ErrSecurityState, reqs)354 fail(ErrSecurityState, reqs)
355 return355 return
356 case s.Off:356 case s.Off:
357- fail(errors.New("output off"), reqs)357+ fail(ErrOutputOff, reqs)
358 return358 return
359 case s.CaptureScene == nil || s.Capture == nil || s.Capture.Workspace == 0 && s.Capture.Window == 0:359 case s.CaptureScene == nil || s.Capture == nil || s.Capture.Workspace == 0 && s.Capture.Window == 0:
360 fail(ErrOffscreenUnavailable, reqs)360 fail(ErrOffscreenUnavailable, reqs)
M internal/adapters/outputkit/capture/requests.go +1 -0
@@ -81,6 +81,7 @@ func (r *Requests) Stop(incoming <-chan ports.CaptureRequest) {
8181 Fail(r.ctx, q, ErrOutputStopped, r.replies)
8282 }
8383 }
84+ r.Reset()
8485 for {
8586 select {
8687 case q, ok := <-incoming:
@@ -81,6 +81,7 @@ func (r *Requests) Stop(incoming <-chan ports.CaptureRequest) {
81 Fail(r.ctx, q, ErrOutputStopped, r.replies)81 Fail(r.ctx, q, ErrOutputStopped, r.replies)
82 }82 }
83 }83 }
84+ r.Reset()
84 for {85 for {
85 select {86 select {
86 case q, ok := <-incoming:87 case q, ok := <-incoming:
M internal/app/outputs.go +2 -2
@@ -469,7 +469,7 @@ func (s *outputSet) failQueued(r *runningOutput) {
469469 for {
470470 select {
471471 case req := <-r.captures:
472- capture.Fail(s.ctx, req, fmt.Errorf("output stopped"), s.captured)
472+ capture.Fail(s.ctx, req, capture.ErrOutputStopped, s.captured)
473473 default:
474474 return
475475 }
@@ -485,7 +485,7 @@ func drainCaptures(ctx context.Context, incoming <-chan ports.CaptureRequest, re
485485 if !ok {
486486 return
487487 }
488- capture.Fail(ctx, q, fmt.Errorf("output stopped"), replies)
488+ capture.Fail(ctx, q, capture.ErrOutputStopped, replies)
489489 default:
490490 return
491491 }
@@ -469,7 +469,7 @@ func (s *outputSet) failQueued(r *runningOutput) {
469 for {469 for {
470 select {470 select {
471 case req := <-r.captures:471 case req := <-r.captures:
472- capture.Fail(s.ctx, req, fmt.Errorf("output stopped"), s.captured)472+ capture.Fail(s.ctx, req, capture.ErrOutputStopped, s.captured)
473 default:473 default:
474 return474 return
475 }475 }
@@ -485,7 +485,7 @@ func drainCaptures(ctx context.Context, incoming <-chan ports.CaptureRequest, re
485 if !ok {485 if !ok {
486 return486 return
487 }487 }
488- capture.Fail(ctx, q, fmt.Errorf("output stopped"), replies)488+ capture.Fail(ctx, q, capture.ErrOutputStopped, replies)
489 default:489 default:
490 return490 return
491 }491 }

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 23

Tags 10

↑↓ moveenter openesc close