detached 9865a27

refactor(core): remove the appear, leave and Monitor.overviewAt wrappers

Only tests called them; they call appearAt, leaveFrom and overviewIn
directly.
commit
9865a275ba257b0c52edf24435637f28b04328a5
author
brice · · 2026-10-05 02:45 UTC
parent
ac8eeb6
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
9 files · +17 -22
M internal/core/overview.go +5 -10
@@ -813,16 +813,11 @@ func overviewOutline(layout []Placement, b int) []ports.Separator {
813813 // overviewClickFade is the fade from which a card takes no click.
814814 const overviewClickFade = 0.5
815815
816-// overviewAt is the preview under the output-local point, if any. Front
817-// cards take priority over peeks, including peeks appended after a front
818-// tile in another row's layout.
819-func (m *Monitor) overviewAt(x, y float64) WindowID {
820- return overviewIn(m.Layout(), x, y)
821-}
822-
823-// overviewIn is overviewAt in a given layout: the click path passes the
824-// shown one, so a card is hit where it is drawn while it moves. A card
825-// that is nearly invisible (still fading in) is not clickable.
816+// overviewIn is the preview under the output-local point in layout, if
817+// any. Front cards take priority over peeks, including peeks appended after
818+// a front tile in another row's layout. The click path passes the shown
819+// layout, so a card is hit where it is drawn while it moves. A card that is
820+// nearly invisible (still fading in) is not clickable.
826821 func overviewIn(layout []Placement, x, y float64) WindowID {
827822 for i := len(layout) - 1; i >= 0; i-- {
828823 p := layout[i]
@@ -813,16 +813,11 @@ func overviewOutline(layout []Placement, b int) []ports.Separator {
813 // overviewClickFade is the fade from which a card takes no click.813 // overviewClickFade is the fade from which a card takes no click.
814 const overviewClickFade = 0.5814 const overviewClickFade = 0.5
815 815
816-// overviewAt is the preview under the output-local point, if any. Front816+// overviewIn is the preview under the output-local point in layout, if
817-// cards take priority over peeks, including peeks appended after a front817+// any. Front cards take priority over peeks, including peeks appended after
818-// tile in another row's layout.818+// a front tile in another row's layout. The click path passes the shown
819-func (m *Monitor) overviewAt(x, y float64) WindowID {819+// layout, so a card is hit where it is drawn while it moves. A card that is
820- return overviewIn(m.Layout(), x, y)820+// nearly invisible (still fading in) is not clickable.
821-}
822-
823-// overviewIn is overviewAt in a given layout: the click path passes the
824-// shown one, so a card is hit where it is drawn while it moves. A card
825-// that is nearly invisible (still fading in) is not clickable.
826 func overviewIn(layout []Placement, x, y float64) WindowID {821 func overviewIn(layout []Placement, x, y float64) WindowID {
827 for i := len(layout) - 1; i >= 0; i-- {822 for i := len(layout) - 1; i >= 0; i-- {
828 p := layout[i]823 p := layout[i]
M internal/core/overview_named_test.go +1 -1
@@ -304,7 +304,7 @@ func TestOverviewNamedNeighborPick(t *testing.T) {
304304 if p.Hidden {
305305 t.Fatal("named stash neighbor hidden")
306306 }
307- id := m.overviewAt(float64(p.Rect.X+p.Rect.W/2), float64(p.Rect.Y+p.Rect.H/2))
307+ id := overviewIn(m.Layout(), float64(p.Rect.X+p.Rect.W/2), float64(p.Rect.Y+p.Rect.H/2))
308308 if id != 6 {
309309 t.Fatalf("stash hit: %d", id)
310310 }
@@ -304,7 +304,7 @@ func TestOverviewNamedNeighborPick(t *testing.T) {
304 if p.Hidden {304 if p.Hidden {
305 t.Fatal("named stash neighbor hidden")305 t.Fatal("named stash neighbor hidden")
306 }306 }
307- id := m.overviewAt(float64(p.Rect.X+p.Rect.W/2), float64(p.Rect.Y+p.Rect.H/2))307+ id := overviewIn(m.Layout(), float64(p.Rect.X+p.Rect.W/2), float64(p.Rect.Y+p.Rect.H/2))
308 if id != 6 {308 if id != 6 {
309 t.Fatalf("stash hit: %d", id)309 t.Fatalf("stash hit: %d", id)
310 }310 }
M internal/core/overview_regression_test.go +1 -1
@@ -62,7 +62,7 @@ func TestOverviewSingleCoveringFloat(t *testing.T) {
6262 }
6363 }
6464 if click {
65- id := m.overviewAt(float64(p.Rect.X+p.Rect.W/2), float64(p.Rect.Y+p.Rect.H/2))
65+ id := overviewIn(m.Layout(), float64(p.Rect.X+p.Rect.W/2), float64(p.Rect.Y+p.Rect.H/2))
6666 if id != 9 {
6767 t.Fatalf("hit %d, want 9", id)
6868 }
@@ -62,7 +62,7 @@ func TestOverviewSingleCoveringFloat(t *testing.T) {
62 }62 }
63 }63 }
64 if click {64 if click {
65- id := m.overviewAt(float64(p.Rect.X+p.Rect.W/2), float64(p.Rect.Y+p.Rect.H/2))65+ id := overviewIn(m.Layout(), float64(p.Rect.X+p.Rect.W/2), float64(p.Rect.Y+p.Rect.H/2))
66 if id != 9 {66 if id != 9 {
67 t.Fatalf("hit %d, want 9", id)67 t.Fatalf("hit %d, want 9", id)
68 }68 }
M internal/core/overview_stack_test.go +2 -2
@@ -115,12 +115,12 @@ func TestOverviewStackClickAndHitPriority(t *testing.T) {
115115 if frontColumn {
116116 x = front.Rect.X + front.Rect.W/2
117117 }
118- if got := m.overviewAt(float64(x), float64(y)); got != front.ID {
118+ if got := overviewIn(m.Layout(), float64(x), float64(y)); got != front.ID {
119119 t.Fatalf("overlap hit %d want %d (front %+v back %+v)", got, front.ID, front.Rect, back.Rect)
120120 }
121121 // The up/right exposed corner belongs to the peeking card.
122122 x, y = back.Rect.X+back.Rect.W-1, back.Rect.Y+1
123- if got := m.overviewAt(float64(x), float64(y)); got != back.ID {
123+ if got := overviewIn(m.Layout(), float64(x), float64(y)); got != back.ID {
124124 t.Fatalf("peek hit %d want %d", got, back.ID)
125125 }
126126 m.OverviewPick(back.ID)
@@ -115,12 +115,12 @@ func TestOverviewStackClickAndHitPriority(t *testing.T) {
115 if frontColumn {115 if frontColumn {
116 x = front.Rect.X + front.Rect.W/2116 x = front.Rect.X + front.Rect.W/2
117 }117 }
118- if got := m.overviewAt(float64(x), float64(y)); got != front.ID {118+ if got := overviewIn(m.Layout(), float64(x), float64(y)); got != front.ID {
119 t.Fatalf("overlap hit %d want %d (front %+v back %+v)", got, front.ID, front.Rect, back.Rect)119 t.Fatalf("overlap hit %d want %d (front %+v back %+v)", got, front.ID, front.Rect, back.Rect)
120 }120 }
121 // The up/right exposed corner belongs to the peeking card.121 // The up/right exposed corner belongs to the peeking card.
122 x, y = back.Rect.X+back.Rect.W-1, back.Rect.Y+1122 x, y = back.Rect.X+back.Rect.W-1, back.Rect.Y+1
123- if got := m.overviewAt(float64(x), float64(y)); got != back.ID {123+ if got := overviewIn(m.Layout(), float64(x), float64(y)); got != back.ID {
124 t.Fatalf("peek hit %d want %d", got, back.ID)124 t.Fatalf("peek hit %d want %d", got, back.ID)
125 }125 }
126 m.OverviewPick(back.ID)126 m.OverviewPick(back.ID)
M internal/core/overview_test.go +4 -4
@@ -116,7 +116,7 @@ func TestOverviewPick(t *testing.T) {
116116 m := overviewMonitor()
117117 m.ToggleOverview()
118118 below := previewOf(t, m.Layout(), 4).Rect
119- id := m.overviewAt(float64(below.X+1), float64(below.Y+1))
119+ id := overviewIn(m.Layout(), float64(below.X+1), float64(below.Y+1))
120120 if id != 4 {
121121 t.Fatalf("hit %d", id)
122122 }
@@ -173,7 +173,7 @@ func TestOverviewFullscreenFloatPickAndCancel(t *testing.T) {
173173 m := gameMonitor(OverflowFixed)
174174 m.ToggleOverview()
175175 r := previewOf(t, m.Layout(), 2).Rect
176- if id := m.overviewAt(float64(r.X+1), float64(r.Y+1)); id != 2 {
176+ if id := overviewIn(m.Layout(), float64(r.X+1), float64(r.Y+1)); id != 2 {
177177 t.Fatalf("hit %d", id)
178178 }
179179 m.OverviewMove(0, 1)
@@ -412,7 +412,7 @@ func TestOverviewPilePick(t *testing.T) {
412412 m := pileMonitor()
413413 m.ToggleOverview()
414414 r := previewOf(t, m.Layout(), 7).Rect
415- id := m.overviewAt(float64(r.X+1), float64(r.Y+r.H-1))
415+ id := overviewIn(m.Layout(), float64(r.X+1), float64(r.Y+r.H-1))
416416 if id != 7 {
417417 t.Fatalf("hit %d", id)
418418 }
@@ -486,7 +486,7 @@ func TestOverviewFixedOverflowGeometry(t *testing.T) {
486486 t.Fatalf("%d overlaps %d", id, other)
487487 }
488488 }
489- if p.Rect.W > 0 && p.Rect.H > 0 && m.overviewAt(float64(p.Rect.X+p.Rect.W/2), float64(p.Rect.Y+p.Rect.H/2)) != id {
489+ if p.Rect.W > 0 && p.Rect.H > 0 && overviewIn(m.Layout(), float64(p.Rect.X+p.Rect.W/2), float64(p.Rect.Y+p.Rect.H/2)) != id {
490490 t.Fatalf("%d not hit at %+v", id, p.Rect)
491491 }
492492 }
@@ -116,7 +116,7 @@ func TestOverviewPick(t *testing.T) {
116 m := overviewMonitor()116 m := overviewMonitor()
117 m.ToggleOverview()117 m.ToggleOverview()
118 below := previewOf(t, m.Layout(), 4).Rect118 below := previewOf(t, m.Layout(), 4).Rect
119- id := m.overviewAt(float64(below.X+1), float64(below.Y+1))119+ id := overviewIn(m.Layout(), float64(below.X+1), float64(below.Y+1))
120 if id != 4 {120 if id != 4 {
121 t.Fatalf("hit %d", id)121 t.Fatalf("hit %d", id)
122 }122 }
@@ -173,7 +173,7 @@ func TestOverviewFullscreenFloatPickAndCancel(t *testing.T) {
173 m := gameMonitor(OverflowFixed)173 m := gameMonitor(OverflowFixed)
174 m.ToggleOverview()174 m.ToggleOverview()
175 r := previewOf(t, m.Layout(), 2).Rect175 r := previewOf(t, m.Layout(), 2).Rect
176- if id := m.overviewAt(float64(r.X+1), float64(r.Y+1)); id != 2 {176+ if id := overviewIn(m.Layout(), float64(r.X+1), float64(r.Y+1)); id != 2 {
177 t.Fatalf("hit %d", id)177 t.Fatalf("hit %d", id)
178 }178 }
179 m.OverviewMove(0, 1)179 m.OverviewMove(0, 1)
@@ -412,7 +412,7 @@ func TestOverviewPilePick(t *testing.T) {
412 m := pileMonitor()412 m := pileMonitor()
413 m.ToggleOverview()413 m.ToggleOverview()
414 r := previewOf(t, m.Layout(), 7).Rect414 r := previewOf(t, m.Layout(), 7).Rect
415- id := m.overviewAt(float64(r.X+1), float64(r.Y+r.H-1))415+ id := overviewIn(m.Layout(), float64(r.X+1), float64(r.Y+r.H-1))
416 if id != 7 {416 if id != 7 {
417 t.Fatalf("hit %d", id)417 t.Fatalf("hit %d", id)
418 }418 }
@@ -486,7 +486,7 @@ func TestOverviewFixedOverflowGeometry(t *testing.T) {
486 t.Fatalf("%d overlaps %d", id, other)486 t.Fatalf("%d overlaps %d", id, other)
487 }487 }
488 }488 }
489- if p.Rect.W > 0 && p.Rect.H > 0 && m.overviewAt(float64(p.Rect.X+p.Rect.W/2), float64(p.Rect.Y+p.Rect.H/2)) != id {489+ if p.Rect.W > 0 && p.Rect.H > 0 && overviewIn(m.Layout(), float64(p.Rect.X+p.Rect.W/2), float64(p.Rect.Y+p.Rect.H/2)) != id {
490 t.Fatalf("%d not hit at %+v", id, p.Rect)490 t.Fatalf("%d not hit at %+v", id, p.Rect)
491 }491 }
492 }492 }
M internal/core/publish_alloc_test.go +1 -1
@@ -185,7 +185,7 @@ func TestPublishLeavingAllocations(t *testing.T) {
185185 for i, p := range layout {
186186 if i < 2 {
187187 sc.mon.RemoveWindow(p.ID)
188- c.leave(sc, p, t0)
188+ c.leaveFrom(sc, p, nil, t0)
189189 continue
190190 }
191191 sc.rects[p.ID] = rectMotion{
@@ -185,7 +185,7 @@ func TestPublishLeavingAllocations(t *testing.T) {
185 for i, p := range layout {185 for i, p := range layout {
186 if i < 2 {186 if i < 2 {
187 sc.mon.RemoveWindow(p.ID)187 sc.mon.RemoveWindow(p.ID)
188- c.leave(sc, p, t0)188+ c.leaveFrom(sc, p, nil, t0)
189 continue189 continue
190 }190 }
191 sc.rects[p.ID] = rectMotion{191 sc.rects[p.ID] = rectMotion{
M internal/core/refresh_bench_test.go +1 -1
@@ -42,7 +42,7 @@ func BenchmarkRefreshShown(b *testing.B) {
4242 }
4343 for i, p := range sc.settledLayout[24:] {
4444 sc.mon.RemoveWindow(p.ID)
45- c.leave(sc, p, t0)
45+ c.leaveFrom(sc, p, nil, t0)
4646 _ = i
4747 }
4848 sc.rectsWS = sc.mon.Current()
@@ -42,7 +42,7 @@ func BenchmarkRefreshShown(b *testing.B) {
42 }42 }
43 for i, p := range sc.settledLayout[24:] {43 for i, p := range sc.settledLayout[24:] {
44 sc.mon.RemoveWindow(p.ID)44 sc.mon.RemoveWindow(p.ID)
45- c.leave(sc, p, t0)45+ c.leaveFrom(sc, p, nil, t0)
46 _ = i46 _ = i
47 }47 }
48 sc.rectsWS = sc.mon.Current()48 sc.rectsWS = sc.mon.Current()
M internal/core/transition_overview_internal_test.go +1 -1
@@ -271,7 +271,7 @@ func TestOverviewClickDuringOpenUsesShownCards(t *testing.T) {
271271 if x < float64(settled.Rect.X+settled.Rect.W) {
272272 t.Fatalf("setup: x %v is inside the settled card %+v", x, settled.Rect)
273273 }
274- if id := sc.mon.overviewAt(x, y); id == 2 {
274+ if id := overviewIn(sc.mon.Layout(), x, y); id == 2 {
275275 t.Fatalf("setup: the settled layout picks 2 at %v,%v", x, y)
276276 }
277277 c.cursorX, c.cursorY = x+float64(sc.x), y+float64(sc.y)
@@ -271,7 +271,7 @@ func TestOverviewClickDuringOpenUsesShownCards(t *testing.T) {
271 if x < float64(settled.Rect.X+settled.Rect.W) {271 if x < float64(settled.Rect.X+settled.Rect.W) {
272 t.Fatalf("setup: x %v is inside the settled card %+v", x, settled.Rect)272 t.Fatalf("setup: x %v is inside the settled card %+v", x, settled.Rect)
273 }273 }
274- if id := sc.mon.overviewAt(x, y); id == 2 {274+ if id := overviewIn(sc.mon.Layout(), x, y); id == 2 {
275 t.Fatalf("setup: the settled layout picks 2 at %v,%v", x, y)275 t.Fatalf("setup: the settled layout picks 2 at %v,%v", x, y)
276 }276 }
277 c.cursorX, c.cursorY = x+float64(sc.x), y+float64(sc.y)277 c.cursorX, c.cursorY = x+float64(sc.x), y+float64(sc.y)
M internal/core/transition_stash_internal_test.go +1 -1
@@ -438,7 +438,7 @@ func TestWithLeavingOrderIsDeterministic(t *testing.T) {
438438 sc.mon.RemoveWindow(5)
439439 c.applyAction(ActionToggleStashVisible)
440440 for _, p := range left {
441- c.leave(sc, p, ic.now)
441+ c.leaveFrom(sc, p, nil, ic.now)
442442 }
443443 var want []WindowID
444444 for i := range 40 {
@@ -438,7 +438,7 @@ func TestWithLeavingOrderIsDeterministic(t *testing.T) {
438 sc.mon.RemoveWindow(5)438 sc.mon.RemoveWindow(5)
439 c.applyAction(ActionToggleStashVisible)439 c.applyAction(ActionToggleStashVisible)
440 for _, p := range left {440 for _, p := range left {
441- c.leave(sc, p, ic.now)441+ c.leaveFrom(sc, p, nil, ic.now)
442 }442 }
443 var want []WindowID443 var want []WindowID
444 for i := range 40 {444 for i := range 40 {

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