v0.12.1 1453d21

interfaces.go RawHistoryFolder

1package browser
2
3import (
4	"github.com/bnema/dumber/internal/app/messaging"
5	"github.com/bnema/dumber/pkg/webkit"
6)
7
8//go:generate mockgen -source=interfaces.go -destination=mocks/mock_browser.go -package=mock_browser
9
10// WebViewInterface abstracts WebKit WebView for testing
11type WebViewInterface interface {
12	LoadURL(url string) error
13	Show() error
14	Hide() error
15	Destroy() error
16	Window() *webkit.Window
17	GetCurrentURL() string
18	Widget() uintptr
19	RootWidget() uintptr
20	InjectScript(script string) error
21	DispatchCustomEvent(event string, detail map[string]any) error
22	RegisterKeyboardShortcut(key string, handler func()) error
23	RegisterURIChangedHandler(handler func(string))
24}
25
26// PaneInterface abstracts BrowserPane for testing
27type PaneInterface interface {
28	WebView() WebViewInterface
29	MessageHandler() MessageHandlerInterface
30	NavigationController() NavigationControllerInterface
31	ZoomController() ZoomControllerInterface
32	ClipboardController() ClipboardControllerInterface
33	ShortcutHandler() ShortcutHandlerInterface
34	ID() string
35	HasGUI() bool
36	SetHasGUI(bool)
37	SetID(string)
38	UpdateLastFocus()
39	HasGUIComponent(component string) bool
40	SetGUIComponent(component string, loaded bool)
41	Cleanup()
42}
43
44// MessageHandlerInterface abstracts messaging.Handler
45type MessageHandlerInterface interface {
46	SetWorkspaceObserver(observer messaging.WorkspaceObserver)
47}
48
49// NavigationControllerInterface abstracts navigation operations
50type NavigationControllerInterface interface {
51	NavigateToURL(url string) error
52}
53
54// ZoomControllerInterface abstracts zoom operations
55type ZoomControllerInterface interface {
56	ApplyInitialZoom()
57}
58
59// ClipboardControllerInterface abstracts clipboard operations
60type ClipboardControllerInterface interface {
61	// Add methods as needed
62}
63
64// ShortcutHandlerInterface abstracts shortcut handling
65type ShortcutHandlerInterface interface {
66	// Add methods as needed
67}
68
69// BrowserAppInterface abstracts BrowserApp for testing
70type BrowserAppInterface interface {
71	GetPanes() []*BrowserPane
72	SetActivePane(pane *BrowserPane)
73	GetActivePane() *BrowserPane
74	AppendPane(pane *BrowserPane)
75	RemovePane(pane *BrowserPane)
76	BuildWebkitConfig() (*webkit.Config, error)
77	CreatePaneForView(view *webkit.WebView) (*BrowserPane, error)
78}
79
80// WindowInterface abstracts webkit.Window for testing
81type WindowInterface interface {
82	SetChild(widget uintptr)
83}
84
85// WindowShortcutHandlerInterface abstracts window shortcut handling for testing
86type WindowShortcutHandlerInterface interface {
87	Cleanup()
88}

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