detached 2fb23d6

fix(core): keep the stash swipe spawn from refilling workspace slots

The four-finger swipe that opens the stash terminal reported a shown
workspace, so the empty slots of the workspace on screen were refilled. It
now reports none, as the bind does.
commit
2fb23d65c8b78d63d717dd210fbbf89ebac45a2c
author
brice · · 2026-10-14 20:41 UTC
parent
835c479
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
2 files · +30 -5
M internal/core/gesture.go +5 -5
@@ -452,10 +452,10 @@ func (c *Core) swipeEnd(e ports.SwipeEnd) (shown bool, spawn *Workspace) {
452452 // swipeStash runs toggle-stash-visible for a four-finger swipe down, or up
453453 // while the stash is shown, with the overview closed, on the swipe's screen
454454 // unless the pointer took the focus to another output meanwhile. It reports
455-// whether the swipe acted: the stash showed or hid, or an empty stash asked
456-// for its terminal (stash.spawn-terminal), which spawn names for the caller
457-// to start, as a bind does.
458-func (c *Core) swipeStash(g *swipeGesture, now time.Time) (acted bool, spawn *Workspace) {
455+// whether the stash showed or hid. An empty stash asking for its terminal
456+// (stash.spawn-terminal) shows no workspace, as with the bind: spawn names the
457+// workspace for the caller to start it in.
458+func (c *Core) swipeStash(g *swipeGesture, now time.Time) (shown bool, spawn *Workspace) {
459459 if c.cur() != g.screen {
460460 return false, nil
461461 }
@@ -466,7 +466,7 @@ func (c *Core) swipeStash(g *swipeGesture, now time.Time) (acted bool, spawn *Wo
466466 effect := c.applyAction(ActionToggleStashVisible)
467467 c.transition(shots, now)
468468 if effect.Spawn {
469- return true, w
469+ return false, w
470470 }
471471 return w.stashHidden != hidden || w.stashOver != over, nil
472472 }
@@ -452,10 +452,10 @@ func (c *Core) swipeEnd(e ports.SwipeEnd) (shown bool, spawn *Workspace) {
452 // swipeStash runs toggle-stash-visible for a four-finger swipe down, or up452 // swipeStash runs toggle-stash-visible for a four-finger swipe down, or up
453 // while the stash is shown, with the overview closed, on the swipe's screen453 // while the stash is shown, with the overview closed, on the swipe's screen
454 // unless the pointer took the focus to another output meanwhile. It reports454 // unless the pointer took the focus to another output meanwhile. It reports
455-// whether the swipe acted: the stash showed or hid, or an empty stash asked455+// whether the stash showed or hid. An empty stash asking for its terminal
456-// for its terminal (stash.spawn-terminal), which spawn names for the caller456+// (stash.spawn-terminal) shows no workspace, as with the bind: spawn names the
457-// to start, as a bind does.457+// workspace for the caller to start it in.
458-func (c *Core) swipeStash(g *swipeGesture, now time.Time) (acted bool, spawn *Workspace) {458+func (c *Core) swipeStash(g *swipeGesture, now time.Time) (shown bool, spawn *Workspace) {
459 if c.cur() != g.screen {459 if c.cur() != g.screen {
460 return false, nil460 return false, nil
461 }461 }
@@ -466,7 +466,7 @@ func (c *Core) swipeStash(g *swipeGesture, now time.Time) (acted bool, spawn *Wo
466 effect := c.applyAction(ActionToggleStashVisible)466 effect := c.applyAction(ActionToggleStashVisible)
467 c.transition(shots, now)467 c.transition(shots, now)
468 if effect.Spawn {468 if effect.Spawn {
469- return true, w469+ return false, w
470 }470 }
471 return w.stashHidden != hidden || w.stashOver != over, nil471 return w.stashHidden != hidden || w.stashOver != over, nil
472 }472 }
M internal/core/stash_spawn_test.go +25 -0
@@ -3,6 +3,7 @@ package core_test
33 import (
44 "slices"
55 "testing"
6+ "time"
67
78 "github.com/bnema/neferwl/internal/ports"
89 )
@@ -201,3 +202,27 @@ func TestFourFingerSwipeEmptyStashRespectsOption(t *testing.T) {
201202 t.Fatal("spawned with stash.spawn-terminal off")
202203 }
203204 }
205+
206+// The terminal of a four-finger swipe shows no workspace: the empty slots of
207+// the workspace on screen are not refilled, as with the bind.
208+func TestFourFingerSwipeEmptyStashDoesNotRefillSlots(t *testing.T) {
209+ r := startSlots(t)
210+ r.fill(t)
211+ r.press(t, "d") // dev on screen, its slots filled
212+ r.client <- ports.WindowUnmapped{ID: 2}
213+ sceneMatch(t, r.scenes, func(s ports.Scene) bool { return len(s.Windows) == 1 })
214+ noSpawn(t, r.spawn) // nothing relaunches on its own
215+ var at time.Duration
216+ r.input <- ports.SwipeBegin{Fingers: 4, Time: at}
217+ for range 10 {
218+ at += 8 * time.Millisecond
219+ r.input <- ports.SwipeUpdate{DY: 40, Time: at}
220+ }
221+ r.input <- ports.SwipeEnd{Time: at}
222+ req := receive(t, r.spawn)
223+ if len(req.Argv) != 1 || req.Argv[0] != "foot" {
224+ t.Fatalf("argv %v, want the stash terminal", req.Argv)
225+ }
226+ r.sync(t)
227+ noSpawn(t, r.spawn) // the empty slot of dev stays empty
228+}
@@ -3,6 +3,7 @@ package core_test
3 import (3 import (
4 "slices"4 "slices"
5 "testing"5 "testing"
6+ "time"
6 7
7 "github.com/bnema/neferwl/internal/ports"8 "github.com/bnema/neferwl/internal/ports"
8 )9 )
@@ -201,3 +202,27 @@ func TestFourFingerSwipeEmptyStashRespectsOption(t *testing.T) {
201 t.Fatal("spawned with stash.spawn-terminal off")202 t.Fatal("spawned with stash.spawn-terminal off")
202 }203 }
203 }204 }
205+
206+// The terminal of a four-finger swipe shows no workspace: the empty slots of
207+// the workspace on screen are not refilled, as with the bind.
208+func TestFourFingerSwipeEmptyStashDoesNotRefillSlots(t *testing.T) {
209+ r := startSlots(t)
210+ r.fill(t)
211+ r.press(t, "d") // dev on screen, its slots filled
212+ r.client <- ports.WindowUnmapped{ID: 2}
213+ sceneMatch(t, r.scenes, func(s ports.Scene) bool { return len(s.Windows) == 1 })
214+ noSpawn(t, r.spawn) // nothing relaunches on its own
215+ var at time.Duration
216+ r.input <- ports.SwipeBegin{Fingers: 4, Time: at}
217+ for range 10 {
218+ at += 8 * time.Millisecond
219+ r.input <- ports.SwipeUpdate{DY: 40, Time: at}
220+ }
221+ r.input <- ports.SwipeEnd{Time: at}
222+ req := receive(t, r.spawn)
223+ if len(req.Argv) != 1 || req.Argv[0] != "foot" {
224+ t.Fatalf("argv %v, want the stash terminal", req.Argv)
225+ }
226+ r.sync(t)
227+ noSpawn(t, r.spawn) // the empty slot of dev stays empty
228+}

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 25

Tags 10

↑↓ moveenter openesc close