detached dc4ba25

test(overview): check the span and wording of cascade band cards

commit
dc4ba25ee50a8713ba9f123f56b4a915c4f9d6f5
author
brice · · 2026-10-08 12:18 UTC
parent
553cc10
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
2 files · +16 -9
M internal/core/overview.go +2 -1
@@ -863,7 +863,8 @@ func (w *Workspace) overviewZoom() float64 {
863863 }
864864
865865 // zoomSpan is overviewZoom with the unscaled span of the tiles it fits. A
866-// cascade workspace spans one screen whatever its band count.
866+// cascade workspace spans one screen whatever its band count, plus the room
867+// of the cards a maximized column hides.
867868 func (w *Workspace) zoomSpan() (float64, int) {
868869 // Only the span is read: the tiles go in the zoom scratch, dead on return.
869870 var span int
@@ -863,7 +863,8 @@ func (w *Workspace) overviewZoom() float64 {
863 }863 }
864 864
865 // zoomSpan is overviewZoom with the unscaled span of the tiles it fits. A865 // zoomSpan is overviewZoom with the unscaled span of the tiles it fits. A
866-// cascade workspace spans one screen whatever its band count.866+// cascade workspace spans one screen whatever its band count, plus the room
867+// of the cards a maximized column hides.
867 func (w *Workspace) zoomSpan() (float64, int) {868 func (w *Workspace) zoomSpan() (float64, int) {
868 // Only the span is read: the tiles go in the zoom scratch, dead on return.869 // Only the span is read: the tiles go in the zoom scratch, dead on return.
869 var span int870 var span int
M internal/core/overview_cascade_test.go +14 -8
@@ -75,10 +75,10 @@ func TestOverviewCascadeZoomIgnoresBandCount(t *testing.T) {
7575 }
7676 }
7777
78-// A maximized column fills its band in the preview, inset for the columns
79-// it hides: they are dimmed cards at their cell size behind it, on their
80-// side, the nearest one step out, the farther ones two (the band's edge).
81-// Other bands keep their cells.
78+// A maximized column keeps its full size in the preview (the workspace's
79+// ratio); the columns it hides are dimmed cards at their cell size behind
80+// it, peeking out on their side, the nearest one step, the farther ones two.
81+// The row widens by that room; other bands keep their cells.
8282 func TestOverviewCascadeMaximizedColumnCards(t *testing.T) {
8383 // Four columns, three per band: band 0 holds 0..2, band 1 holds 3.
8484 for _, tc := range []struct {
@@ -97,12 +97,15 @@ func TestOverviewCascadeMaximizedColumnCards(t *testing.T) {
9797 w := cascadeWorkspace(tc.n)
9898 w.Focus = tc.max
9999 w.maximize(tc.max)
100- tiles, _, sel := w.previewTiles()
100+ tiles, span, sel := w.previewTiles()
101101 g, h, s := w.gap(), w.Usable.H-2*w.gap(), w.bandCardStep()
102102 off := 0
103103 if slices.ContainsFunc(tc.cards, func(k int) bool { return k != 0 }) {
104104 off = 2 * s
105105 }
106+ if span != w.Usable.W+2*off {
107+ t.Fatalf("n=%d max=%d span %d, want %d", tc.n, tc.max, span, w.Usable.W+2*off)
108+ }
106109 var order []int
107110 for _, p := range tiles {
108111 i := int(p.ID) - 1
@@ -120,6 +123,9 @@ func TestOverviewCascadeMaximizedColumnCards(t *testing.T) {
120123 case k > 0:
121124 want.X = w.Usable.W - g + (2+k)*s - want.W
122125 }
126+ if p.Rect.X < 0 || p.Rect.X+p.Rect.W > span {
127+ t.Fatalf("n=%d max=%d column %d %+v outside span %d", tc.n, tc.max, i, p.Rect, span)
128+ }
123129 if p.Hidden || p.Peek != (tc.cards[i] != 0) || p.Focused != (i == tc.max) || p.Rect != want {
124130 t.Fatalf("n=%d max=%d column %d: %+v, want rect %+v card %v", tc.n, tc.max, i, p, want, tc.cards[i] != 0)
125131 }
@@ -198,9 +204,9 @@ func TestOverviewCascadeMaximizedCardPickRecordsWindow(t *testing.T) {
198204 }
199205 }
200206
201-// Only the focused maximized column is inset for cards: a FullWidth column
202-// elsewhere fills its band.
203-func TestOverviewCascadeUnfocusedMaximizedNotInset(t *testing.T) {
207+// A FullWidth column outside the focused band fills its band, shifted like
208+// every tile by the room of the focused column's cards.
209+func TestOverviewCascadeUnfocusedMaximizedFillsBand(t *testing.T) {
204210 w := cascadeWorkspace(6)
205211 w.SetGaps(8)
206212 w.Focus = 4
@@ -75,10 +75,10 @@ func TestOverviewCascadeZoomIgnoresBandCount(t *testing.T) {
75 }75 }
76 }76 }
77 77
78-// A maximized column fills its band in the preview, inset for the columns78+// A maximized column keeps its full size in the preview (the workspace's
79-// it hides: they are dimmed cards at their cell size behind it, on their79+// ratio); the columns it hides are dimmed cards at their cell size behind
80-// side, the nearest one step out, the farther ones two (the band's edge).80+// it, peeking out on their side, the nearest one step, the farther ones two.
81-// Other bands keep their cells.81+// The row widens by that room; other bands keep their cells.
82 func TestOverviewCascadeMaximizedColumnCards(t *testing.T) {82 func TestOverviewCascadeMaximizedColumnCards(t *testing.T) {
83 // Four columns, three per band: band 0 holds 0..2, band 1 holds 3.83 // Four columns, three per band: band 0 holds 0..2, band 1 holds 3.
84 for _, tc := range []struct {84 for _, tc := range []struct {
@@ -97,12 +97,15 @@ func TestOverviewCascadeMaximizedColumnCards(t *testing.T) {
97 w := cascadeWorkspace(tc.n)97 w := cascadeWorkspace(tc.n)
98 w.Focus = tc.max98 w.Focus = tc.max
99 w.maximize(tc.max)99 w.maximize(tc.max)
100- tiles, _, sel := w.previewTiles()100+ tiles, span, sel := w.previewTiles()
101 g, h, s := w.gap(), w.Usable.H-2*w.gap(), w.bandCardStep()101 g, h, s := w.gap(), w.Usable.H-2*w.gap(), w.bandCardStep()
102 off := 0102 off := 0
103 if slices.ContainsFunc(tc.cards, func(k int) bool { return k != 0 }) {103 if slices.ContainsFunc(tc.cards, func(k int) bool { return k != 0 }) {
104 off = 2 * s104 off = 2 * s
105 }105 }
106+ if span != w.Usable.W+2*off {
107+ t.Fatalf("n=%d max=%d span %d, want %d", tc.n, tc.max, span, w.Usable.W+2*off)
108+ }
106 var order []int109 var order []int
107 for _, p := range tiles {110 for _, p := range tiles {
108 i := int(p.ID) - 1111 i := int(p.ID) - 1
@@ -120,6 +123,9 @@ func TestOverviewCascadeMaximizedColumnCards(t *testing.T) {
120 case k > 0:123 case k > 0:
121 want.X = w.Usable.W - g + (2+k)*s - want.W124 want.X = w.Usable.W - g + (2+k)*s - want.W
122 }125 }
126+ if p.Rect.X < 0 || p.Rect.X+p.Rect.W > span {
127+ t.Fatalf("n=%d max=%d column %d %+v outside span %d", tc.n, tc.max, i, p.Rect, span)
128+ }
123 if p.Hidden || p.Peek != (tc.cards[i] != 0) || p.Focused != (i == tc.max) || p.Rect != want {129 if p.Hidden || p.Peek != (tc.cards[i] != 0) || p.Focused != (i == tc.max) || p.Rect != want {
124 t.Fatalf("n=%d max=%d column %d: %+v, want rect %+v card %v", tc.n, tc.max, i, p, want, tc.cards[i] != 0)130 t.Fatalf("n=%d max=%d column %d: %+v, want rect %+v card %v", tc.n, tc.max, i, p, want, tc.cards[i] != 0)
125 }131 }
@@ -198,9 +204,9 @@ func TestOverviewCascadeMaximizedCardPickRecordsWindow(t *testing.T) {
198 }204 }
199 }205 }
200 206
201-// Only the focused maximized column is inset for cards: a FullWidth column207+// A FullWidth column outside the focused band fills its band, shifted like
202-// elsewhere fills its band.208+// every tile by the room of the focused column's cards.
203-func TestOverviewCascadeUnfocusedMaximizedNotInset(t *testing.T) {209+func TestOverviewCascadeUnfocusedMaximizedFillsBand(t *testing.T) {
204 w := cascadeWorkspace(6)210 w := cascadeWorkspace(6)
205 w.SetGaps(8)211 w.SetGaps(8)
206 w.Focus = 4212 w.Focus = 4

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