v0.32.0 0617278

registry.go RawHistoryFolder

1package homepage
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// Config holds dependencies for homepage handlers.
12type Config struct {
13	HistoryUC   port.HomepageHistory
14	FavoritesUC port.HomepageFavorites
15}
16
17// RegisterHandlers registers all homepage message handlers with the router.
18func RegisterHandlers(ctx context.Context, router port.WebUIHandlerRouter, cfg Config) error {
19	log := logging.FromContext(ctx)
20	log.Debug().Msg("registering homepage message handlers")
21
22	// Common callback for all homepage handlers
23	const callback = "__dumber_homepage_response"
24	const errorCallback = "__dumber_error"
25	const worldName = "" // main world
26
27	handlers := make(map[string]port.WebUIMessageHandler)
28
29	// History handlers
30	historyHandlers := NewHistoryHandlers(cfg.HistoryUC)
31	handlers["history_timeline"] = historyHandlers.HandleTimeline()
32	handlers["history_timeline_by_domain"] = historyHandlers.HandleTimelineByDomain()
33	handlers["history_timeline_window"] = historyHandlers.HandleTimelineWindow()
34	handlers["history_search_fts"] = historyHandlers.HandleSearchFTS()
35	handlers["history_delete_entry"] = historyHandlers.HandleDeleteEntry()
36	handlers["history_delete_range"] = historyHandlers.HandleDeleteRange()
37	handlers["history_clear_all"] = historyHandlers.HandleClearAll()
38	handlers["history_stats"] = historyHandlers.HandleStats()
39	handlers["history_analytics"] = historyHandlers.HandleAnalytics()
40	handlers["history_domain_stats"] = historyHandlers.HandleDomainStats()
41	handlers["history_delete_domain"] = historyHandlers.HandleDeleteDomain()
42
43	// Favorites handlers
44	favoritesHandlers := NewFavoritesHandlers(cfg.FavoritesUC)
45	handlers["favorite_list"] = favoritesHandlers.HandleList()
46	handlers["favorite_create"] = favoritesHandlers.HandleCreate()
47	handlers["favorite_update"] = favoritesHandlers.HandleUpdate()
48	handlers["favorite_delete"] = favoritesHandlers.HandleDelete()
49	handlers["favorite_set_shortcut"] = favoritesHandlers.HandleSetShortcut()
50	handlers["favorite_get_by_shortcut"] = favoritesHandlers.HandleGetByShortcut()
51	// Tag handlers
52	tagHandlers := NewTagHandlers(cfg.FavoritesUC)
53	handlers["tag_list"] = tagHandlers.HandleList()
54	handlers["tag_create"] = tagHandlers.HandleCreate()
55	handlers["tag_delete"] = tagHandlers.HandleDelete()
56	handlers["tag_update"] = tagHandlers.HandleUpdate() // Requires UpdateTag()
57	handlers["tag_assign"] = tagHandlers.HandleAssign()
58	handlers["tag_remove"] = tagHandlers.HandleRemove()
59
60	// Register all handlers
61	for msgType, handler := range handlers {
62		if err := router.RegisterHandlerWithCallbacks(msgType, callback, errorCallback, worldName, handler); err != nil {
63			return fmt.Errorf("failed to register handler %s: %w", msgType, err)
64		}
65		log.Debug().Str("type", msgType).Msg("registered homepage handler")
66	}
67
68	log.Info().Int("count", len(handlers)).Msg("homepage handlers registered")
69	return nil
70}

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