v0.14.0 76d1892

types.go RawHistoryFolder

1package webkit
2
3// WindowType indicates how a new WebView should be treated
4type WindowType int
5
6const (
7	// WindowTypeTab represents an independent WebView (future: tab)
8	WindowTypeTab WindowType = iota
9	// WindowTypePopup represents a related WebView (shares process/context)
10	WindowTypePopup
11	// WindowTypeUnknown indicates type not detected yet
12	WindowTypeUnknown
13)
14
15// WindowFeatures describes the window features detected from WebKitWindowProperties
16type WindowFeatures struct {
17	Width              int
18	Height             int
19	ToolbarVisible     bool
20	LocationbarVisible bool
21	MenubarVisible     bool
22	Resizable          bool
23}
24
25// Config holds WebView configuration
26type Config struct {
27	// UserAgent string for the WebView
28	UserAgent string
29
30	// EnableJavaScript controls JavaScript execution
31	EnableJavaScript bool
32
33	// EnableWebGL controls WebGL support
34	EnableWebGL bool
35
36	// EnableMediaStream controls media stream support
37	EnableMediaStream bool
38
39	// HardwareAcceleration controls GPU acceleration
40	HardwareAcceleration bool
41
42	// DefaultFontSize in pixels
43	DefaultFontSize int
44
45	// MinimumFontSize in pixels
46	MinimumFontSize int
47
48	// Performance optimizations
49	// EnablePageCache enables back/forward cache for instant navigation
50	EnablePageCache bool
51
52	// EnableSmoothScrolling enables smooth scrolling animations
53	EnableSmoothScrolling bool
54
55	// DataDir is the directory for persistent data (cookies, localStorage, etc.)
56	DataDir string
57
58	// CacheDir is the directory for HTTP cache
59	CacheDir string
60
61	// AppearanceConfigJSON is the JSON string for appearance configuration
62	// This will be injected at document-start via UserContentManager
63	AppearanceConfigJSON string
64
65	// CreateWindow controls whether to create a standalone GTK Window for this WebView
66	// Set to false for WebViews that will be embedded in workspace panes
67	CreateWindow bool
68}
69
70// GetDefaultConfig returns a Config with sensible defaults
71func GetDefaultConfig() *Config {
72	return &Config{
73		UserAgent:             "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36",
74		EnableJavaScript:      true,
75		EnableWebGL:           true,
76		EnableMediaStream:     true,
77		HardwareAcceleration:  true,
78		DefaultFontSize:       16,
79		MinimumFontSize:       8,
80		EnablePageCache:       true, // Instant back/forward navigation
81		EnableSmoothScrolling: true, // Better UX
82		CreateWindow:          true, // Default to standalone window
83	}
84}

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