v0.30.0 eb3068f

bulk.go RawHistoryFolder

1package content
2
3import (
4	"context"
5
6	"github.com/bnema/dumber/internal/application/port"
7	"github.com/bnema/dumber/internal/domain/entity"
8	"github.com/bnema/dumber/internal/logging"
9)
10
11// ApplyFiltersToAll applies content filters to all active webviews.
12// Called when filters become available after webviews were already created.
13func (c *Coordinator) ApplyFiltersToAll(ctx context.Context) {
14	log := logging.FromContext(ctx)
15	if c.filterApplier == nil {
16		log.Debug().Msg("ApplyFiltersToAll: no filter applier configured")
17		return
18	}
19
20	c.webViewsMu.RLock()
21	snapshot := make([]port.WebView, 0, len(c.webViews))
22	for _, wv := range c.webViews {
23		snapshot = append(snapshot, wv)
24	}
25	c.webViewsMu.RUnlock()
26
27	c.filterApplier.ApplyToAll(ctx, snapshot)
28	log.Debug().Int("count", len(snapshot)).Msg("applied filters to all webviews")
29}
30
31// ApplySettingsToAll reapplies engine settings to all active WebViews.
32func (c *Coordinator) ApplySettingsToAll(ctx context.Context) {
33	log := logging.FromContext(ctx)
34	if c.settingsApplier == nil {
35		log.Debug().Msg("ApplySettingsToAll: no settings applier configured")
36		return
37	}
38
39	c.webViewsMu.RLock()
40	snapshot := make([]port.WebView, 0, len(c.webViews))
41	for _, wv := range c.webViews {
42		snapshot = append(snapshot, wv)
43	}
44	c.webViewsMu.RUnlock()
45
46	c.settingsApplier.ApplyToAll(ctx, snapshot)
47	log.Debug().Int("count", len(snapshot)).Msg("applied settings to all webviews")
48}
49
50// RefreshInjectedScriptsToAll clears and re-injects user scripts into all active WebViews.
51//
52// WebKit user scripts are snapshotted when added to a WebKitUserContentManager, so when
53// appearance settings change at runtime (dark mode, palettes, UI scale), we must refresh
54// the scripts so future navigations pick up the latest values.
55// Script refresh is deferred for any WebView that is currently loading to avoid
56// removing scripts mid-navigation.
57func (c *Coordinator) RefreshInjectedScriptsToAll(ctx context.Context) {
58	log := logging.FromContext(ctx)
59	if c.injector == nil {
60		return
61	}
62
63	// Snapshot webViews under lock to avoid data race with concurrent popup create/close.
64	c.webViewsMu.RLock()
65	snapshot := make(map[entity.PaneID]port.WebView, len(c.webViews))
66	for k, v := range c.webViews {
67		snapshot[k] = v
68	}
69	c.webViewsMu.RUnlock()
70
71	for paneID, wv := range snapshot {
72		if wv == nil || wv.IsDestroyed() {
73			continue
74		}
75		if c.shouldDeferAppearance(wv) {
76			c.queueScriptRefresh(paneID)
77			log.Debug().Str("pane_id", string(paneID)).Msg("deferred script refresh until load finished")
78			continue
79		}
80
81		c.refreshInjectedScripts(ctx, c.injector, paneID, wv)
82	}
83}

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