detached 34ae144

fix(core): leave a maximized remembered column in its band on restore

commit
34ae144ea359abb75730d7de46f99a3c80849581
author
brice · · 2026-10-23 05:51 UTC
parent
e222a11
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
checks
1/1
2 files · +22 -1
M internal/core/cascade.go +2 -1
@@ -539,7 +539,8 @@ func (w *Workspace) restoreBand() bool {
539539 for k, nb := range nbs {
540540 adjacent := !slices.ContainsFunc(nbs[:k], func(n int) bool { return !ownOnly[n] })
541541 i := slices.IndexFunc(bands[nb], func(c Column) bool {
542- return c.Windows[0] == e[head] && (adjacent || c.ownBand)
542+ // A column the user maximized keeps its band.
543+ return c.Windows[0] == e[head] && !c.FullWidth && (adjacent || c.ownBand)
543544 })
544545 if i < 0 {
545546 continue
@@ -539,7 +539,8 @@ func (w *Workspace) restoreBand() bool {
539 for k, nb := range nbs {539 for k, nb := range nbs {
540 adjacent := !slices.ContainsFunc(nbs[:k], func(n int) bool { return !ownOnly[n] })540 adjacent := !slices.ContainsFunc(nbs[:k], func(n int) bool { return !ownOnly[n] })
541 i := slices.IndexFunc(bands[nb], func(c Column) bool {541 i := slices.IndexFunc(bands[nb], func(c Column) bool {
542- return c.Windows[0] == e[head] && (adjacent || c.ownBand)542+ // A column the user maximized keeps its band.
543+ return c.Windows[0] == e[head] && !c.FullWidth && (adjacent || c.ownBand)
543 })544 })
544 if i < 0 {545 if i < 0 {
545 continue546 continue
M internal/core/cascade_fullscreen_band_test.go +20 -0
@@ -386,6 +386,26 @@ func TestRestoreBandAcrossPromotedFloatBand(t *testing.T) {
386386 }
387387 }
388388
389+// A remembered neighbor the user maximized since keeps its band; the
390+// ordinary neighbors still come back.
391+func TestRestoreBandLeavesMaximizedNeighbor(t *testing.T) {
392+ _, w := cascadeMovesCore(t, 3, 3, false)
393+ w.FocusID(1)
394+ w.ToggleFullWidth()
395+ wantBands(t, w, []WindowID{1}, []WindowID{2, 3})
396+ w.FocusID(2)
397+ w.ToggleFullscreen()
398+ w.ToggleFullscreen()
399+ w.ToggleFullWidth()
400+ wantBands(t, w, []WindowID{1}, []WindowID{3}, []WindowID{2})
401+ w.FocusID(1)
402+ w.ToggleFullWidth()
403+ wantBands(t, w, []WindowID{1, 3}, []WindowID{2})
404+ if c := w.columnOf(2); c < 0 || !w.Columns[c].FullWidth {
405+ t.Fatal("column 2 lost its maximization")
406+ }
407+}
408+
389409 func TestPromotedFullscreenFloatMovesToNeighborMonitor(t *testing.T) {
390410 for _, tc := range []struct {
391411 a Action
@@ -386,6 +386,26 @@ func TestRestoreBandAcrossPromotedFloatBand(t *testing.T) {
386 }386 }
387 }387 }
388 388
389+// A remembered neighbor the user maximized since keeps its band; the
390+// ordinary neighbors still come back.
391+func TestRestoreBandLeavesMaximizedNeighbor(t *testing.T) {
392+ _, w := cascadeMovesCore(t, 3, 3, false)
393+ w.FocusID(1)
394+ w.ToggleFullWidth()
395+ wantBands(t, w, []WindowID{1}, []WindowID{2, 3})
396+ w.FocusID(2)
397+ w.ToggleFullscreen()
398+ w.ToggleFullscreen()
399+ w.ToggleFullWidth()
400+ wantBands(t, w, []WindowID{1}, []WindowID{3}, []WindowID{2})
401+ w.FocusID(1)
402+ w.ToggleFullWidth()
403+ wantBands(t, w, []WindowID{1, 3}, []WindowID{2})
404+ if c := w.columnOf(2); c < 0 || !w.Columns[c].FullWidth {
405+ t.Fatal("column 2 lost its maximization")
406+ }
407+}
408+
389 func TestPromotedFullscreenFloatMovesToNeighborMonitor(t *testing.T) {409 func TestPromotedFullscreenFloatMovesToNeighborMonitor(t *testing.T) {
390 for _, tc := range []struct {410 for _, tc := range []struct {
391 a Action411 a Action

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