style(fmt): apply go fmt
- commit
- b27d495fcd4d773afe60fe6dc68ec3f0d2621ca7
- author
- bnema · · 2025-12-21 21:12 UTC
- parent
- 43d4a4d
- signature
- unsigned
17 files · +137 -129
M cmd/dumber/main.go +20 -20
| @@ -288,26 +288,26 @@ func buildUIDependencies( | |||
| 288 | 288 | faviconService *favicon.Service, | |
| 289 | 289 | ) *ui.Dependencies { | |
| 290 | 290 | return &ui.Dependencies{ | |
| 291 | - | Ctx: ctx, | |
| 292 | - | Config: cfg, | |
| 293 | - | InitialURL: initialURL, | |
| 294 | - | Theme: themeManager, | |
| 295 | - | WebContext: wkCtx, | |
| 296 | - | Pool: pool, | |
| 297 | - | Settings: settings, | |
| 298 | - | Injector: injector, | |
| 299 | - | MessageRouter: messageRouter, | |
| 300 | - | HistoryRepo: historyRepo, | |
| 301 | - | FavoriteRepo: favoriteRepo, | |
| 302 | - | ZoomRepo: zoomRepo, | |
| 303 | - | TabsUC: tabsUC, | |
| 304 | - | PanesUC: panesUC, | |
| 305 | - | HistoryUC: historyUC, | |
| 306 | - | FavoritesUC: favoritesUC, | |
| 307 | - | ZoomUC: zoomUC, | |
| 308 | - | NavigateUC: navigateUC, | |
| 309 | - | CopyURLUC: copyURLUC, | |
| 310 | - | Clipboard: clipboardAdapter, | |
| 291 | + | Ctx: ctx, | |
| 292 | + | Config: cfg, | |
| 293 | + | InitialURL: initialURL, | |
| 294 | + | Theme: themeManager, | |
| 295 | + | WebContext: wkCtx, | |
| 296 | + | Pool: pool, | |
| 297 | + | Settings: settings, | |
| 298 | + | Injector: injector, | |
| 299 | + | MessageRouter: messageRouter, | |
| 300 | + | HistoryRepo: historyRepo, | |
| 301 | + | FavoriteRepo: favoriteRepo, | |
| 302 | + | ZoomRepo: zoomRepo, | |
| 303 | + | TabsUC: tabsUC, | |
| 304 | + | PanesUC: panesUC, | |
| 305 | + | HistoryUC: historyUC, | |
| 306 | + | FavoritesUC: favoritesUC, | |
| 307 | + | ZoomUC: zoomUC, | |
| 308 | + | NavigateUC: navigateUC, | |
| 309 | + | CopyURLUC: copyURLUC, | |
| 310 | + | Clipboard: clipboardAdapter, | |
| 311 | 311 | FaviconService: faviconService, | |
| 312 | 312 | FilterManager: filterManager, | |
| 313 | 313 | } | |
| @@ -288,26 +288,26 @@ func buildUIDependencies( | |||||
| 288 | faviconService *favicon.Service, | 288 | faviconService *favicon.Service, | ||
| 289 | ) *ui.Dependencies { | 289 | ) *ui.Dependencies { | ||
| 290 | return &ui.Dependencies{ | 290 | return &ui.Dependencies{ | ||
| 291 | - | Ctx: ctx, | 291 | + | Ctx: ctx, |
| 292 | - | Config: cfg, | 292 | + | Config: cfg, |
| 293 | - | InitialURL: initialURL, | 293 | + | InitialURL: initialURL, |
| 294 | - | Theme: themeManager, | 294 | + | Theme: themeManager, |
| 295 | - | WebContext: wkCtx, | 295 | + | WebContext: wkCtx, |
| 296 | - | Pool: pool, | 296 | + | Pool: pool, |
| 297 | - | Settings: settings, | 297 | + | Settings: settings, |
| 298 | - | Injector: injector, | 298 | + | Injector: injector, |
| 299 | - | MessageRouter: messageRouter, | 299 | + | MessageRouter: messageRouter, |
| 300 | - | HistoryRepo: historyRepo, | 300 | + | HistoryRepo: historyRepo, |
| 301 | - | FavoriteRepo: favoriteRepo, | 301 | + | FavoriteRepo: favoriteRepo, |
| 302 | - | ZoomRepo: zoomRepo, | 302 | + | ZoomRepo: zoomRepo, |
| 303 | - | TabsUC: tabsUC, | 303 | + | TabsUC: tabsUC, |
| 304 | - | PanesUC: panesUC, | 304 | + | PanesUC: panesUC, |
| 305 | - | HistoryUC: historyUC, | 305 | + | HistoryUC: historyUC, |
| 306 | - | FavoritesUC: favoritesUC, | 306 | + | FavoritesUC: favoritesUC, |
| 307 | - | ZoomUC: zoomUC, | 307 | + | ZoomUC: zoomUC, |
| 308 | - | NavigateUC: navigateUC, | 308 | + | NavigateUC: navigateUC, |
| 309 | - | CopyURLUC: copyURLUC, | 309 | + | CopyURLUC: copyURLUC, |
| 310 | - | Clipboard: clipboardAdapter, | 310 | + | Clipboard: clipboardAdapter, |
| 311 | FaviconService: faviconService, | 311 | FaviconService: faviconService, | ||
| 312 | FilterManager: filterManager, | 312 | FilterManager: filterManager, | ||
| 313 | } | 313 | } | ||
M internal/application/port/webui_config.go +3 -3
| @@ -4,9 +4,9 @@ import "context" | |||
| 4 | 4 | ||
| 5 | 5 | // WebUIConfig represents the subset of configuration editable in dumb://config. | |
| 6 | 6 | type WebUIConfig struct { | |
| 7 | - | Appearance WebUIAppearanceConfig `json:"appearance"` | |
| 8 | - | DefaultUIScale float64 `json:"default_ui_scale"` | |
| 9 | - | DefaultSearchEngine string `json:"default_search_engine"` | |
| 7 | + | Appearance WebUIAppearanceConfig `json:"appearance"` | |
| 8 | + | DefaultUIScale float64 `json:"default_ui_scale"` | |
| 9 | + | DefaultSearchEngine string `json:"default_search_engine"` | |
| 10 | 10 | SearchShortcuts map[string]SearchShortcut `json:"search_shortcuts"` | |
| 11 | 11 | } | |
| 12 | 12 | ||
| @@ -4,9 +4,9 @@ import "context" | |||||
| 4 | 4 | ||||
| 5 | // WebUIConfig represents the subset of configuration editable in dumb://config. | 5 | // WebUIConfig represents the subset of configuration editable in dumb://config. | ||
| 6 | type WebUIConfig struct { | 6 | type WebUIConfig struct { | ||
| 7 | - | Appearance WebUIAppearanceConfig `json:"appearance"` | 7 | + | Appearance WebUIAppearanceConfig `json:"appearance"` |
| 8 | - | DefaultUIScale float64 `json:"default_ui_scale"` | 8 | + | DefaultUIScale float64 `json:"default_ui_scale"` |
| 9 | - | DefaultSearchEngine string `json:"default_search_engine"` | 9 | + | DefaultSearchEngine string `json:"default_search_engine"` |
| 10 | SearchShortcuts map[string]SearchShortcut `json:"search_shortcuts"` | 10 | SearchShortcuts map[string]SearchShortcut `json:"search_shortcuts"` | ||
| 11 | } | 11 | } | ||
| 12 | 12 | ||||
M internal/application/usecase/manage_panes.go +4 -0
| @@ -682,6 +682,7 @@ func (uc *ManagePanesUseCase) AddToStack( | |||
| 682 | 682 | ||
| 683 | 683 | // NavigateStack cycles through stacked panes. | |
| 684 | 684 | // direction: NavUp for previous, NavDown for next. | |
| 685 | + | // | |
| 685 | 686 | //nolint:revive // receiver required for interface consistency | |
| 686 | 687 | func (uc *ManagePanesUseCase) NavigateStack( | |
| 687 | 688 | ctx context.Context, | |
| @@ -751,6 +752,7 @@ func (uc *ManagePanesUseCase) NavigateStack( | |||
| 751 | 752 | ||
| 752 | 753 | // RemoveFromStack removes a pane from a stack. | |
| 753 | 754 | // If only one pane remains, the stack is dissolved. | |
| 755 | + | // | |
| 754 | 756 | //nolint:revive // receiver required for interface consistency | |
| 755 | 757 | func (uc *ManagePanesUseCase) RemoveFromStack(ctx context.Context, stackNode *entity.PaneNode, paneID entity.PaneID) error { | |
| 756 | 758 | log := logging.FromContext(ctx) | |
| @@ -802,6 +804,7 @@ func (uc *ManagePanesUseCase) RemoveFromStack(ctx context.Context, stackNode *en | |||
| 802 | 804 | } | |
| 803 | 805 | ||
| 804 | 806 | // GetAllPanes returns all leaf panes in a workspace. | |
| 807 | + | // | |
| 805 | 808 | //nolint:revive // receiver required for interface consistency | |
| 806 | 809 | func (uc *ManagePanesUseCase) GetAllPanes(ws *entity.Workspace) []*entity.Pane { | |
| 807 | 810 | if ws == nil || ws.Root == nil { | |
| @@ -811,6 +814,7 @@ func (uc *ManagePanesUseCase) GetAllPanes(ws *entity.Workspace) []*entity.Pane { | |||
| 811 | 814 | } | |
| 812 | 815 | ||
| 813 | 816 | // CountPanes returns the number of panes in a workspace. | |
| 817 | + | // | |
| 814 | 818 | //nolint:revive // receiver required for interface consistency | |
| 815 | 819 | func (uc *ManagePanesUseCase) CountPanes(ws *entity.Workspace) int { | |
| 816 | 820 | if ws == nil { | |
| @@ -682,6 +682,7 @@ func (uc *ManagePanesUseCase) AddToStack( | |||||
| 682 | 682 | ||||
| 683 | // NavigateStack cycles through stacked panes. | 683 | // NavigateStack cycles through stacked panes. | ||
| 684 | // direction: NavUp for previous, NavDown for next. | 684 | // direction: NavUp for previous, NavDown for next. | ||
| 685 | + | // | |||
| 685 | //nolint:revive // receiver required for interface consistency | 686 | //nolint:revive // receiver required for interface consistency | ||
| 686 | func (uc *ManagePanesUseCase) NavigateStack( | 687 | func (uc *ManagePanesUseCase) NavigateStack( | ||
| 687 | ctx context.Context, | 688 | ctx context.Context, | ||
| @@ -751,6 +752,7 @@ func (uc *ManagePanesUseCase) NavigateStack( | |||||
| 751 | 752 | ||||
| 752 | // RemoveFromStack removes a pane from a stack. | 753 | // RemoveFromStack removes a pane from a stack. | ||
| 753 | // If only one pane remains, the stack is dissolved. | 754 | // If only one pane remains, the stack is dissolved. | ||
| 755 | + | // | |||
| 754 | //nolint:revive // receiver required for interface consistency | 756 | //nolint:revive // receiver required for interface consistency | ||
| 755 | func (uc *ManagePanesUseCase) RemoveFromStack(ctx context.Context, stackNode *entity.PaneNode, paneID entity.PaneID) error { | 757 | func (uc *ManagePanesUseCase) RemoveFromStack(ctx context.Context, stackNode *entity.PaneNode, paneID entity.PaneID) error { | ||
| 756 | log := logging.FromContext(ctx) | 758 | log := logging.FromContext(ctx) | ||
| @@ -802,6 +804,7 @@ func (uc *ManagePanesUseCase) RemoveFromStack(ctx context.Context, stackNode *en | |||||
| 802 | } | 804 | } | ||
| 803 | 805 | ||||
| 804 | // GetAllPanes returns all leaf panes in a workspace. | 806 | // GetAllPanes returns all leaf panes in a workspace. | ||
| 807 | + | // | |||
| 805 | //nolint:revive // receiver required for interface consistency | 808 | //nolint:revive // receiver required for interface consistency | ||
| 806 | func (uc *ManagePanesUseCase) GetAllPanes(ws *entity.Workspace) []*entity.Pane { | 809 | func (uc *ManagePanesUseCase) GetAllPanes(ws *entity.Workspace) []*entity.Pane { | ||
| 807 | if ws == nil || ws.Root == nil { | 810 | if ws == nil || ws.Root == nil { | ||
| @@ -811,6 +814,7 @@ func (uc *ManagePanesUseCase) GetAllPanes(ws *entity.Workspace) []*entity.Pane { | |||||
| 811 | } | 814 | } | ||
| 812 | 815 | ||||
| 813 | // CountPanes returns the number of panes in a workspace. | 816 | // CountPanes returns the number of panes in a workspace. | ||
| 817 | + | // | |||
| 814 | //nolint:revive // receiver required for interface consistency | 818 | //nolint:revive // receiver required for interface consistency | ||
| 815 | func (uc *ManagePanesUseCase) CountPanes(ws *entity.Workspace) int { | 819 | func (uc *ManagePanesUseCase) CountPanes(ws *entity.Workspace) int { | ||
| 816 | if ws == nil { | 820 | if ws == nil { | ||
M internal/application/usecase/manage_tabs.go +3 -0
| @@ -176,6 +176,7 @@ func (uc *ManageTabsUseCase) Move(ctx context.Context, tabs *entity.TabList, tab | |||
| 176 | 176 | } | |
| 177 | 177 | ||
| 178 | 178 | // Rename changes a tab's custom name. | |
| 179 | + | // | |
| 179 | 180 | //nolint:revive // receiver required for interface consistency | |
| 180 | 181 | func (uc *ManageTabsUseCase) Rename(ctx context.Context, tabs *entity.TabList, tabID entity.TabID, name string) error { | |
| 181 | 182 | log := logging.FromContext(ctx) | |
| @@ -205,6 +206,7 @@ func (uc *ManageTabsUseCase) Rename(ctx context.Context, tabs *entity.TabList, t | |||
| 205 | 206 | ||
| 206 | 207 | // GetNext returns the next tab ID in the given direction. | |
| 207 | 208 | // direction: 1 for next, -1 for previous. | |
| 209 | + | // | |
| 208 | 210 | //nolint:revive // receiver required for interface consistency | |
| 209 | 211 | func (uc *ManageTabsUseCase) GetNext(tabs *entity.TabList, direction int) entity.TabID { | |
| 210 | 212 | if tabs == nil || tabs.Count() == 0 { | |
| @@ -293,6 +295,7 @@ func (uc *ManageTabsUseCase) SwitchToLastActive(ctx context.Context, tabs *entit | |||
| 293 | 295 | } | |
| 294 | 296 | ||
| 295 | 297 | // Pin toggles the pinned state of a tab. | |
| 298 | + | // | |
| 296 | 299 | //nolint:revive // receiver required for interface consistency | |
| 297 | 300 | func (uc *ManageTabsUseCase) Pin(ctx context.Context, tabs *entity.TabList, tabID entity.TabID, pinned bool) error { | |
| 298 | 301 | log := logging.FromContext(ctx) | |
| @@ -176,6 +176,7 @@ func (uc *ManageTabsUseCase) Move(ctx context.Context, tabs *entity.TabList, tab | |||||
| 176 | } | 176 | } | ||
| 177 | 177 | ||||
| 178 | // Rename changes a tab's custom name. | 178 | // Rename changes a tab's custom name. | ||
| 179 | + | // | |||
| 179 | //nolint:revive // receiver required for interface consistency | 180 | //nolint:revive // receiver required for interface consistency | ||
| 180 | func (uc *ManageTabsUseCase) Rename(ctx context.Context, tabs *entity.TabList, tabID entity.TabID, name string) error { | 181 | func (uc *ManageTabsUseCase) Rename(ctx context.Context, tabs *entity.TabList, tabID entity.TabID, name string) error { | ||
| 181 | log := logging.FromContext(ctx) | 182 | log := logging.FromContext(ctx) | ||
| @@ -205,6 +206,7 @@ func (uc *ManageTabsUseCase) Rename(ctx context.Context, tabs *entity.TabList, t | |||||
| 205 | 206 | ||||
| 206 | // GetNext returns the next tab ID in the given direction. | 207 | // GetNext returns the next tab ID in the given direction. | ||
| 207 | // direction: 1 for next, -1 for previous. | 208 | // direction: 1 for next, -1 for previous. | ||
| 209 | + | // | |||
| 208 | //nolint:revive // receiver required for interface consistency | 210 | //nolint:revive // receiver required for interface consistency | ||
| 209 | func (uc *ManageTabsUseCase) GetNext(tabs *entity.TabList, direction int) entity.TabID { | 211 | func (uc *ManageTabsUseCase) GetNext(tabs *entity.TabList, direction int) entity.TabID { | ||
| 210 | if tabs == nil || tabs.Count() == 0 { | 212 | if tabs == nil || tabs.Count() == 0 { | ||
| @@ -293,6 +295,7 @@ func (uc *ManageTabsUseCase) SwitchToLastActive(ctx context.Context, tabs *entit | |||||
| 293 | } | 295 | } | ||
| 294 | 296 | ||||
| 295 | // Pin toggles the pinned state of a tab. | 297 | // Pin toggles the pinned state of a tab. | ||
| 298 | + | // | |||
| 296 | //nolint:revive // receiver required for interface consistency | 299 | //nolint:revive // receiver required for interface consistency | ||
| 297 | func (uc *ManageTabsUseCase) Pin(ctx context.Context, tabs *entity.TabList, tabID entity.TabID, pinned bool) error { | 300 | func (uc *ManageTabsUseCase) Pin(ctx context.Context, tabs *entity.TabList, tabID entity.TabID, pinned bool) error { | ||
| 298 | log := logging.FromContext(ctx) | 301 | log := logging.FromContext(ctx) | ||
M internal/cli/cmd/root.go +1 -1
| @@ -65,7 +65,7 @@ If a URL is provided, navigate to it. Otherwise, open the homepage. | |||
| 65 | 65 | Examples: | |
| 66 | 66 | dumber browse # Open browser to homepage | |
| 67 | 67 | dumber browse example.com # Open browser to URL`, | |
| 68 | - | Run: func(_ *cobra.Command, _ []string) { | |
| 68 | + | Run: func(_ *cobra.Command, _ []string) { | |
| 69 | 69 | // This is handled by main.go before cobra runs | |
| 70 | 70 | }, | |
| 71 | 71 | } | |
| @@ -65,7 +65,7 @@ If a URL is provided, navigate to it. Otherwise, open the homepage. | |||||
| 65 | Examples: | 65 | Examples: | ||
| 66 | dumber browse # Open browser to homepage | 66 | dumber browse # Open browser to homepage | ||
| 67 | dumber browse example.com # Open browser to URL`, | 67 | dumber browse example.com # Open browser to URL`, | ||
| 68 | - | Run: func(_ *cobra.Command, _ []string) { | 68 | + | Run: func(_ *cobra.Command, _ []string) { |
| 69 | // This is handled by main.go before cobra runs | 69 | // This is handled by main.go before cobra runs | ||
| 70 | }, | 70 | }, | ||
| 71 | } | 71 | } | ||
M internal/cli/model/stats.go +1 -1
| @@ -236,7 +236,7 @@ func (m StatsModel) renderDailyActivity() string { | |||
| 236 | 236 | // formatNumber formats a number for display. | |
| 237 | 237 | func formatNumber(n int64) string { | |
| 238 | 238 | const ( | |
| 239 | - | formatMillion = 1_000_000 | |
| 239 | + | formatMillion = 1_000_000 | |
| 240 | 240 | formatThousand = 1_000 | |
| 241 | 241 | ) | |
| 242 | 242 | switch { | |
| @@ -236,7 +236,7 @@ func (m StatsModel) renderDailyActivity() string { | |||||
| 236 | // formatNumber formats a number for display. | 236 | // formatNumber formats a number for display. | ||
| 237 | func formatNumber(n int64) string { | 237 | func formatNumber(n int64) string { | ||
| 238 | const ( | 238 | const ( | ||
| 239 | - | formatMillion = 1_000_000 | 239 | + | formatMillion = 1_000_000 |
| 240 | formatThousand = 1_000 | 240 | formatThousand = 1_000 | ||
| 241 | ) | 241 | ) | ||
| 242 | switch { | 242 | switch { | ||
M internal/cli/styles/cleanup.go +1 -1
| @@ -67,7 +67,7 @@ type CleanupModel struct { | |||
| 67 | 67 | Ranges []CleanupRangeInfo | |
| 68 | 68 | Selected int | |
| 69 | 69 | Confirmed bool | |
| 70 | - | Canceled bool | |
| 70 | + | Canceled bool | |
| 71 | 71 | theme *Theme | |
| 72 | 72 | } | |
| 73 | 73 | ||
| @@ -67,7 +67,7 @@ type CleanupModel struct { | |||||
| 67 | Ranges []CleanupRangeInfo | 67 | Ranges []CleanupRangeInfo | ||
| 68 | Selected int | 68 | Selected int | ||
| 69 | Confirmed bool | 69 | Confirmed bool | ||
| 70 | - | Canceled bool | 70 | + | Canceled bool |
| 71 | theme *Theme | 71 | theme *Theme | ||
| 72 | } | 72 | } | ||
| 73 | 73 | ||||
M internal/cli/styles/confirm.go +1 -1
| @@ -11,7 +11,7 @@ type ConfirmModel struct { | |||
| 11 | 11 | Message string | |
| 12 | 12 | Yes bool // Current selection | |
| 13 | 13 | Confirmed bool // User pressed enter | |
| 14 | - | Canceled bool // User pressed escape | |
| 14 | + | Canceled bool // User pressed escape | |
| 15 | 15 | theme *Theme | |
| 16 | 16 | } | |
| 17 | 17 | ||
| @@ -11,7 +11,7 @@ type ConfirmModel struct { | |||||
| 11 | Message string | 11 | Message string | ||
| 12 | Yes bool // Current selection | 12 | Yes bool // Current selection | ||
| 13 | Confirmed bool // User pressed enter | 13 | Confirmed bool // User pressed enter | ||
| 14 | - | Canceled bool // User pressed escape | 14 | + | Canceled bool // User pressed escape |
| 15 | theme *Theme | 15 | theme *Theme | ||
| 16 | } | 16 | } | ||
| 17 | 17 | ||||
M internal/cli/styles/table.go +1 -1
| @@ -70,7 +70,7 @@ func (d DomainStatsRow) ToRow() table.Row { | |||
| 70 | 70 | // formatInt formats an integer for display. | |
| 71 | 71 | func formatInt(n int) string { | |
| 72 | 72 | const ( | |
| 73 | - | formatMillion = 1_000_000 | |
| 73 | + | formatMillion = 1_000_000 | |
| 74 | 74 | formatThousand = 1_000 | |
| 75 | 75 | ) | |
| 76 | 76 | switch { | |
| @@ -70,7 +70,7 @@ func (d DomainStatsRow) ToRow() table.Row { | |||||
| 70 | // formatInt formats an integer for display. | 70 | // formatInt formats an integer for display. | ||
| 71 | func formatInt(n int) string { | 71 | func formatInt(n int) string { | ||
| 72 | const ( | 72 | const ( | ||
| 73 | - | formatMillion = 1_000_000 | 73 | + | formatMillion = 1_000_000 |
| 74 | formatThousand = 1_000 | 74 | formatThousand = 1_000 | ||
| 75 | ) | 75 | ) | ||
| 76 | switch { | 76 | switch { | ||
M internal/infrastructure/filtering/manager.go +2 -2
| @@ -14,8 +14,8 @@ import ( | |||
| 14 | 14 | ) | |
| 15 | 15 | ||
| 16 | 16 | const ( | |
| 17 | - | storeDirPerm = 0o755 | |
| 18 | - | jsonDirPerm = 0o755 | |
| 17 | + | storeDirPerm = 0o755 | |
| 18 | + | jsonDirPerm = 0o755 | |
| 19 | 19 | mergedFilePerm = 0o644 | |
| 20 | 20 | ) | |
| 21 | 21 | ||
| @@ -14,8 +14,8 @@ import ( | |||||
| 14 | ) | 14 | ) | ||
| 15 | 15 | ||||
| 16 | const ( | 16 | const ( | ||
| 17 | - | storeDirPerm = 0o755 | 17 | + | storeDirPerm = 0o755 |
| 18 | - | jsonDirPerm = 0o755 | 18 | + | jsonDirPerm = 0o755 |
| 19 | mergedFilePerm = 0o644 | 19 | mergedFilePerm = 0o644 | ||
| 20 | ) | 20 | ) | ||
| 21 | 21 | ||||
M internal/infrastructure/media/diagnostics.go +1 -0
| @@ -223,6 +223,7 @@ func (a *Adapter) checkVAAPI(ctx context.Context, r *port.MediaDiagnosticsResult | |||
| 223 | 223 | } | |
| 224 | 224 | ||
| 225 | 225 | // generateWarnings creates user-friendly warning messages. | |
| 226 | + | // | |
| 226 | 227 | //nolint:revive // receiver required for interface consistency | |
| 227 | 228 | func (a *Adapter) generateWarnings(r *port.MediaDiagnosticsResult) { | |
| 228 | 229 | // Critical: GStreamer not installed | |
| @@ -223,6 +223,7 @@ func (a *Adapter) checkVAAPI(ctx context.Context, r *port.MediaDiagnosticsResult | |||||
| 223 | } | 223 | } | ||
| 224 | 224 | ||||
| 225 | // generateWarnings creates user-friendly warning messages. | 225 | // generateWarnings creates user-friendly warning messages. | ||
| 226 | + | // | |||
| 226 | //nolint:revive // receiver required for interface consistency | 227 | //nolint:revive // receiver required for interface consistency | ||
| 227 | func (a *Adapter) generateWarnings(r *port.MediaDiagnosticsResult) { | 228 | func (a *Adapter) generateWarnings(r *port.MediaDiagnosticsResult) { | ||
| 228 | // Critical: GStreamer not installed | 229 | // Critical: GStreamer not installed | ||
M internal/infrastructure/webkit/scheme_handler.go +6 -6
| @@ -77,10 +77,10 @@ type configAppearancePayload struct { | |||
| 77 | 77 | } | |
| 78 | 78 | ||
| 79 | 79 | type configPayload struct { | |
| 80 | - | Appearance configAppearancePayload `json:"appearance"` | |
| 81 | - | DefaultUIScale float64 `json:"default_ui_scale"` | |
| 82 | - | DefaultSearchEngine string `json:"default_search_engine"` | |
| 83 | - | SearchShortcuts map[string]config.SearchShortcut `json:"search_shortcuts"` | |
| 80 | + | Appearance configAppearancePayload `json:"appearance"` | |
| 81 | + | DefaultUIScale float64 `json:"default_ui_scale"` | |
| 82 | + | DefaultSearchEngine string `json:"default_search_engine"` | |
| 83 | + | SearchShortcuts map[string]config.SearchShortcut `json:"search_shortcuts"` | |
| 84 | 84 | } | |
| 85 | 85 | ||
| 86 | 86 | // NewDumbSchemeHandler creates a new handler for the dumb:// scheme. | |
| @@ -110,7 +110,7 @@ func (h *DumbSchemeHandler) SetAssets(assets embed.FS) { | |||
| 110 | 110 | // registerDefaults sets up default page handlers. | |
| 111 | 111 | func (h *DumbSchemeHandler) registerDefaults() { | |
| 112 | 112 | // Error page (static fallback) | |
| 113 | - | h.RegisterPage("/error", PageHandlerFunc(func(_ *SchemeRequest) *SchemeResponse { | |
| 113 | + | h.RegisterPage("/error", PageHandlerFunc(func(_ *SchemeRequest) *SchemeResponse { | |
| 114 | 114 | return &SchemeResponse{ | |
| 115 | 115 | Data: []byte(errorPageHTML), | |
| 116 | 116 | ContentType: "text/html", | |
| @@ -425,7 +425,7 @@ func (h *DumbSchemeHandler) RegisterWithContext(wkCtx *WebKitContext) { | |||
| 425 | 425 | return | |
| 426 | 426 | } | |
| 427 | 427 | ||
| 428 | - | callback := webkit.URISchemeRequestCallback(func(reqPtr, _ uintptr) { | |
| 428 | + | callback := webkit.URISchemeRequestCallback(func(reqPtr, _ uintptr) { | |
| 429 | 429 | h.HandleRequest(reqPtr) | |
| 430 | 430 | }) | |
| 431 | 431 | ||
| @@ -77,10 +77,10 @@ type configAppearancePayload struct { | |||||
| 77 | } | 77 | } | ||
| 78 | 78 | ||||
| 79 | type configPayload struct { | 79 | type configPayload struct { | ||
| 80 | - | Appearance configAppearancePayload `json:"appearance"` | 80 | + | Appearance configAppearancePayload `json:"appearance"` |
| 81 | - | DefaultUIScale float64 `json:"default_ui_scale"` | 81 | + | DefaultUIScale float64 `json:"default_ui_scale"` |
| 82 | - | DefaultSearchEngine string `json:"default_search_engine"` | 82 | + | DefaultSearchEngine string `json:"default_search_engine"` |
| 83 | - | SearchShortcuts map[string]config.SearchShortcut `json:"search_shortcuts"` | 83 | + | SearchShortcuts map[string]config.SearchShortcut `json:"search_shortcuts"` |
| 84 | } | 84 | } | ||
| 85 | 85 | ||||
| 86 | // NewDumbSchemeHandler creates a new handler for the dumb:// scheme. | 86 | // NewDumbSchemeHandler creates a new handler for the dumb:// scheme. | ||
| @@ -110,7 +110,7 @@ func (h *DumbSchemeHandler) SetAssets(assets embed.FS) { | |||||
| 110 | // registerDefaults sets up default page handlers. | 110 | // registerDefaults sets up default page handlers. | ||
| 111 | func (h *DumbSchemeHandler) registerDefaults() { | 111 | func (h *DumbSchemeHandler) registerDefaults() { | ||
| 112 | // Error page (static fallback) | 112 | // Error page (static fallback) | ||
| 113 | - | h.RegisterPage("/error", PageHandlerFunc(func(_ *SchemeRequest) *SchemeResponse { | 113 | + | h.RegisterPage("/error", PageHandlerFunc(func(_ *SchemeRequest) *SchemeResponse { |
| 114 | return &SchemeResponse{ | 114 | return &SchemeResponse{ | ||
| 115 | Data: []byte(errorPageHTML), | 115 | Data: []byte(errorPageHTML), | ||
| 116 | ContentType: "text/html", | 116 | ContentType: "text/html", | ||
| @@ -425,7 +425,7 @@ func (h *DumbSchemeHandler) RegisterWithContext(wkCtx *WebKitContext) { | |||||
| 425 | return | 425 | return | ||
| 426 | } | 426 | } | ||
| 427 | 427 | ||||
| 428 | - | callback := webkit.URISchemeRequestCallback(func(reqPtr, _ uintptr) { | 428 | + | callback := webkit.URISchemeRequestCallback(func(reqPtr, _ uintptr) { |
| 429 | h.HandleRequest(reqPtr) | 429 | h.HandleRequest(reqPtr) | ||
| 430 | }) | 430 | }) | ||
| 431 | 431 | ||||
M internal/infrastructure/webkit/settings.go +1 -1
| @@ -64,7 +64,7 @@ func (sm *SettingsManager) applySettings(ctx context.Context, settings *webkit.S | |||
| 64 | 64 | Str("sans_font", cfg.Appearance.SansFont). | |
| 65 | 65 | Str("rendering_mode", string(cfg.RenderingMode)). | |
| 66 | 66 | Bool("developer_extras", cfg.Debug.EnableDevTools). | |
| 67 | - | Msg("settings applied") | |
| 67 | + | Msg("settings applied") | |
| 68 | 68 | } | |
| 69 | 69 | ||
| 70 | 70 | func applyJavaScriptSettings(settings *webkit.Settings) { | |
| @@ -64,7 +64,7 @@ func (sm *SettingsManager) applySettings(ctx context.Context, settings *webkit.S | |||||
| 64 | Str("sans_font", cfg.Appearance.SansFont). | 64 | Str("sans_font", cfg.Appearance.SansFont). | ||
| 65 | Str("rendering_mode", string(cfg.RenderingMode)). | 65 | Str("rendering_mode", string(cfg.RenderingMode)). | ||
| 66 | Bool("developer_extras", cfg.Debug.EnableDevTools). | 66 | Bool("developer_extras", cfg.Debug.EnableDevTools). | ||
| 67 | - | Msg("settings applied") | 67 | + | Msg("settings applied") |
| 68 | } | 68 | } | ||
| 69 | 69 | ||||
| 70 | func applyJavaScriptSettings(settings *webkit.Settings) { | 70 | func applyJavaScriptSettings(settings *webkit.Settings) { | ||
M internal/ui/component/omnibox.go +6 -6
| @@ -20,12 +20,12 @@ import ( | |||
| 20 | 20 | ) | |
| 21 | 21 | ||
| 22 | 22 | const ( | |
| 23 | - | omniboxWidthPct = 0.8 // 80% of parent window width | |
| 24 | - | omniboxMaxWidth = 800 // Maximum width in pixels | |
| 25 | - | omniboxHeightPct = 0.6 // 60% of parent window height | |
| 26 | - | omniboxMaxResults = 10 | |
| 23 | + | omniboxWidthPct = 0.8 // 80% of parent window width | |
| 24 | + | omniboxMaxWidth = 800 // Maximum width in pixels | |
| 25 | + | omniboxHeightPct = 0.6 // 60% of parent window height | |
| 26 | + | omniboxMaxResults = 10 | |
| 27 | 27 | omniboxTopMarginPct = 0.2 // 20% from top | |
| 28 | - | debounceDelayMs = 150 | |
| 28 | + | debounceDelayMs = 150 | |
| 29 | 29 | ) | |
| 30 | 30 | ||
| 31 | 31 | // ViewMode distinguishes history search from favorites display. | |
| @@ -308,7 +308,7 @@ func (o *Omnibox) setupKeyboardHandling() { | |||
| 308 | 308 | // Set capture phase to intercept before entry | |
| 309 | 309 | controller.SetPropagationPhase(gtk.PhaseCaptureValue) | |
| 310 | 310 | ||
| 311 | - | keyPressedCb := func(_ gtk.EventControllerKey, keyval uint, _ uint, state gdk.ModifierType) bool { | |
| 311 | + | keyPressedCb := func(_ gtk.EventControllerKey, keyval uint, _ uint, state gdk.ModifierType) bool { | |
| 312 | 312 | return o.handleKeyPress(keyval, state) | |
| 313 | 313 | } | |
| 314 | 314 | controller.ConnectKeyPressed(&keyPressedCb) | |
| @@ -20,12 +20,12 @@ import ( | |||||
| 20 | ) | 20 | ) | ||
| 21 | 21 | ||||
| 22 | const ( | 22 | const ( | ||
| 23 | - | omniboxWidthPct = 0.8 // 80% of parent window width | 23 | + | omniboxWidthPct = 0.8 // 80% of parent window width |
| 24 | - | omniboxMaxWidth = 800 // Maximum width in pixels | 24 | + | omniboxMaxWidth = 800 // Maximum width in pixels |
| 25 | - | omniboxHeightPct = 0.6 // 60% of parent window height | 25 | + | omniboxHeightPct = 0.6 // 60% of parent window height |
| 26 | - | omniboxMaxResults = 10 | 26 | + | omniboxMaxResults = 10 |
| 27 | omniboxTopMarginPct = 0.2 // 20% from top | 27 | omniboxTopMarginPct = 0.2 // 20% from top | ||
| 28 | - | debounceDelayMs = 150 | 28 | + | debounceDelayMs = 150 |
| 29 | ) | 29 | ) | ||
| 30 | 30 | ||||
| 31 | // ViewMode distinguishes history search from favorites display. | 31 | // ViewMode distinguishes history search from favorites display. | ||
| @@ -308,7 +308,7 @@ func (o *Omnibox) setupKeyboardHandling() { | |||||
| 308 | // Set capture phase to intercept before entry | 308 | // Set capture phase to intercept before entry | ||
| 309 | controller.SetPropagationPhase(gtk.PhaseCaptureValue) | 309 | controller.SetPropagationPhase(gtk.PhaseCaptureValue) | ||
| 310 | 310 | ||||
| 311 | - | keyPressedCb := func(_ gtk.EventControllerKey, keyval uint, _ uint, state gdk.ModifierType) bool { | 311 | + | keyPressedCb := func(_ gtk.EventControllerKey, keyval uint, _ uint, state gdk.ModifierType) bool { |
| 312 | return o.handleKeyPress(keyval, state) | 312 | return o.handleKeyPress(keyval, state) | ||
| 313 | } | 313 | } | ||
| 314 | controller.ConnectKeyPressed(&keyPressedCb) | 314 | controller.ConnectKeyPressed(&keyPressedCb) | ||
M internal/ui/coordinator/workspace.go +1 -1
| @@ -710,7 +710,7 @@ func (c *WorkspaceCoordinator) ClosePane(ctx context.Context) error { | |||
| 710 | 710 | if siblingNode != nil { | |
| 711 | 711 | return siblingNode.ID | |
| 712 | 712 | } | |
| 713 | - | return nilString | |
| 713 | + | return nilString | |
| 714 | 714 | }()). | |
| 715 | 715 | Bool("sibling_is_start", siblingIsStartChild). | |
| 716 | 716 | Bool("parent_is_start_in_grand", parentIsStartInGrand). | |
| @@ -710,7 +710,7 @@ func (c *WorkspaceCoordinator) ClosePane(ctx context.Context) error { | |||||
| 710 | if siblingNode != nil { | 710 | if siblingNode != nil { | ||
| 711 | return siblingNode.ID | 711 | return siblingNode.ID | ||
| 712 | } | 712 | } | ||
| 713 | - | return nilString | 713 | + | return nilString |
| 714 | }()). | 714 | }()). | ||
| 715 | Bool("sibling_is_start", siblingIsStartChild). | 715 | Bool("sibling_is_start", siblingIsStartChild). | ||
| 716 | Bool("parent_is_start_in_grand", parentIsStartInGrand). | 716 | Bool("parent_is_start_in_grand", parentIsStartInGrand). | ||
M internal/ui/dispatcher/keyboard.go +35 -35
| @@ -15,17 +15,17 @@ import ( | |||
| 15 | 15 | ||
| 16 | 16 | // KeyboardDispatcher routes keyboard actions to appropriate coordinators. | |
| 17 | 17 | type KeyboardDispatcher struct { | |
| 18 | - | tabCoord *coordinator.TabCoordinator | |
| 19 | - | wsCoord *coordinator.WorkspaceCoordinator | |
| 20 | - | navCoord *coordinator.NavigationCoordinator | |
| 21 | - | zoomUC *usecase.ManageZoomUseCase | |
| 22 | - | copyURLUC *usecase.CopyURLUseCase | |
| 18 | + | tabCoord *coordinator.TabCoordinator | |
| 19 | + | wsCoord *coordinator.WorkspaceCoordinator | |
| 20 | + | navCoord *coordinator.NavigationCoordinator | |
| 21 | + | zoomUC *usecase.ManageZoomUseCase | |
| 22 | + | copyURLUC *usecase.CopyURLUseCase | |
| 23 | 23 | actionHandlers map[input.Action]func(ctx context.Context) error | |
| 24 | - | onQuit func() | |
| 25 | - | onFindOpen func(ctx context.Context) error | |
| 26 | - | onFindNext func(ctx context.Context) error | |
| 27 | - | onFindPrev func(ctx context.Context) error | |
| 28 | - | onFindClose func(ctx context.Context) error | |
| 24 | + | onQuit func() | |
| 25 | + | onFindOpen func(ctx context.Context) error | |
| 26 | + | onFindNext func(ctx context.Context) error | |
| 27 | + | onFindPrev func(ctx context.Context) error | |
| 28 | + | onFindClose func(ctx context.Context) error | |
| 29 | 29 | } | |
| 30 | 30 | ||
| 31 | 31 | // NewKeyboardDispatcher creates a new KeyboardDispatcher. | |
| @@ -78,12 +78,12 @@ func (d *KeyboardDispatcher) SetOnFindClose(fn func(ctx context.Context) error) | |||
| 78 | 78 | ||
| 79 | 79 | func (d *KeyboardDispatcher) initActionHandlers() { | |
| 80 | 80 | const ( | |
| 81 | - | firstTabIndex = 0 | |
| 82 | - | secondTabIndex = 1 | |
| 83 | - | thirdTabIndex = 2 | |
| 84 | - | fourthTabIndex = 3 | |
| 85 | - | fifthTabIndex = 4 | |
| 86 | - | sixthTabIndex = 5 | |
| 81 | + | firstTabIndex = 0 | |
| 82 | + | secondTabIndex = 1 | |
| 83 | + | thirdTabIndex = 2 | |
| 84 | + | fourthTabIndex = 3 | |
| 85 | + | fifthTabIndex = 4 | |
| 86 | + | sixthTabIndex = 5 | |
| 87 | 87 | seventhTabIndex = 6 | |
| 88 | 88 | eighthTabIndex = 7 | |
| 89 | 89 | ninthTabIndex = 8 | |
| @@ -91,20 +91,20 @@ func (d *KeyboardDispatcher) initActionHandlers() { | |||
| 91 | 91 | ) | |
| 92 | 92 | d.actionHandlers = map[input.Action]func(ctx context.Context) error{ | |
| 93 | 93 | // Tab actions | |
| 94 | - | input.ActionNewTab: func(ctx context.Context) error { _, err := d.tabCoord.Create(ctx, "about:blank"); return err }, | |
| 95 | - | input.ActionCloseTab: d.tabCoord.Close, | |
| 96 | - | input.ActionNextTab: d.tabCoord.SwitchNext, | |
| 97 | - | input.ActionPreviousTab: d.tabCoord.SwitchPrev, | |
| 98 | - | input.ActionSwitchLastTab: d.tabCoord.SwitchToLastActive, | |
| 99 | - | input.ActionSwitchTabIndex1: func(ctx context.Context) error { return d.tabCoord.SwitchByIndex(ctx, firstTabIndex) }, | |
| 100 | - | input.ActionSwitchTabIndex2: func(ctx context.Context) error { return d.tabCoord.SwitchByIndex(ctx, secondTabIndex) }, | |
| 101 | - | input.ActionSwitchTabIndex3: func(ctx context.Context) error { return d.tabCoord.SwitchByIndex(ctx, thirdTabIndex) }, | |
| 102 | - | input.ActionSwitchTabIndex4: func(ctx context.Context) error { return d.tabCoord.SwitchByIndex(ctx, fourthTabIndex) }, | |
| 103 | - | input.ActionSwitchTabIndex5: func(ctx context.Context) error { return d.tabCoord.SwitchByIndex(ctx, fifthTabIndex) }, | |
| 104 | - | input.ActionSwitchTabIndex6: func(ctx context.Context) error { return d.tabCoord.SwitchByIndex(ctx, sixthTabIndex) }, | |
| 105 | - | input.ActionSwitchTabIndex7: func(ctx context.Context) error { return d.tabCoord.SwitchByIndex(ctx, seventhTabIndex) }, | |
| 106 | - | input.ActionSwitchTabIndex8: func(ctx context.Context) error { return d.tabCoord.SwitchByIndex(ctx, eighthTabIndex) }, | |
| 107 | - | input.ActionSwitchTabIndex9: func(ctx context.Context) error { return d.tabCoord.SwitchByIndex(ctx, ninthTabIndex) }, | |
| 94 | + | input.ActionNewTab: func(ctx context.Context) error { _, err := d.tabCoord.Create(ctx, "about:blank"); return err }, | |
| 95 | + | input.ActionCloseTab: d.tabCoord.Close, | |
| 96 | + | input.ActionNextTab: d.tabCoord.SwitchNext, | |
| 97 | + | input.ActionPreviousTab: d.tabCoord.SwitchPrev, | |
| 98 | + | input.ActionSwitchLastTab: d.tabCoord.SwitchToLastActive, | |
| 99 | + | input.ActionSwitchTabIndex1: func(ctx context.Context) error { return d.tabCoord.SwitchByIndex(ctx, firstTabIndex) }, | |
| 100 | + | input.ActionSwitchTabIndex2: func(ctx context.Context) error { return d.tabCoord.SwitchByIndex(ctx, secondTabIndex) }, | |
| 101 | + | input.ActionSwitchTabIndex3: func(ctx context.Context) error { return d.tabCoord.SwitchByIndex(ctx, thirdTabIndex) }, | |
| 102 | + | input.ActionSwitchTabIndex4: func(ctx context.Context) error { return d.tabCoord.SwitchByIndex(ctx, fourthTabIndex) }, | |
| 103 | + | input.ActionSwitchTabIndex5: func(ctx context.Context) error { return d.tabCoord.SwitchByIndex(ctx, fifthTabIndex) }, | |
| 104 | + | input.ActionSwitchTabIndex6: func(ctx context.Context) error { return d.tabCoord.SwitchByIndex(ctx, sixthTabIndex) }, | |
| 105 | + | input.ActionSwitchTabIndex7: func(ctx context.Context) error { return d.tabCoord.SwitchByIndex(ctx, seventhTabIndex) }, | |
| 106 | + | input.ActionSwitchTabIndex8: func(ctx context.Context) error { return d.tabCoord.SwitchByIndex(ctx, eighthTabIndex) }, | |
| 107 | + | input.ActionSwitchTabIndex9: func(ctx context.Context) error { return d.tabCoord.SwitchByIndex(ctx, ninthTabIndex) }, | |
| 108 | 108 | input.ActionSwitchTabIndex10: func(ctx context.Context) error { return d.tabCoord.SwitchByIndex(ctx, tenthTabIndex) }, | |
| 109 | 109 | input.ActionRenameTab: func(ctx context.Context) error { | |
| 110 | 110 | return d.logNoop(ctx, "rename tab action (not yet implemented)") | |
| @@ -133,11 +133,11 @@ func (d *KeyboardDispatcher) initActionHandlers() { | |||
| 133 | 133 | input.ActionZoomOut: func(ctx context.Context) error { return d.handleZoom(ctx, "out") }, | |
| 134 | 134 | input.ActionZoomReset: func(ctx context.Context) error { return d.handleZoom(ctx, "reset") }, | |
| 135 | 135 | // UI | |
| 136 | - | input.ActionOpenOmnibox: d.navCoord.OpenOmnibox, | |
| 137 | - | input.ActionOpenFind: d.handleFindOpen, | |
| 138 | - | input.ActionFindNext: d.handleFindNext, | |
| 139 | - | input.ActionFindPrev: d.handleFindPrev, | |
| 140 | - | input.ActionCloseFind: d.handleFindClose, | |
| 136 | + | input.ActionOpenOmnibox: d.navCoord.OpenOmnibox, | |
| 137 | + | input.ActionOpenFind: d.handleFindOpen, | |
| 138 | + | input.ActionFindNext: d.handleFindNext, | |
| 139 | + | input.ActionFindPrev: d.handleFindPrev, | |
| 140 | + | input.ActionCloseFind: d.handleFindClose, | |
| 141 | 141 | input.ActionOpenDevTools: d.navCoord.OpenDevTools, | |
| 142 | 142 | input.ActionToggleFullscreen: func(ctx context.Context) error { | |
| 143 | 143 | return d.logNoop(ctx, "toggle fullscreen action (not yet implemented)") | |
| @@ -15,17 +15,17 @@ import ( | |||||
| 15 | 15 | ||||
| 16 | // KeyboardDispatcher routes keyboard actions to appropriate coordinators. | 16 | // KeyboardDispatcher routes keyboard actions to appropriate coordinators. | ||
| 17 | type KeyboardDispatcher struct { | 17 | type KeyboardDispatcher struct { | ||
| 18 | - | tabCoord *coordinator.TabCoordinator | 18 | + | tabCoord *coordinator.TabCoordinator |
| 19 | - | wsCoord *coordinator.WorkspaceCoordinator | 19 | + | wsCoord *coordinator.WorkspaceCoordinator |
| 20 | - | navCoord *coordinator.NavigationCoordinator | 20 | + | navCoord *coordinator.NavigationCoordinator |
| 21 | - | zoomUC *usecase.ManageZoomUseCase | 21 | + | zoomUC *usecase.ManageZoomUseCase |
| 22 | - | copyURLUC *usecase.CopyURLUseCase | 22 | + | copyURLUC *usecase.CopyURLUseCase |
| 23 | actionHandlers map[input.Action]func(ctx context.Context) error | 23 | actionHandlers map[input.Action]func(ctx context.Context) error | ||
| 24 | - | onQuit func() | 24 | + | onQuit func() |
| 25 | - | onFindOpen func(ctx context.Context) error | 25 | + | onFindOpen func(ctx context.Context) error |
| 26 | - | onFindNext func(ctx context.Context) error | 26 | + | onFindNext func(ctx context.Context) error |
| 27 | - | onFindPrev func(ctx context.Context) error | 27 | + | onFindPrev func(ctx context.Context) error |
| 28 | - | onFindClose func(ctx context.Context) error | 28 | + | onFindClose func(ctx context.Context) error |
| 29 | } | 29 | } | ||
| 30 | 30 | ||||
| 31 | // NewKeyboardDispatcher creates a new KeyboardDispatcher. | 31 | // NewKeyboardDispatcher creates a new KeyboardDispatcher. | ||
| @@ -78,12 +78,12 @@ func (d *KeyboardDispatcher) SetOnFindClose(fn func(ctx context.Context) error) | |||||
| 78 | 78 | ||||
| 79 | func (d *KeyboardDispatcher) initActionHandlers() { | 79 | func (d *KeyboardDispatcher) initActionHandlers() { | ||
| 80 | const ( | 80 | const ( | ||
| 81 | - | firstTabIndex = 0 | 81 | + | firstTabIndex = 0 |
| 82 | - | secondTabIndex = 1 | 82 | + | secondTabIndex = 1 |
| 83 | - | thirdTabIndex = 2 | 83 | + | thirdTabIndex = 2 |
| 84 | - | fourthTabIndex = 3 | 84 | + | fourthTabIndex = 3 |
| 85 | - | fifthTabIndex = 4 | 85 | + | fifthTabIndex = 4 |
| 86 | - | sixthTabIndex = 5 | 86 | + | sixthTabIndex = 5 |
| 87 | seventhTabIndex = 6 | 87 | seventhTabIndex = 6 | ||
| 88 | eighthTabIndex = 7 | 88 | eighthTabIndex = 7 | ||
| 89 | ninthTabIndex = 8 | 89 | ninthTabIndex = 8 | ||
| @@ -91,20 +91,20 @@ func (d *KeyboardDispatcher) initActionHandlers() { | |||||
| 91 | ) | 91 | ) | ||
| 92 | d.actionHandlers = map[input.Action]func(ctx context.Context) error{ | 92 | d.actionHandlers = map[input.Action]func(ctx context.Context) error{ | ||
| 93 | // Tab actions | 93 | // Tab actions | ||
| 94 | - | input.ActionNewTab: func(ctx context.Context) error { _, err := d.tabCoord.Create(ctx, "about:blank"); return err }, | 94 | + | input.ActionNewTab: func(ctx context.Context) error { _, err := d.tabCoord.Create(ctx, "about:blank"); return err }, |
| 95 | - | input.ActionCloseTab: d.tabCoord.Close, | 95 | + | input.ActionCloseTab: d.tabCoord.Close, |
| 96 | - | input.ActionNextTab: d.tabCoord.SwitchNext, | 96 | + | input.ActionNextTab: d.tabCoord.SwitchNext, |
| 97 | - | input.ActionPreviousTab: d.tabCoord.SwitchPrev, | 97 | + | input.ActionPreviousTab: d.tabCoord.SwitchPrev, |
| 98 | - | input.ActionSwitchLastTab: d.tabCoord.SwitchToLastActive, | 98 | + | input.ActionSwitchLastTab: d.tabCoord.SwitchToLastActive, |
| 99 | - | input.ActionSwitchTabIndex1: func(ctx context.Context) error { return d.tabCoord.SwitchByIndex(ctx, firstTabIndex) }, | 99 | + | input.ActionSwitchTabIndex1: func(ctx context.Context) error { return d.tabCoord.SwitchByIndex(ctx, firstTabIndex) }, |
| 100 | - | input.ActionSwitchTabIndex2: func(ctx context.Context) error { return d.tabCoord.SwitchByIndex(ctx, secondTabIndex) }, | 100 | + | input.ActionSwitchTabIndex2: func(ctx context.Context) error { return d.tabCoord.SwitchByIndex(ctx, secondTabIndex) }, |
| 101 | - | input.ActionSwitchTabIndex3: func(ctx context.Context) error { return d.tabCoord.SwitchByIndex(ctx, thirdTabIndex) }, | 101 | + | input.ActionSwitchTabIndex3: func(ctx context.Context) error { return d.tabCoord.SwitchByIndex(ctx, thirdTabIndex) }, |
| 102 | - | input.ActionSwitchTabIndex4: func(ctx context.Context) error { return d.tabCoord.SwitchByIndex(ctx, fourthTabIndex) }, | 102 | + | input.ActionSwitchTabIndex4: func(ctx context.Context) error { return d.tabCoord.SwitchByIndex(ctx, fourthTabIndex) }, |
| 103 | - | input.ActionSwitchTabIndex5: func(ctx context.Context) error { return d.tabCoord.SwitchByIndex(ctx, fifthTabIndex) }, | 103 | + | input.ActionSwitchTabIndex5: func(ctx context.Context) error { return d.tabCoord.SwitchByIndex(ctx, fifthTabIndex) }, |
| 104 | - | input.ActionSwitchTabIndex6: func(ctx context.Context) error { return d.tabCoord.SwitchByIndex(ctx, sixthTabIndex) }, | 104 | + | input.ActionSwitchTabIndex6: func(ctx context.Context) error { return d.tabCoord.SwitchByIndex(ctx, sixthTabIndex) }, |
| 105 | - | input.ActionSwitchTabIndex7: func(ctx context.Context) error { return d.tabCoord.SwitchByIndex(ctx, seventhTabIndex) }, | 105 | + | input.ActionSwitchTabIndex7: func(ctx context.Context) error { return d.tabCoord.SwitchByIndex(ctx, seventhTabIndex) }, |
| 106 | - | input.ActionSwitchTabIndex8: func(ctx context.Context) error { return d.tabCoord.SwitchByIndex(ctx, eighthTabIndex) }, | 106 | + | input.ActionSwitchTabIndex8: func(ctx context.Context) error { return d.tabCoord.SwitchByIndex(ctx, eighthTabIndex) }, |
| 107 | - | input.ActionSwitchTabIndex9: func(ctx context.Context) error { return d.tabCoord.SwitchByIndex(ctx, ninthTabIndex) }, | 107 | + | input.ActionSwitchTabIndex9: func(ctx context.Context) error { return d.tabCoord.SwitchByIndex(ctx, ninthTabIndex) }, |
| 108 | input.ActionSwitchTabIndex10: func(ctx context.Context) error { return d.tabCoord.SwitchByIndex(ctx, tenthTabIndex) }, | 108 | input.ActionSwitchTabIndex10: func(ctx context.Context) error { return d.tabCoord.SwitchByIndex(ctx, tenthTabIndex) }, | ||
| 109 | input.ActionRenameTab: func(ctx context.Context) error { | 109 | input.ActionRenameTab: func(ctx context.Context) error { | ||
| 110 | return d.logNoop(ctx, "rename tab action (not yet implemented)") | 110 | return d.logNoop(ctx, "rename tab action (not yet implemented)") | ||
| @@ -133,11 +133,11 @@ func (d *KeyboardDispatcher) initActionHandlers() { | |||||
| 133 | input.ActionZoomOut: func(ctx context.Context) error { return d.handleZoom(ctx, "out") }, | 133 | input.ActionZoomOut: func(ctx context.Context) error { return d.handleZoom(ctx, "out") }, | ||
| 134 | input.ActionZoomReset: func(ctx context.Context) error { return d.handleZoom(ctx, "reset") }, | 134 | input.ActionZoomReset: func(ctx context.Context) error { return d.handleZoom(ctx, "reset") }, | ||
| 135 | // UI | 135 | // UI | ||
| 136 | - | input.ActionOpenOmnibox: d.navCoord.OpenOmnibox, | 136 | + | input.ActionOpenOmnibox: d.navCoord.OpenOmnibox, |
| 137 | - | input.ActionOpenFind: d.handleFindOpen, | 137 | + | input.ActionOpenFind: d.handleFindOpen, |
| 138 | - | input.ActionFindNext: d.handleFindNext, | 138 | + | input.ActionFindNext: d.handleFindNext, |
| 139 | - | input.ActionFindPrev: d.handleFindPrev, | 139 | + | input.ActionFindPrev: d.handleFindPrev, |
| 140 | - | input.ActionCloseFind: d.handleFindClose, | 140 | + | input.ActionCloseFind: d.handleFindClose, |
| 141 | input.ActionOpenDevTools: d.navCoord.OpenDevTools, | 141 | input.ActionOpenDevTools: d.navCoord.OpenDevTools, | ||
| 142 | input.ActionToggleFullscreen: func(ctx context.Context) error { | 142 | input.ActionToggleFullscreen: func(ctx context.Context) error { | ||
| 143 | return d.logNoop(ctx, "toggle fullscreen action (not yet implemented)") | 143 | return d.logNoop(ctx, "toggle fullscreen action (not yet implemented)") | ||
M internal/ui/input/shortcuts.go +50 -50
| @@ -28,57 +28,57 @@ const ( | |||
| 28 | 28 | const modifierMask = ModCtrl | ModShift | ModAlt | |
| 29 | 29 | ||
| 30 | 30 | var keyvalByName = map[string]uint{ | |
| 31 | - | "escape": uint(gdk.KEY_Escape), | |
| 32 | - | "esc": uint(gdk.KEY_Escape), | |
| 33 | - | "return": uint(gdk.KEY_Return), | |
| 34 | - | "enter": uint(gdk.KEY_Return), | |
| 35 | - | "tab": uint(gdk.KEY_Tab), | |
| 36 | - | "space": uint(gdk.KEY_space), | |
| 37 | - | "backspace": uint(gdk.KEY_BackSpace), | |
| 38 | - | "delete": uint(gdk.KEY_Delete), | |
| 39 | - | "del": uint(gdk.KEY_Delete), | |
| 40 | - | "home": uint(gdk.KEY_Home), | |
| 41 | - | "end": uint(gdk.KEY_End), | |
| 42 | - | "pageup": uint(gdk.KEY_Page_Up), | |
| 43 | - | "page_up": uint(gdk.KEY_Page_Up), | |
| 44 | - | "pagedown": uint(gdk.KEY_Page_Down), | |
| 45 | - | "page_down": uint(gdk.KEY_Page_Down), | |
| 46 | - | "left": uint(gdk.KEY_Left), | |
| 47 | - | "arrowleft": uint(gdk.KEY_Left), | |
| 48 | - | "right": uint(gdk.KEY_Right), | |
| 31 | + | "escape": uint(gdk.KEY_Escape), | |
| 32 | + | "esc": uint(gdk.KEY_Escape), | |
| 33 | + | "return": uint(gdk.KEY_Return), | |
| 34 | + | "enter": uint(gdk.KEY_Return), | |
| 35 | + | "tab": uint(gdk.KEY_Tab), | |
| 36 | + | "space": uint(gdk.KEY_space), | |
| 37 | + | "backspace": uint(gdk.KEY_BackSpace), | |
| 38 | + | "delete": uint(gdk.KEY_Delete), | |
| 39 | + | "del": uint(gdk.KEY_Delete), | |
| 40 | + | "home": uint(gdk.KEY_Home), | |
| 41 | + | "end": uint(gdk.KEY_End), | |
| 42 | + | "pageup": uint(gdk.KEY_Page_Up), | |
| 43 | + | "page_up": uint(gdk.KEY_Page_Up), | |
| 44 | + | "pagedown": uint(gdk.KEY_Page_Down), | |
| 45 | + | "page_down": uint(gdk.KEY_Page_Down), | |
| 46 | + | "left": uint(gdk.KEY_Left), | |
| 47 | + | "arrowleft": uint(gdk.KEY_Left), | |
| 48 | + | "right": uint(gdk.KEY_Right), | |
| 49 | 49 | "arrowright": uint(gdk.KEY_Right), | |
| 50 | - | "up": uint(gdk.KEY_Up), | |
| 51 | - | "arrowup": uint(gdk.KEY_Up), | |
| 52 | - | "down": uint(gdk.KEY_Down), | |
| 53 | - | "arrowdown": uint(gdk.KEY_Down), | |
| 54 | - | "f1": uint(gdk.KEY_F1), | |
| 55 | - | "f2": uint(gdk.KEY_F2), | |
| 56 | - | "f3": uint(gdk.KEY_F3), | |
| 57 | - | "f4": uint(gdk.KEY_F4), | |
| 58 | - | "f5": uint(gdk.KEY_F5), | |
| 59 | - | "f6": uint(gdk.KEY_F6), | |
| 60 | - | "f7": uint(gdk.KEY_F7), | |
| 61 | - | "f8": uint(gdk.KEY_F8), | |
| 62 | - | "f9": uint(gdk.KEY_F9), | |
| 63 | - | "f10": uint(gdk.KEY_F10), | |
| 64 | - | "f11": uint(gdk.KEY_F11), | |
| 65 | - | "f12": uint(gdk.KEY_F12), | |
| 66 | - | "plus": uint(gdk.KEY_plus), | |
| 67 | - | "+": uint(gdk.KEY_plus), | |
| 68 | - | "minus": uint(gdk.KEY_minus), | |
| 69 | - | "-": uint(gdk.KEY_minus), | |
| 70 | - | "equal": uint(gdk.KEY_equal), | |
| 71 | - | "=": uint(gdk.KEY_equal), | |
| 72 | - | "0": uint(gdk.KEY_0), | |
| 73 | - | "1": uint(gdk.KEY_1), | |
| 74 | - | "2": uint(gdk.KEY_2), | |
| 75 | - | "3": uint(gdk.KEY_3), | |
| 76 | - | "4": uint(gdk.KEY_4), | |
| 77 | - | "5": uint(gdk.KEY_5), | |
| 78 | - | "6": uint(gdk.KEY_6), | |
| 79 | - | "7": uint(gdk.KEY_7), | |
| 80 | - | "8": uint(gdk.KEY_8), | |
| 81 | - | "9": uint(gdk.KEY_9), | |
| 50 | + | "up": uint(gdk.KEY_Up), | |
| 51 | + | "arrowup": uint(gdk.KEY_Up), | |
| 52 | + | "down": uint(gdk.KEY_Down), | |
| 53 | + | "arrowdown": uint(gdk.KEY_Down), | |
| 54 | + | "f1": uint(gdk.KEY_F1), | |
| 55 | + | "f2": uint(gdk.KEY_F2), | |
| 56 | + | "f3": uint(gdk.KEY_F3), | |
| 57 | + | "f4": uint(gdk.KEY_F4), | |
| 58 | + | "f5": uint(gdk.KEY_F5), | |
| 59 | + | "f6": uint(gdk.KEY_F6), | |
| 60 | + | "f7": uint(gdk.KEY_F7), | |
| 61 | + | "f8": uint(gdk.KEY_F8), | |
| 62 | + | "f9": uint(gdk.KEY_F9), | |
| 63 | + | "f10": uint(gdk.KEY_F10), | |
| 64 | + | "f11": uint(gdk.KEY_F11), | |
| 65 | + | "f12": uint(gdk.KEY_F12), | |
| 66 | + | "plus": uint(gdk.KEY_plus), | |
| 67 | + | "+": uint(gdk.KEY_plus), | |
| 68 | + | "minus": uint(gdk.KEY_minus), | |
| 69 | + | "-": uint(gdk.KEY_minus), | |
| 70 | + | "equal": uint(gdk.KEY_equal), | |
| 71 | + | "=": uint(gdk.KEY_equal), | |
| 72 | + | "0": uint(gdk.KEY_0), | |
| 73 | + | "1": uint(gdk.KEY_1), | |
| 74 | + | "2": uint(gdk.KEY_2), | |
| 75 | + | "3": uint(gdk.KEY_3), | |
| 76 | + | "4": uint(gdk.KEY_4), | |
| 77 | + | "5": uint(gdk.KEY_5), | |
| 78 | + | "6": uint(gdk.KEY_6), | |
| 79 | + | "7": uint(gdk.KEY_7), | |
| 80 | + | "8": uint(gdk.KEY_8), | |
| 81 | + | "9": uint(gdk.KEY_9), | |
| 82 | 82 | } | |
| 83 | 83 | ||
| 84 | 84 | // KeyBinding represents a single key combination. | |
| @@ -28,57 +28,57 @@ const ( | |||||
| 28 | const modifierMask = ModCtrl | ModShift | ModAlt | 28 | const modifierMask = ModCtrl | ModShift | ModAlt | ||
| 29 | 29 | ||||
| 30 | var keyvalByName = map[string]uint{ | 30 | var keyvalByName = map[string]uint{ | ||
| 31 | - | "escape": uint(gdk.KEY_Escape), | 31 | + | "escape": uint(gdk.KEY_Escape), |
| 32 | - | "esc": uint(gdk.KEY_Escape), | 32 | + | "esc": uint(gdk.KEY_Escape), |
| 33 | - | "return": uint(gdk.KEY_Return), | 33 | + | "return": uint(gdk.KEY_Return), |
| 34 | - | "enter": uint(gdk.KEY_Return), | 34 | + | "enter": uint(gdk.KEY_Return), |
| 35 | - | "tab": uint(gdk.KEY_Tab), | 35 | + | "tab": uint(gdk.KEY_Tab), |
| 36 | - | "space": uint(gdk.KEY_space), | 36 | + | "space": uint(gdk.KEY_space), |
| 37 | - | "backspace": uint(gdk.KEY_BackSpace), | 37 | + | "backspace": uint(gdk.KEY_BackSpace), |
| 38 | - | "delete": uint(gdk.KEY_Delete), | 38 | + | "delete": uint(gdk.KEY_Delete), |
| 39 | - | "del": uint(gdk.KEY_Delete), | 39 | + | "del": uint(gdk.KEY_Delete), |
| 40 | - | "home": uint(gdk.KEY_Home), | 40 | + | "home": uint(gdk.KEY_Home), |
| 41 | - | "end": uint(gdk.KEY_End), | 41 | + | "end": uint(gdk.KEY_End), |
| 42 | - | "pageup": uint(gdk.KEY_Page_Up), | 42 | + | "pageup": uint(gdk.KEY_Page_Up), |
| 43 | - | "page_up": uint(gdk.KEY_Page_Up), | 43 | + | "page_up": uint(gdk.KEY_Page_Up), |
| 44 | - | "pagedown": uint(gdk.KEY_Page_Down), | 44 | + | "pagedown": uint(gdk.KEY_Page_Down), |
| 45 | - | "page_down": uint(gdk.KEY_Page_Down), | 45 | + | "page_down": uint(gdk.KEY_Page_Down), |
| 46 | - | "left": uint(gdk.KEY_Left), | 46 | + | "left": uint(gdk.KEY_Left), |
| 47 | - | "arrowleft": uint(gdk.KEY_Left), | 47 | + | "arrowleft": uint(gdk.KEY_Left), |
| 48 | - | "right": uint(gdk.KEY_Right), | 48 | + | "right": uint(gdk.KEY_Right), |
| 49 | "arrowright": uint(gdk.KEY_Right), | 49 | "arrowright": uint(gdk.KEY_Right), | ||
| 50 | - | "up": uint(gdk.KEY_Up), | 50 | + | "up": uint(gdk.KEY_Up), |
| 51 | - | "arrowup": uint(gdk.KEY_Up), | 51 | + | "arrowup": uint(gdk.KEY_Up), |
| 52 | - | "down": uint(gdk.KEY_Down), | 52 | + | "down": uint(gdk.KEY_Down), |
| 53 | - | "arrowdown": uint(gdk.KEY_Down), | 53 | + | "arrowdown": uint(gdk.KEY_Down), |
| 54 | - | "f1": uint(gdk.KEY_F1), | 54 | + | "f1": uint(gdk.KEY_F1), |
| 55 | - | "f2": uint(gdk.KEY_F2), | 55 | + | "f2": uint(gdk.KEY_F2), |
| 56 | - | "f3": uint(gdk.KEY_F3), | 56 | + | "f3": uint(gdk.KEY_F3), |
| 57 | - | "f4": uint(gdk.KEY_F4), | 57 | + | "f4": uint(gdk.KEY_F4), |
| 58 | - | "f5": uint(gdk.KEY_F5), | 58 | + | "f5": uint(gdk.KEY_F5), |
| 59 | - | "f6": uint(gdk.KEY_F6), | 59 | + | "f6": uint(gdk.KEY_F6), |
| 60 | - | "f7": uint(gdk.KEY_F7), | 60 | + | "f7": uint(gdk.KEY_F7), |
| 61 | - | "f8": uint(gdk.KEY_F8), | 61 | + | "f8": uint(gdk.KEY_F8), |
| 62 | - | "f9": uint(gdk.KEY_F9), | 62 | + | "f9": uint(gdk.KEY_F9), |
| 63 | - | "f10": uint(gdk.KEY_F10), | 63 | + | "f10": uint(gdk.KEY_F10), |
| 64 | - | "f11": uint(gdk.KEY_F11), | 64 | + | "f11": uint(gdk.KEY_F11), |
| 65 | - | "f12": uint(gdk.KEY_F12), | 65 | + | "f12": uint(gdk.KEY_F12), |
| 66 | - | "plus": uint(gdk.KEY_plus), | 66 | + | "plus": uint(gdk.KEY_plus), |
| 67 | - | "+": uint(gdk.KEY_plus), | 67 | + | "+": uint(gdk.KEY_plus), |
| 68 | - | "minus": uint(gdk.KEY_minus), | 68 | + | "minus": uint(gdk.KEY_minus), |
| 69 | - | "-": uint(gdk.KEY_minus), | 69 | + | "-": uint(gdk.KEY_minus), |
| 70 | - | "equal": uint(gdk.KEY_equal), | 70 | + | "equal": uint(gdk.KEY_equal), |
| 71 | - | "=": uint(gdk.KEY_equal), | 71 | + | "=": uint(gdk.KEY_equal), |
| 72 | - | "0": uint(gdk.KEY_0), | 72 | + | "0": uint(gdk.KEY_0), |
| 73 | - | "1": uint(gdk.KEY_1), | 73 | + | "1": uint(gdk.KEY_1), |
| 74 | - | "2": uint(gdk.KEY_2), | 74 | + | "2": uint(gdk.KEY_2), |
| 75 | - | "3": uint(gdk.KEY_3), | 75 | + | "3": uint(gdk.KEY_3), |
| 76 | - | "4": uint(gdk.KEY_4), | 76 | + | "4": uint(gdk.KEY_4), |
| 77 | - | "5": uint(gdk.KEY_5), | 77 | + | "5": uint(gdk.KEY_5), |
| 78 | - | "6": uint(gdk.KEY_6), | 78 | + | "6": uint(gdk.KEY_6), |
| 79 | - | "7": uint(gdk.KEY_7), | 79 | + | "7": uint(gdk.KEY_7), |
| 80 | - | "8": uint(gdk.KEY_8), | 80 | + | "8": uint(gdk.KEY_8), |
| 81 | - | "9": uint(gdk.KEY_9), | 81 | + | "9": uint(gdk.KEY_9), |
| 82 | } | 82 | } | ||
| 83 | 83 | ||||
| 84 | // KeyBinding represents a single key combination. | 84 | // KeyBinding represents a single key combination. | ||