detached 2efed64

fix: guard type assertion and use renderer for engine migration output

commit
2efed6475e8775fd4f1ac1e234ed4672489231f7
author
brice · · 2026-03-18 06:30 UTC
parent
dbd974e
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
3 files · +16 -2
M cmd/dumber/main.go +4 -1
@@ -515,7 +515,10 @@ func buildUIDependencies(
515515 currentSessionID entity.SessionID,
516516 startupCrashReports []string,
517517 ) *ui.Dependencies {
518- filterManager := engine.(*webkit.Engine).InternalFilterManager()
518+ var filterManager port.FilterManager
519+ if wkEngine, ok := engine.(*webkit.Engine); ok {
520+ filterManager = wkEngine.InternalFilterManager()
521+ }
519522
520523 focusProvider := textinput.NewFocusProvider()
521524
@@ -515,7 +515,10 @@ func buildUIDependencies(
515 currentSessionID entity.SessionID,515 currentSessionID entity.SessionID,
516 startupCrashReports []string,516 startupCrashReports []string,
517 ) *ui.Dependencies {517 ) *ui.Dependencies {
518- filterManager := engine.(*webkit.Engine).InternalFilterManager()518+ var filterManager port.FilterManager
519+ if wkEngine, ok := engine.(*webkit.Engine); ok {
520+ filterManager = wkEngine.InternalFilterManager()
521+ }
519 522
520 focusProvider := textinput.NewFocusProvider()523 focusProvider := textinput.NewFocusProvider()
521 524
M internal/cli/cmd/config.go +1 -1
@@ -255,7 +255,7 @@ func runConfigMigrate(_ *cobra.Command, _ []string) error {
255255 return nil
256256 }
257257 if engineMigrated {
258- fmt.Printf(" Migrated legacy sections to [engine]/[engine.webkit]\n")
258+ fmt.Print(renderer.RenderEngineMigrationSuccess())
259259 }
260260
261261 // Detect changes (includes renames, additions, and removals)
@@ -255,7 +255,7 @@ func runConfigMigrate(_ *cobra.Command, _ []string) error {
255 return nil255 return nil
256 }256 }
257 if engineMigrated {257 if engineMigrated {
258- fmt.Printf(" Migrated legacy sections to [engine]/[engine.webkit]\n")258+ fmt.Print(renderer.RenderEngineMigrationSuccess())
259 }259 }
260 260
261 // Detect changes (includes renames, additions, and removals)261 // Detect changes (includes renames, additions, and removals)
M internal/cli/styles/config.go +11 -0
@@ -247,6 +247,17 @@ func (r *ConfigRenderer) RenderNoConfigFile(path string) string {
247247 )
248248 }
249249
250+// RenderEngineMigrationSuccess renders the success message after migrating legacy
251+// sections to [engine]/[engine.webkit].
252+func (r *ConfigRenderer) RenderEngineMigrationSuccess() string {
253+ iconStyle := lipgloss.NewStyle().Foreground(r.theme.Success)
254+
255+ return fmt.Sprintf(
256+ " %s Migrated legacy sections to [engine]/[engine.webkit]\n",
257+ iconStyle.Render(IconCheck),
258+ )
259+}
260+
250261 // RenderOpening renders a brief "opening config" message for `dumber config open`.
251262 func (r *ConfigRenderer) RenderOpening(path, editor string) string {
252263 iconStyle := r.theme.Subtle
@@ -247,6 +247,17 @@ func (r *ConfigRenderer) RenderNoConfigFile(path string) string {
247 )247 )
248 }248 }
249 249
250+// RenderEngineMigrationSuccess renders the success message after migrating legacy
251+// sections to [engine]/[engine.webkit].
252+func (r *ConfigRenderer) RenderEngineMigrationSuccess() string {
253+ iconStyle := lipgloss.NewStyle().Foreground(r.theme.Success)
254+
255+ return fmt.Sprintf(
256+ " %s Migrated legacy sections to [engine]/[engine.webkit]\n",
257+ iconStyle.Render(IconCheck),
258+ )
259+}
260+
250 // RenderOpening renders a brief "opening config" message for `dumber config open`.261 // RenderOpening renders a brief "opening config" message for `dumber config open`.
251 func (r *ConfigRenderer) RenderOpening(path, editor string) string {262 func (r *ConfigRenderer) RenderOpening(path, editor string) string {
252 iconStyle := r.theme.Subtle263 iconStyle := r.theme.Subtle

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