v0.33.0 62a09f5

favicon_resolver.go RawHistoryFolder

1package port
2
3import (
4	"context"
5
6	"github.com/bnema/dumber/internal/domain/favicon"
7)
8
9// FaviconResolvePurpose identifies the context requesting favicon resolution.
10type FaviconResolvePurpose string
11
12const (
13	// FaviconResolvePurposeUI resolves favicons for end-user UI display.
14	FaviconResolvePurposeUI FaviconResolvePurpose = "ui"
15	// FaviconResolvePurposeSystemview resolves favicons for internal views without remote loads.
16	FaviconResolvePurposeSystemview FaviconResolvePurpose = "systemview"
17	// FaviconResolvePurposeRefresh resolves favicons for background refresh work.
18	FaviconResolvePurposeRefresh FaviconResolvePurpose = "refresh"
19)
20
21// FaviconResolveOptions controls cache lookup, blocking refresh, background refresh, and caller intent.
22type FaviconResolveOptions struct {
23	AllowBlockingRefresh      bool
24	ScheduleBackgroundRefresh bool
25	Purpose                   FaviconResolvePurpose
26}
27
28// ResolvedFavicon is a fully resolved favicon payload with metadata and refresh state.
29// Key identifies the cache entry; Bytes and ContentType hold image data; Metadata and BackgroundRefreshScheduled describe state.
30type ResolvedFavicon struct {
31	Key                        favicon.Key
32	Bytes                      []byte
33	ContentType                string
34	Metadata                   *favicon.Metadata
35	BackgroundRefreshScheduled bool
36}
37
38// FaviconResolver orchestrates favicon lookup, observation, refresh, sizing, and invalidation.
39// It extends FaviconSystemviewResolver for boundary-safe systemview reads.
40type FaviconResolver interface {
41	FaviconSystemviewResolver
42	Resolve(ctx context.Context, rawURLOrDomain string, size int, options FaviconResolveOptions) (*ResolvedFavicon, error)
43	Observe(ctx context.Context, pageURL, iconURL string, bytes []byte, source favicon.Source, contentType string) (*favicon.Metadata, error)
44	RefreshFromIconURLs(ctx context.Context, pageURL string, iconURLs []string) error
45	EnsureSized(ctx context.Context, key favicon.Key, size int) error
46	Invalidate(ctx context.Context, key favicon.Key) error
47}
48
49// FaviconSystemviewResolver is the boundary-safe API used by engine scheme
50// handlers. Implementations must resolve exact keys and parent fallbacks through
51// the application usecase and must not trigger remote network loads.
52type FaviconSystemviewResolver interface {
53	ResolveSystemviewIcon(ctx context.Context, rawDomain string, size int) (*ResolvedFavicon, error)
54}
55
56// SystemviewFaviconResolverSetter is an optional engine capability that wires
57// the application favicon resolver to internal systemview pages.
58type SystemviewFaviconResolverSetter interface {
59	SetSystemviewFaviconResolver(resolver FaviconSystemviewResolver)
60}

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