v0.33.0 62a09f5

engine_adapters.go RawHistoryFolder

1package cef
2
3import (
4	"context"
5	"fmt"
6
7	"github.com/bnema/dumber/internal/application/port"
8	"github.com/bnema/dumber/internal/logging"
9)
10
11// --- WebViewFactory adapter ---
12
13// webViewFactoryAdapter bridges *WebViewFactory to port.WebViewFactory.
14// WebViewFactory.Create and CreateRelated return port.WebView directly,
15// so this adapter is thin but ensures the concrete type stays private.
16type webViewFactoryAdapter struct {
17	factory *WebViewFactory
18}
19
20func (a *webViewFactoryAdapter) Create(ctx context.Context) (port.WebView, error) {
21	return a.factory.Create(ctx)
22}
23
24func (a *webViewFactoryAdapter) CreateRelated(ctx context.Context, parentID port.WebViewID) (port.WebView, error) {
25	return a.factory.CreateRelated(ctx, parentID)
26}
27
28// --- WebViewPool adapter ---
29
30// webViewPoolAdapter bridges *WebViewPool to port.WebViewPool.
31type webViewPoolAdapter struct {
32	pool *WebViewPool
33	ctx  context.Context
34}
35
36func (a *webViewPoolAdapter) Acquire(ctx context.Context) (port.WebView, error) {
37	wv, err := a.pool.Acquire(ctx)
38	if err != nil {
39		return nil, err
40	}
41	return wv, nil
42}
43
44func (a *webViewPoolAdapter) Release(wv port.WebView) {
45	if wv == nil {
46		return
47	}
48	cwv, ok := wv.(*WebView)
49	if !ok {
50		logging.FromContext(a.ctx).Warn().
51			Str("concrete_type", fmt.Sprintf("%T", wv)).
52			Msg("webViewPoolAdapter.Release: unexpected type, cannot release to pool")
53		return
54	}
55	a.pool.Release(cwv)
56}
57
58func (a *webViewPoolAdapter) Prewarm(count int) {
59	a.pool.Prewarm(count)
60}
61
62func (a *webViewPoolAdapter) PrewarmAsync(ctx context.Context, count int) {
63	a.pool.PrewarmAsync(ctx, count)
64}
65
66func (a *webViewPoolAdapter) Size() int {
67	return a.pool.Size()
68}
69
70func (a *webViewPoolAdapter) Close() {
71	a.pool.Close()
72}
73
74// --- No-op stubs for Phase 1 ---
75
76// noopContentInjector implements port.ContentInjector as a no-op.
77type noopContentInjector struct{}
78
79func (n *noopContentInjector) InjectThemeCSS(_ context.Context, _ string) error {
80	return nil
81}
82
83func (n *noopContentInjector) InjectFindHighlightCSS(_ context.Context, _ string) error {
84	return nil
85}
86
87func (n *noopContentInjector) RefreshScripts(_ context.Context, _ port.WebView) error {
88	return nil
89}
90
91// noopSettingsApplier implements port.SettingsApplier as a no-op.
92type noopSettingsApplier struct{}
93
94func (n *noopSettingsApplier) ApplyToAll(_ context.Context, _ []port.WebView) {}
95
96// noopFaviconDatabase implements port.FaviconDatabase as a no-op.
97type noopFaviconDatabase struct{}
98
99func (n *noopFaviconDatabase) GetFaviconAsync(_ string, callback func(port.Texture)) {
100	callback(nil)
101}

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