v0.15.0 9006957

borders_overlay.go RawHistoryFolder

1package browser
2
3import (
4	"github.com/bnema/dumber/internal/logging"
5	"github.com/bnema/dumber/pkg/webkit"
6	"github.com/diamondburned/gotk4/pkg/gtk/v4"
7)
8
9// createBorderOverlay builds a transparent overlay widget that displays as a border when visible.
10// This allows showing visual borders without affecting layout or causing content shifts.
11func (tm *TabManager) createBorderOverlay(cssClass string) gtk.Widgetter {
12	box := gtk.NewBox(gtk.OrientationVertical, 0)
13	if box == nil {
14		logging.Error("[tabs] Failed to create border overlay for " + cssClass)
15		return nil
16	}
17
18	box.AddCSSClass(cssClass)
19	box.SetHExpand(true)
20	box.SetVExpand(true)
21	box.SetCanTarget(false) // Don't intercept mouse events - overlay is visual only
22
23	return box
24}
25
26// wrapPaneInOverlay wraps a pane container widget in a gtk.Overlay with a border overlay.
27// This allows showing active pane borders without affecting layout or causing content shifts.
28// Returns the overlay (new container) and the border widget (to store in paneNode.borderOverlay).
29func wrapPaneInOverlay(paneContainer gtk.Widgetter) (*gtk.Overlay, gtk.Widgetter) {
30	// Create the overlay container
31	overlay := gtk.NewOverlay()
32	if overlay == nil {
33		logging.Error("[workspace] Failed to create overlay for pane border")
34		return nil, nil
35	}
36	overlay.SetHExpand(true)
37	overlay.SetVExpand(true)
38
39	// Set the pane container as the main child
40	overlay.SetChild(paneContainer)
41
42	// Create the border overlay widget (transparent box with border CSS)
43	borderBox := gtk.NewBox(gtk.OrientationVertical, 0)
44	if borderBox == nil {
45		logging.Error("[workspace] Failed to create border overlay box")
46		return overlay, nil
47	}
48
49	borderBox.AddCSSClass("pane-border-overlay")
50	borderBox.SetHExpand(true)
51	borderBox.SetVExpand(true)
52	borderBox.SetCanTarget(false) // Don't intercept mouse events - overlay is visual only
53
54	// Add the border overlay to the overlay (hidden by default)
55	overlay.AddOverlay(borderBox)
56	webkit.WidgetSetVisible(borderBox, false)
57
58	return overlay, borderBox
59}
60
61// showPaneModeBorder displays the pane mode border overlay.
62func (tm *TabManager) showPaneModeBorder() {
63	if tm.paneModeOverlay == nil {
64		return
65	}
66	webkit.WidgetSetVisible(tm.paneModeOverlay, true)
67	logging.Debug("[pane-mode] Showing pane mode border overlay")
68}
69
70// hidePaneModeBorder hides the pane mode border overlay.
71func (tm *TabManager) hidePaneModeBorder() {
72	if tm.paneModeOverlay == nil {
73		return
74	}
75	webkit.WidgetSetVisible(tm.paneModeOverlay, false)
76	logging.Debug("[pane-mode] Hiding pane mode border overlay")
77}
78
79// showTabModeBorder displays the tab mode border overlay.
80func (tm *TabManager) showTabModeBorder() {
81	if tm.tabModeOverlay == nil {
82		return
83	}
84	webkit.WidgetSetVisible(tm.tabModeOverlay, true)
85	logging.Debug("[tab-mode] Showing tab mode border overlay")
86}
87
88// hideTabModeBorder hides the tab mode border overlay.
89func (tm *TabManager) hideTabModeBorder() {
90	if tm.tabModeOverlay == nil {
91		return
92	}
93	webkit.WidgetSetVisible(tm.tabModeOverlay, false)
94	logging.Debug("[tab-mode] Hiding tab mode border overlay")
95}

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