detached bafc122

test(core): keep the cascade overview stash inside the area on every output size

commit
bafc122c49b1dc28d58a03698ec34ca8ef9dda41
author
brice · · 2026-10-14 19:53 UTC
parent
594ac4d
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
2 files · +20 -1
M internal/core/overview.go +3 -1
@@ -847,7 +847,9 @@ func (w *Workspace) pile(axis layoutAxis, slot Rect, dim bool, front int) []Plac
847847 var x0, y0 int
848848 if axis == horizontalAxis {
849849 // Centred on the row, across the bottom edge of the selected
850- // lane, which is centred in the slot.
850+ // lane, which is centred in the slot. Both scale with the area
851+ // (the lane at most overviewMaxZoom of it), so the pile stays
852+ // inside whatever its size.
851853 x0 = slot.X + (slot.W-cw)/2
852854 y0 = slot.Y + (slot.H-rowH)/2 + rowH - ch/2
853855 } else {
@@ -847,7 +847,9 @@ func (w *Workspace) pile(axis layoutAxis, slot Rect, dim bool, front int) []Plac
847 var x0, y0 int847 var x0, y0 int
848 if axis == horizontalAxis {848 if axis == horizontalAxis {
849 // Centred on the row, across the bottom edge of the selected849 // Centred on the row, across the bottom edge of the selected
850- // lane, which is centred in the slot.850+ // lane, which is centred in the slot. Both scale with the area
851+ // (the lane at most overviewMaxZoom of it), so the pile stays
852+ // inside whatever its size.
851 x0 = slot.X + (slot.W-cw)/2853 x0 = slot.X + (slot.W-cw)/2
852 y0 = slot.Y + (slot.H-rowH)/2 + rowH - ch/2854 y0 = slot.Y + (slot.H-rowH)/2 + rowH - ch/2
853 } else {855 } else {
M internal/core/overview_cascade_test.go +17 -0
@@ -538,6 +538,23 @@ func TestOverviewCascadeNamedDivider(t *testing.T) {
538538 }
539539 }
540540
541+// The pile stays inside the area, down to a tiny output.
542+func TestOverviewCascadeStashInsideArea(t *testing.T) {
543+ for _, size := range [][2]int{{300, 200}, {1920, 1080}, {1080, 1920}, {3440, 1440}, {60, 40}} {
544+ m := cascadeOverview()
545+ m.SetOutput(size[0], size[1])
546+ withStash(m, 4)
547+ m.ToggleOverview()
548+ u := m.Current().overviewArea()
549+ for _, id := range []WindowID{40, 41, 42, 43} {
550+ p := previewOf(t, m.Layout(), id)
551+ if !p.Hidden && (p.Rect.Y < u.Y || p.Rect.Y+p.Rect.H > u.Y+u.H || p.Rect.X < u.X || p.Rect.X+p.Rect.W > u.X+u.W) {
552+ t.Fatalf("%v: card %d %v outside %v", size, id, p.Rect, u)
553+ }
554+ }
555+ }
556+}
557+
541558 // A stash takes no room in a cascade overview, on a neighbor either: a
542559 // wide scroll workspace beside it keeps its zoom and slot.
543560 func TestOverviewCascadeNeighborStashKeepsSlot(t *testing.T) {
@@ -538,6 +538,23 @@ func TestOverviewCascadeNamedDivider(t *testing.T) {
538 }538 }
539 }539 }
540 540
541+// The pile stays inside the area, down to a tiny output.
542+func TestOverviewCascadeStashInsideArea(t *testing.T) {
543+ for _, size := range [][2]int{{300, 200}, {1920, 1080}, {1080, 1920}, {3440, 1440}, {60, 40}} {
544+ m := cascadeOverview()
545+ m.SetOutput(size[0], size[1])
546+ withStash(m, 4)
547+ m.ToggleOverview()
548+ u := m.Current().overviewArea()
549+ for _, id := range []WindowID{40, 41, 42, 43} {
550+ p := previewOf(t, m.Layout(), id)
551+ if !p.Hidden && (p.Rect.Y < u.Y || p.Rect.Y+p.Rect.H > u.Y+u.H || p.Rect.X < u.X || p.Rect.X+p.Rect.W > u.X+u.W) {
552+ t.Fatalf("%v: card %d %v outside %v", size, id, p.Rect, u)
553+ }
554+ }
555+ }
556+}
557+
541 // A stash takes no room in a cascade overview, on a neighbor either: a558 // A stash takes no room in a cascade overview, on a neighbor either: a
542 // wide scroll workspace beside it keeps its zoom and slot.559 // wide scroll workspace beside it keeps its zoom and slot.
543 func TestOverviewCascadeNeighborStashKeepsSlot(t *testing.T) {560 func TestOverviewCascadeNeighborStashKeepsSlot(t *testing.T) {

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