fix: resolve all golangci-lint issues to zero
- Replace lambda with direct handlers.RegisterAccentHandlers reference - Separate Deprecated comment into dedicated paragraph - Extract initContentCoordinator to reduce initCoordinators complexity - Break long lines under 140 chars in signatures and struct fields - Fix "behaviour" -> "behavior" misspellings in comments - Use unnamed receiver (*GTKEntryTarget) instead of underscore - Add nolint explanations for struct tag lines
- commit
- 4eef5c120d2a174d2fe88325c6f0e221d597f34c
- author
- brice · · 2026-03-18 19:18 UTC
- parent
- f5762b8
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
9 files · +60 -40
M internal/bootstrap/engine.go +1 -3
| @@ -67,9 +67,7 @@ func BuildEngine(input EngineInput) (port.Engine, error) { | |||
| 67 | 67 | OnClipboardCopied: deps.OnClipboardCopied, | |
| 68 | 68 | }) | |
| 69 | 69 | }, | |
| 70 | - | func(ctx context.Context, router *webkit.MessageRouter, handler port.AccentKeyHandler) error { | |
| 71 | - | return handlers.RegisterAccentHandlers(ctx, router, handler) | |
| 72 | - | }, | |
| 70 | + | handlers.RegisterAccentHandlers, | |
| 73 | 71 | ) | |
| 74 | 72 | case "cef": | |
| 75 | 73 | return nil, fmt.Errorf("CEF engine not yet implemented") | |
| @@ -67,9 +67,7 @@ func BuildEngine(input EngineInput) (port.Engine, error) { | |||||
| 67 | OnClipboardCopied: deps.OnClipboardCopied, | 67 | OnClipboardCopied: deps.OnClipboardCopied, | ||
| 68 | }) | 68 | }) | ||
| 69 | }, | 69 | }, | ||
| 70 | - | func(ctx context.Context, router *webkit.MessageRouter, handler port.AccentKeyHandler) error { | 70 | + | handlers.RegisterAccentHandlers, |
| 71 | - | return handlers.RegisterAccentHandlers(ctx, router, handler) | |||
| 72 | - | }, | |||
| 73 | ) | 71 | ) | ||
| 74 | case "cef": | 72 | case "cef": | ||
| 75 | return nil, fmt.Errorf("CEF engine not yet implemented") | 73 | return nil, fmt.Errorf("CEF engine not yet implemented") | ||
M internal/bootstrap/gui.go +4 -1
| @@ -125,7 +125,10 @@ func RunParallelInit(input ParallelInitInput) (*ParallelInitResult, error) { | |||
| 125 | 125 | var themeManager *theme.Manager | |
| 126 | 126 | go func() { | |
| 127 | 127 | defer wg.Done() | |
| 128 | - | themeManager = theme.NewManager(input.Ctx, &input.Config.Appearance, input.Config.DefaultUIScale, &input.Config.Workspace.Styling, resolver) | |
| 128 | + | themeManager = theme.NewManager( | |
| 129 | + | input.Ctx, &input.Config.Appearance, input.Config.DefaultUIScale, | |
| 130 | + | &input.Config.Workspace.Styling, resolver, | |
| 131 | + | ) | |
| 129 | 132 | }() | |
| 130 | 133 | ||
| 131 | 134 | wg.Wait() | |
| @@ -125,7 +125,10 @@ func RunParallelInit(input ParallelInitInput) (*ParallelInitResult, error) { | |||||
| 125 | var themeManager *theme.Manager | 125 | var themeManager *theme.Manager | ||
| 126 | go func() { | 126 | go func() { | ||
| 127 | defer wg.Done() | 127 | defer wg.Done() | ||
| 128 | - | themeManager = theme.NewManager(input.Ctx, &input.Config.Appearance, input.Config.DefaultUIScale, &input.Config.Workspace.Styling, resolver) | 128 | + | themeManager = theme.NewManager( |
| 129 | + | input.Ctx, &input.Config.Appearance, input.Config.DefaultUIScale, | |||
| 130 | + | &input.Config.Workspace.Styling, resolver, | |||
| 131 | + | ) | |||
| 129 | }() | 132 | }() | ||
| 130 | 133 | ||||
| 131 | wg.Wait() | 134 | wg.Wait() | ||
M internal/domain/entity/config_types.go +17 -15
| @@ -174,22 +174,24 @@ type PopupBehaviorConfig struct { | |||
| 174 | 174 | OAuthAutoClose bool `mapstructure:"oauth_auto_close" yaml:"oauth_auto_close" toml:"oauth_auto_close" json:"oauth_auto_close"` | |
| 175 | 175 | } | |
| 176 | 176 | ||
| 177 | - | // WorkspaceConfig holds all workspace layout and behaviour settings. | |
| 177 | + | // WorkspaceConfig holds all workspace layout and behavior settings. | |
| 178 | 178 | type WorkspaceConfig struct { | |
| 179 | - | NewPaneURL string `mapstructure:"new_pane_url" yaml:"new_pane_url" toml:"new_pane_url"` | |
| 180 | - | PaneMode PaneModeConfig `mapstructure:"pane_mode" yaml:"pane_mode" toml:"pane_mode" json:"pane_mode"` | |
| 181 | - | TabMode TabModeConfig `mapstructure:"tab_mode" yaml:"tab_mode" toml:"tab_mode" json:"tab_mode"` | |
| 182 | - | ResizeMode ResizeModeConfig `mapstructure:"resize_mode" yaml:"resize_mode" toml:"resize_mode" json:"resize_mode"` | |
| 183 | - | Shortcuts GlobalShortcutsConfig `mapstructure:"shortcuts" yaml:"shortcuts" toml:"shortcuts" json:"shortcuts"` | |
| 184 | - | FloatingPane FloatingPaneConfig `mapstructure:"floating_pane" yaml:"floating_pane" toml:"floating_pane" json:"floating_pane"` | |
| 185 | - | TabBarPosition string `mapstructure:"tab_bar_position" yaml:"tab_bar_position" toml:"tab_bar_position" json:"tab_bar_position"` | |
| 186 | - | HideTabBarWhenSingleTab bool `mapstructure:"hide_tab_bar_when_single_tab" yaml:"hide_tab_bar_when_single_tab" toml:"hide_tab_bar_when_single_tab" json:"hide_tab_bar_when_single_tab"` //nolint:lll // struct tags must stay on one line | |
| 187 | - | SwitchToTabOnMove bool `mapstructure:"switch_to_tab_on_move" yaml:"switch_to_tab_on_move" toml:"switch_to_tab_on_move" json:"switch_to_tab_on_move"` //nolint:lll // struct tags must stay on one line | |
| 188 | - | Popups PopupBehaviorConfig `mapstructure:"popups" yaml:"popups" toml:"popups" json:"popups"` | |
| 189 | - | Styling WorkspaceStylingConfig `mapstructure:"styling" yaml:"styling" toml:"styling" json:"styling"` | |
| 190 | - | } | |
| 191 | - | ||
| 192 | - | // UpdateConfig holds auto-update behaviour settings. | |
| 179 | + | NewPaneURL string `mapstructure:"new_pane_url" yaml:"new_pane_url" toml:"new_pane_url"` | |
| 180 | + | PaneMode PaneModeConfig `mapstructure:"pane_mode" yaml:"pane_mode" toml:"pane_mode" json:"pane_mode"` | |
| 181 | + | TabMode TabModeConfig `mapstructure:"tab_mode" yaml:"tab_mode" toml:"tab_mode" json:"tab_mode"` | |
| 182 | + | ResizeMode ResizeModeConfig `mapstructure:"resize_mode" yaml:"resize_mode" toml:"resize_mode" json:"resize_mode"` | |
| 183 | + | Shortcuts GlobalShortcutsConfig `mapstructure:"shortcuts" yaml:"shortcuts" toml:"shortcuts" json:"shortcuts"` | |
| 184 | + | FloatingPane FloatingPaneConfig `mapstructure:"floating_pane" yaml:"floating_pane" toml:"floating_pane" json:"floating_pane"` | |
| 185 | + | ||
| 186 | + | TabBarPosition string `mapstructure:"tab_bar_position" yaml:"tab_bar_position" toml:"tab_bar_position" json:"tab_bar_position"` | |
| 187 | + | HideTabBarWhenSingleTab bool `mapstructure:"hide_tab_bar_when_single_tab" yaml:"hide_tab_bar_when_single_tab" toml:"hide_tab_bar_when_single_tab" json:"hide_tab_bar_when_single_tab"` //nolint:lll // struct tags must stay on one line | |
| 188 | + | SwitchToTabOnMove bool `mapstructure:"switch_to_tab_on_move" yaml:"switch_to_tab_on_move" toml:"switch_to_tab_on_move" json:"switch_to_tab_on_move"` //nolint:lll // struct tags must stay on one line | |
| 189 | + | ||
| 190 | + | Popups PopupBehaviorConfig `mapstructure:"popups" yaml:"popups" toml:"popups" json:"popups"` | |
| 191 | + | Styling WorkspaceStylingConfig `mapstructure:"styling" yaml:"styling" toml:"styling" json:"styling"` | |
| 192 | + | } | |
| 193 | + | ||
| 194 | + | // UpdateConfig holds auto-update behavior settings. | |
| 193 | 195 | type UpdateConfig struct { | |
| 194 | 196 | EnableOnStartup bool `mapstructure:"enable_on_startup" yaml:"enable_on_startup" toml:"enable_on_startup"` | |
| 195 | 197 | AutoDownload bool `mapstructure:"auto_download" yaml:"auto_download" toml:"auto_download"` | |
| @@ -174,22 +174,24 @@ type PopupBehaviorConfig struct { | |||||
| 174 | OAuthAutoClose bool `mapstructure:"oauth_auto_close" yaml:"oauth_auto_close" toml:"oauth_auto_close" json:"oauth_auto_close"` | 174 | OAuthAutoClose bool `mapstructure:"oauth_auto_close" yaml:"oauth_auto_close" toml:"oauth_auto_close" json:"oauth_auto_close"` | ||
| 175 | } | 175 | } | ||
| 176 | 176 | ||||
| 177 | - | // WorkspaceConfig holds all workspace layout and behaviour settings. | 177 | + | // WorkspaceConfig holds all workspace layout and behavior settings. |
| 178 | type WorkspaceConfig struct { | 178 | type WorkspaceConfig struct { | ||
| 179 | - | NewPaneURL string `mapstructure:"new_pane_url" yaml:"new_pane_url" toml:"new_pane_url"` | 179 | + | NewPaneURL string `mapstructure:"new_pane_url" yaml:"new_pane_url" toml:"new_pane_url"` |
| 180 | - | PaneMode PaneModeConfig `mapstructure:"pane_mode" yaml:"pane_mode" toml:"pane_mode" json:"pane_mode"` | 180 | + | PaneMode PaneModeConfig `mapstructure:"pane_mode" yaml:"pane_mode" toml:"pane_mode" json:"pane_mode"` |
| 181 | - | TabMode TabModeConfig `mapstructure:"tab_mode" yaml:"tab_mode" toml:"tab_mode" json:"tab_mode"` | 181 | + | TabMode TabModeConfig `mapstructure:"tab_mode" yaml:"tab_mode" toml:"tab_mode" json:"tab_mode"` |
| 182 | - | ResizeMode ResizeModeConfig `mapstructure:"resize_mode" yaml:"resize_mode" toml:"resize_mode" json:"resize_mode"` | 182 | + | ResizeMode ResizeModeConfig `mapstructure:"resize_mode" yaml:"resize_mode" toml:"resize_mode" json:"resize_mode"` |
| 183 | - | Shortcuts GlobalShortcutsConfig `mapstructure:"shortcuts" yaml:"shortcuts" toml:"shortcuts" json:"shortcuts"` | 183 | + | Shortcuts GlobalShortcutsConfig `mapstructure:"shortcuts" yaml:"shortcuts" toml:"shortcuts" json:"shortcuts"` |
| 184 | - | FloatingPane FloatingPaneConfig `mapstructure:"floating_pane" yaml:"floating_pane" toml:"floating_pane" json:"floating_pane"` | 184 | + | FloatingPane FloatingPaneConfig `mapstructure:"floating_pane" yaml:"floating_pane" toml:"floating_pane" json:"floating_pane"` |
| 185 | - | TabBarPosition string `mapstructure:"tab_bar_position" yaml:"tab_bar_position" toml:"tab_bar_position" json:"tab_bar_position"` | 185 | + | |
| 186 | - | HideTabBarWhenSingleTab bool `mapstructure:"hide_tab_bar_when_single_tab" yaml:"hide_tab_bar_when_single_tab" toml:"hide_tab_bar_when_single_tab" json:"hide_tab_bar_when_single_tab"` //nolint:lll // struct tags must stay on one line | 186 | + | TabBarPosition string `mapstructure:"tab_bar_position" yaml:"tab_bar_position" toml:"tab_bar_position" json:"tab_bar_position"` |
| 187 | - | SwitchToTabOnMove bool `mapstructure:"switch_to_tab_on_move" yaml:"switch_to_tab_on_move" toml:"switch_to_tab_on_move" json:"switch_to_tab_on_move"` //nolint:lll // struct tags must stay on one line | 187 | + | HideTabBarWhenSingleTab bool `mapstructure:"hide_tab_bar_when_single_tab" yaml:"hide_tab_bar_when_single_tab" toml:"hide_tab_bar_when_single_tab" json:"hide_tab_bar_when_single_tab"` //nolint:lll // struct tags must stay on one line |
| 188 | - | Popups PopupBehaviorConfig `mapstructure:"popups" yaml:"popups" toml:"popups" json:"popups"` | 188 | + | SwitchToTabOnMove bool `mapstructure:"switch_to_tab_on_move" yaml:"switch_to_tab_on_move" toml:"switch_to_tab_on_move" json:"switch_to_tab_on_move"` //nolint:lll // struct tags must stay on one line |
| 189 | - | Styling WorkspaceStylingConfig `mapstructure:"styling" yaml:"styling" toml:"styling" json:"styling"` | 189 | + | |
| 190 | - | } | 190 | + | Popups PopupBehaviorConfig `mapstructure:"popups" yaml:"popups" toml:"popups" json:"popups"` |
| 191 | - | 191 | + | Styling WorkspaceStylingConfig `mapstructure:"styling" yaml:"styling" toml:"styling" json:"styling"` | |
| 192 | - | // UpdateConfig holds auto-update behaviour settings. | 192 | + | } |
| 193 | + | ||||
| 194 | + | // UpdateConfig holds auto-update behavior settings. | |||
| 193 | type UpdateConfig struct { | 195 | type UpdateConfig struct { | ||
| 194 | EnableOnStartup bool `mapstructure:"enable_on_startup" yaml:"enable_on_startup" toml:"enable_on_startup"` | 196 | EnableOnStartup bool `mapstructure:"enable_on_startup" yaml:"enable_on_startup" toml:"enable_on_startup"` | ||
| 195 | AutoDownload bool `mapstructure:"auto_download" yaml:"auto_download" toml:"auto_download"` | 197 | AutoDownload bool `mapstructure:"auto_download" yaml:"auto_download" toml:"auto_download"` | ||
M internal/infrastructure/textinput/gtk_entry_target.go +1 -1
| @@ -19,7 +19,7 @@ var _ port.TextInputTarget = (*GTKEntryTarget)(nil) | |||
| 19 | 19 | var _ port.EntryInputTarget = (*GTKEntryTarget)(nil) | |
| 20 | 20 | ||
| 21 | 21 | // IsGTKEntryTarget implements port.EntryInputTarget. | |
| 22 | - | func (t *GTKEntryTarget) IsGTKEntryTarget() bool { return true } | |
| 22 | + | func (*GTKEntryTarget) IsGTKEntryTarget() bool { return true } | |
| 23 | 23 | ||
| 24 | 24 | // NewGTKEntryTarget creates a new GTK entry target for a SearchEntry. | |
| 25 | 25 | func NewGTKEntryTarget(entry *gtk.SearchEntry) *GTKEntryTarget { | |
| @@ -19,7 +19,7 @@ var _ port.TextInputTarget = (*GTKEntryTarget)(nil) | |||||
| 19 | var _ port.EntryInputTarget = (*GTKEntryTarget)(nil) | 19 | var _ port.EntryInputTarget = (*GTKEntryTarget)(nil) | ||
| 20 | 20 | ||||
| 21 | // IsGTKEntryTarget implements port.EntryInputTarget. | 21 | // IsGTKEntryTarget implements port.EntryInputTarget. | ||
| 22 | - | func (t *GTKEntryTarget) IsGTKEntryTarget() bool { return true } | 22 | + | func (*GTKEntryTarget) IsGTKEntryTarget() bool { return true } |
| 23 | 23 | ||||
| 24 | // NewGTKEntryTarget creates a new GTK entry target for a SearchEntry. | 24 | // NewGTKEntryTarget creates a new GTK entry target for a SearchEntry. | ||
| 25 | func NewGTKEntryTarget(entry *gtk.SearchEntry) *GTKEntryTarget { | 25 | func NewGTKEntryTarget(entry *gtk.SearchEntry) *GTKEntryTarget { | ||
M internal/infrastructure/webkit/engine.go +4 -1
| @@ -113,7 +113,10 @@ func (e *Engine) RegisterAccentHandlers(ctx context.Context, handler port.Accent | |||
| 113 | 113 | } | |
| 114 | 114 | ||
| 115 | 115 | // ConfigureDownloads sets up download handling. | |
| 116 | - | func (e *Engine) ConfigureDownloads(ctx context.Context, downloadPath string, eventHandler port.DownloadEventHandler, preparer port.DownloadPreparer) error { | |
| 116 | + | func (e *Engine) ConfigureDownloads( | |
| 117 | + | ctx context.Context, downloadPath string, | |
| 118 | + | eventHandler port.DownloadEventHandler, preparer port.DownloadPreparer, | |
| 119 | + | ) error { | |
| 117 | 120 | if e.wkCtx == nil { | |
| 118 | 121 | return fmt.Errorf("webkit context not initialized") | |
| 119 | 122 | } | |
| @@ -113,7 +113,10 @@ func (e *Engine) RegisterAccentHandlers(ctx context.Context, handler port.Accent | |||||
| 113 | } | 113 | } | ||
| 114 | 114 | ||||
| 115 | // ConfigureDownloads sets up download handling. | 115 | // ConfigureDownloads sets up download handling. | ||
| 116 | - | func (e *Engine) ConfigureDownloads(ctx context.Context, downloadPath string, eventHandler port.DownloadEventHandler, preparer port.DownloadPreparer) error { | 116 | + | func (e *Engine) ConfigureDownloads( |
| 117 | + | ctx context.Context, downloadPath string, | |||
| 118 | + | eventHandler port.DownloadEventHandler, preparer port.DownloadPreparer, | |||
| 119 | + | ) error { | |||
| 117 | if e.wkCtx == nil { | 120 | if e.wkCtx == nil { | ||
| 118 | return fmt.Errorf("webkit context not initialized") | 121 | return fmt.Errorf("webkit context not initialized") | ||
| 119 | } | 122 | } | ||
M internal/infrastructure/webkit/handlers/config.go +4 -1
| @@ -48,7 +48,10 @@ func (h *ConfigHandler) Handle(ctx context.Context, _ webkit.WebViewID, payload | |||
| 48 | 48 | } | |
| 49 | 49 | ||
| 50 | 50 | // RegisterConfigHandlers registers configuration handlers with the router. | |
| 51 | - | func RegisterConfigHandlers(ctx context.Context, router *webkit.MessageRouter, saveConfig func(context.Context, port.WebUIConfig) error) error { | |
| 51 | + | func RegisterConfigHandlers( | |
| 52 | + | ctx context.Context, router *webkit.MessageRouter, | |
| 53 | + | saveConfig func(context.Context, port.WebUIConfig) error, | |
| 54 | + | ) error { | |
| 52 | 55 | handler := NewConfigHandler(saveConfig) | |
| 53 | 56 | ||
| 54 | 57 | log := logging.FromContext(ctx).With().Str("component", "handlers").Logger() | |
| @@ -48,7 +48,10 @@ func (h *ConfigHandler) Handle(ctx context.Context, _ webkit.WebViewID, payload | |||||
| 48 | } | 48 | } | ||
| 49 | 49 | ||||
| 50 | // RegisterConfigHandlers registers configuration handlers with the router. | 50 | // RegisterConfigHandlers registers configuration handlers with the router. | ||
| 51 | - | func RegisterConfigHandlers(ctx context.Context, router *webkit.MessageRouter, saveConfig func(context.Context, port.WebUIConfig) error) error { | 51 | + | func RegisterConfigHandlers( |
| 52 | + | ctx context.Context, router *webkit.MessageRouter, | |||
| 53 | + | saveConfig func(context.Context, port.WebUIConfig) error, | |||
| 54 | + | ) error { | |||
| 52 | handler := NewConfigHandler(saveConfig) | 55 | handler := NewConfigHandler(saveConfig) | ||
| 53 | 56 | ||||
| 54 | log := logging.FromContext(ctx).With().Str("component", "handlers").Logger() | 57 | log := logging.FromContext(ctx).With().Str("component", "handlers").Logger() | ||
M internal/infrastructure/webkit/handlers/register.go +1 -0
| @@ -13,6 +13,7 @@ import ( | |||
| 13 | 13 | ||
| 14 | 14 | // AccentKeyHandler is implemented by the InsertAccentUseCase to receive | |
| 15 | 15 | // key press/release events forwarded from WebView JS via the message bridge. | |
| 16 | + | // | |
| 16 | 17 | // Deprecated: use port.AccentKeyHandler instead. This alias is kept for compatibility. | |
| 17 | 18 | type AccentKeyHandler = port.AccentKeyHandler | |
| 18 | 19 | ||
| @@ -13,6 +13,7 @@ import ( | |||||
| 13 | 13 | ||||
| 14 | // AccentKeyHandler is implemented by the InsertAccentUseCase to receive | 14 | // AccentKeyHandler is implemented by the InsertAccentUseCase to receive | ||
| 15 | // key press/release events forwarded from WebView JS via the message bridge. | 15 | // key press/release events forwarded from WebView JS via the message bridge. | ||
| 16 | + | // | |||
| 16 | // Deprecated: use port.AccentKeyHandler instead. This alias is kept for compatibility. | 17 | // Deprecated: use port.AccentKeyHandler instead. This alias is kept for compatibility. | ||
| 17 | type AccentKeyHandler = port.AccentKeyHandler | 18 | type AccentKeyHandler = port.AccentKeyHandler | ||
| 18 | 19 | ||||
M internal/ui/app.go +25 -17
| @@ -1511,23 +1511,11 @@ func (a *App) onShutdown(ctx context.Context) { | |||
| 1511 | 1511 | log.Info().Msg("application shutdown complete") | |
| 1512 | 1512 | } | |
| 1513 | 1513 | ||
| 1514 | - | // initCoordinators initializes all coordinators and wires their callbacks. | |
| 1515 | - | func (a *App) initCoordinators(ctx context.Context) { | |
| 1516 | - | log := logging.FromContext(ctx) | |
| 1517 | - | log.Debug().Msg("initializing coordinators") | |
| 1518 | - | ||
| 1519 | - | // Helper to get active workspace and view | |
| 1520 | - | getActiveWS := func() (*entity.Workspace, *component.WorkspaceView) { | |
| 1521 | - | return a.activeWorkspace(), a.activeWorkspaceView() | |
| 1522 | - | } | |
| 1523 | - | ||
| 1524 | - | // Create FaviconAdapter with service and engine FaviconDatabase. | |
| 1525 | - | // Skip if FaviconService is nil (e.g. in tests or when favicon support is disabled). | |
| 1526 | - | if a.deps.FaviconService != nil { | |
| 1527 | - | a.faviconAdapter = adapter.NewFaviconAdapter(a.deps.FaviconService, a.engine.FaviconDatabase(), a.deps.FaviconAdapterConfig) | |
| 1528 | - | } | |
| 1529 | - | ||
| 1530 | - | // 1. Content Coordinator (no dependencies on other coordinators) | |
| 1514 | + | // initContentCoordinator creates the content coordinator and wires its optional dependencies. | |
| 1515 | + | func (a *App) initContentCoordinator( | |
| 1516 | + | ctx context.Context, | |
| 1517 | + | getActiveWS func() (*entity.Workspace, *component.WorkspaceView), | |
| 1518 | + | ) { | |
| 1531 | 1519 | a.contentCoord = content.NewCoordinator( | |
| 1532 | 1520 | ctx, | |
| 1533 | 1521 | a.engine.Pool(), | |
| @@ -1561,6 +1549,26 @@ func (a *App) initCoordinators(ctx context.Context) { | |||
| 1561 | 1549 | a.contentCoord.SetOnFirstLoadStarted(func() { | |
| 1562 | 1550 | a.triggerDeferredInit(ctx) | |
| 1563 | 1551 | }) | |
| 1552 | + | } | |
| 1553 | + | ||
| 1554 | + | // initCoordinators initializes all coordinators and wires their callbacks. | |
| 1555 | + | func (a *App) initCoordinators(ctx context.Context) { | |
| 1556 | + | log := logging.FromContext(ctx) | |
| 1557 | + | log.Debug().Msg("initializing coordinators") | |
| 1558 | + | ||
| 1559 | + | // Helper to get active workspace and view | |
| 1560 | + | getActiveWS := func() (*entity.Workspace, *component.WorkspaceView) { | |
| 1561 | + | return a.activeWorkspace(), a.activeWorkspaceView() | |
| 1562 | + | } | |
| 1563 | + | ||
| 1564 | + | // Create FaviconAdapter with service and engine FaviconDatabase. | |
| 1565 | + | // Skip if FaviconService is nil (e.g. in tests or when favicon support is disabled). | |
| 1566 | + | if a.deps.FaviconService != nil { | |
| 1567 | + | a.faviconAdapter = adapter.NewFaviconAdapter(a.deps.FaviconService, a.engine.FaviconDatabase(), a.deps.FaviconAdapterConfig) | |
| 1568 | + | } | |
| 1569 | + | ||
| 1570 | + | // 1. Content Coordinator (no dependencies on other coordinators) | |
| 1571 | + | a.initContentCoordinator(ctx, getActiveWS) | |
| 1564 | 1572 | ||
| 1565 | 1573 | // 2. Tab Coordinator | |
| 1566 | 1574 | a.tabCoord = coordinator.NewTabCoordinator(ctx, coordinator.TabCoordinatorConfig{ | |
| @@ -1511,23 +1511,11 @@ func (a *App) onShutdown(ctx context.Context) { | |||||
| 1511 | log.Info().Msg("application shutdown complete") | 1511 | log.Info().Msg("application shutdown complete") | ||
| 1512 | } | 1512 | } | ||
| 1513 | 1513 | ||||
| 1514 | - | // initCoordinators initializes all coordinators and wires their callbacks. | 1514 | + | // initContentCoordinator creates the content coordinator and wires its optional dependencies. |
| 1515 | - | func (a *App) initCoordinators(ctx context.Context) { | 1515 | + | func (a *App) initContentCoordinator( |
| 1516 | - | log := logging.FromContext(ctx) | 1516 | + | ctx context.Context, |
| 1517 | - | log.Debug().Msg("initializing coordinators") | 1517 | + | getActiveWS func() (*entity.Workspace, *component.WorkspaceView), |
| 1518 | - | 1518 | + | ) { | |
| 1519 | - | // Helper to get active workspace and view | |||
| 1520 | - | getActiveWS := func() (*entity.Workspace, *component.WorkspaceView) { | |||
| 1521 | - | return a.activeWorkspace(), a.activeWorkspaceView() | |||
| 1522 | - | } | |||
| 1523 | - | ||||
| 1524 | - | // Create FaviconAdapter with service and engine FaviconDatabase. | |||
| 1525 | - | // Skip if FaviconService is nil (e.g. in tests or when favicon support is disabled). | |||
| 1526 | - | if a.deps.FaviconService != nil { | |||
| 1527 | - | a.faviconAdapter = adapter.NewFaviconAdapter(a.deps.FaviconService, a.engine.FaviconDatabase(), a.deps.FaviconAdapterConfig) | |||
| 1528 | - | } | |||
| 1529 | - | ||||
| 1530 | - | // 1. Content Coordinator (no dependencies on other coordinators) | |||
| 1531 | a.contentCoord = content.NewCoordinator( | 1519 | a.contentCoord = content.NewCoordinator( | ||
| 1532 | ctx, | 1520 | ctx, | ||
| 1533 | a.engine.Pool(), | 1521 | a.engine.Pool(), | ||
| @@ -1561,6 +1549,26 @@ func (a *App) initCoordinators(ctx context.Context) { | |||||
| 1561 | a.contentCoord.SetOnFirstLoadStarted(func() { | 1549 | a.contentCoord.SetOnFirstLoadStarted(func() { | ||
| 1562 | a.triggerDeferredInit(ctx) | 1550 | a.triggerDeferredInit(ctx) | ||
| 1563 | }) | 1551 | }) | ||
| 1552 | + | } | |||
| 1553 | + | ||||
| 1554 | + | // initCoordinators initializes all coordinators and wires their callbacks. | |||
| 1555 | + | func (a *App) initCoordinators(ctx context.Context) { | |||
| 1556 | + | log := logging.FromContext(ctx) | |||
| 1557 | + | log.Debug().Msg("initializing coordinators") | |||
| 1558 | + | ||||
| 1559 | + | // Helper to get active workspace and view | |||
| 1560 | + | getActiveWS := func() (*entity.Workspace, *component.WorkspaceView) { | |||
| 1561 | + | return a.activeWorkspace(), a.activeWorkspaceView() | |||
| 1562 | + | } | |||
| 1563 | + | ||||
| 1564 | + | // Create FaviconAdapter with service and engine FaviconDatabase. | |||
| 1565 | + | // Skip if FaviconService is nil (e.g. in tests or when favicon support is disabled). | |||
| 1566 | + | if a.deps.FaviconService != nil { | |||
| 1567 | + | a.faviconAdapter = adapter.NewFaviconAdapter(a.deps.FaviconService, a.engine.FaviconDatabase(), a.deps.FaviconAdapterConfig) | |||
| 1568 | + | } | |||
| 1569 | + | ||||
| 1570 | + | // 1. Content Coordinator (no dependencies on other coordinators) | |||
| 1571 | + | a.initContentCoordinator(ctx, getActiveWS) | |||
| 1564 | 1572 | ||||
| 1565 | // 2. Tab Coordinator | 1573 | // 2. Tab Coordinator | ||
| 1566 | a.tabCoord = coordinator.NewTabCoordinator(ctx, coordinator.TabCoordinatorConfig{ | 1574 | a.tabCoord = coordinator.NewTabCoordinator(ctx, coordinator.TabCoordinatorConfig{ | ||
M internal/ui/input/shortcuts.go +3 -1
| @@ -282,7 +282,9 @@ func (s *ShortcutSet) buildResizeModeShortcuts(ctx context.Context, cfg *entity. | |||
| 282 | 282 | s.buildModeShortcuts(ctx, cfg.ResizeMode.GetKeyBindings(), s.ResizeMode, "resize") | |
| 283 | 283 | } | |
| 284 | 284 | ||
| 285 | - | func (s *ShortcutSet) registerActivationShortcutsFromParts(ctx context.Context, workspace *entity.WorkspaceConfig, session *entity.SessionConfig) { | |
| 285 | + | func (s *ShortcutSet) registerActivationShortcutsFromParts( | |
| 286 | + | ctx context.Context, workspace *entity.WorkspaceConfig, session *entity.SessionConfig, | |
| 287 | + | ) { | |
| 286 | 288 | log := logging.FromContext(ctx) | |
| 287 | 289 | if workspace == nil { | |
| 288 | 290 | return | |
| @@ -282,7 +282,9 @@ func (s *ShortcutSet) buildResizeModeShortcuts(ctx context.Context, cfg *entity. | |||||
| 282 | s.buildModeShortcuts(ctx, cfg.ResizeMode.GetKeyBindings(), s.ResizeMode, "resize") | 282 | s.buildModeShortcuts(ctx, cfg.ResizeMode.GetKeyBindings(), s.ResizeMode, "resize") | ||
| 283 | } | 283 | } | ||
| 284 | 284 | ||||
| 285 | - | func (s *ShortcutSet) registerActivationShortcutsFromParts(ctx context.Context, workspace *entity.WorkspaceConfig, session *entity.SessionConfig) { | 285 | + | func (s *ShortcutSet) registerActivationShortcutsFromParts( |
| 286 | + | ctx context.Context, workspace *entity.WorkspaceConfig, session *entity.SessionConfig, | |||
| 287 | + | ) { | |||
| 286 | log := logging.FromContext(ctx) | 288 | log := logging.FromContext(ctx) | ||
| 287 | if workspace == nil { | 289 | if workspace == nil { | ||
| 288 | return | 290 | return | ||