detached 0319096

fix(stacked-panes): stop wrapping at stack boundaries

commit
03190967ad8e533451285f170e34562362c4ecf3
author
bnema · · 2025-11-13 21:54 UTC
committer
bnema · · 2025-11-13 18:22 UTC
parent
6bf432a
signature
unsigned
1 file · +6 -3
M internal/app/browser/stacked_panes.go +6 -3
@@ -7,9 +7,10 @@ import (
77 "sync/atomic"
88 "time"
99
10- "github.com/bnema/dumber/pkg/webkit"
1110 "github.com/diamondburned/gotk4/pkg/gdk/v4"
1211 "github.com/diamondburned/gotk4/pkg/gtk/v4"
12+
13+ "github.com/bnema/dumber/pkg/webkit"
1314 )
1415
1516 const (
@@ -478,12 +479,14 @@ func (spm *StackedPaneManager) NavigateStack(direction string) bool {
478479 case DirectionUp:
479480 newIndex = currentIndex - 1
480481 if newIndex < 0 {
481- newIndex = len(stackNode.stackedPanes) - 1 // Wrap to last
482+ // At the top of the stack - allow navigation outside
483+ return false
482484 }
483485 case DirectionDown:
484486 newIndex = currentIndex + 1
485487 if newIndex >= len(stackNode.stackedPanes) {
486- newIndex = 0 // Wrap to first
488+ // At the bottom of the stack - allow navigation outside
489+ return false
487490 }
488491 default:
489492 return false
@@ -7,9 +7,10 @@ import (
7 "sync/atomic"7 "sync/atomic"
8 "time"8 "time"
9 9
10- "github.com/bnema/dumber/pkg/webkit"
11 "github.com/diamondburned/gotk4/pkg/gdk/v4"10 "github.com/diamondburned/gotk4/pkg/gdk/v4"
12 "github.com/diamondburned/gotk4/pkg/gtk/v4"11 "github.com/diamondburned/gotk4/pkg/gtk/v4"
12+
13+ "github.com/bnema/dumber/pkg/webkit"
13 )14 )
14 15
15 const (16 const (
@@ -478,12 +479,14 @@ func (spm *StackedPaneManager) NavigateStack(direction string) bool {
478 case DirectionUp:479 case DirectionUp:
479 newIndex = currentIndex - 1480 newIndex = currentIndex - 1
480 if newIndex < 0 {481 if newIndex < 0 {
481- newIndex = len(stackNode.stackedPanes) - 1 // Wrap to last482+ // At the top of the stack - allow navigation outside
483+ return false
482 }484 }
483 case DirectionDown:485 case DirectionDown:
484 newIndex = currentIndex + 1486 newIndex = currentIndex + 1
485 if newIndex >= len(stackNode.stackedPanes) {487 if newIndex >= len(stackNode.stackedPanes) {
486- newIndex = 0 // Wrap to first488+ // At the bottom of the stack - allow navigation outside
489+ return false
487 }490 }
488 default:491 default:
489 return false492 return false

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 8

Tags 42

↑↓ moveenter openesc close