fix(browser): correct printf format specifiers for WebView.ID()
WebView.ID() returns uint64, not string. Changed all log.Printf format specifiers from %s to %d to fix compilation errors. Affected files: - stacked_panes.go: lines 582, 585 - window_shortcuts.go: lines 340, 343 - workspace_manager.go: lines 423, 538 - workspace_navigation.go: line 37 - workspace_utils.go: line 310 This fixes "format %s has arg webView.ID() of wrong type uint64" errors that were preventing tests from compiling.
- commit
- 36a2a06e781cdfc44735f1957c16c31ecda64c96
- author
- bamen · · 2025-10-09 16:30 UTC
- committer
- bamen · · 2025-10-09 18:27 UTC
- parent
- 9f75a78
- signature
- unsigned
5 files · +8 -8
M internal/app/browser/stacked_panes.go +2 -2
| @@ -579,10 +579,10 @@ func (spm *StackedPaneManager) UpdateTitleBar(webView *webkit.WebView, title str | |||
| 579 | 579 | if paneIndex != -1 && paneIndex != activeIndex { | |
| 580 | 580 | // This is an INACTIVE pane - safe to update title bar | |
| 581 | 581 | spm.updateTitleBarLabel(node, title) | |
| 582 | - | log.Printf("[workspace] updated title bar for INACTIVE WebView %s: %s", webView.ID(), title) | |
| 582 | + | log.Printf("[workspace] updated title bar for INACTIVE WebView %d: %s", webView.ID(), title) | |
| 583 | 583 | } else { | |
| 584 | 584 | // This is the ACTIVE pane - title bar should remain hidden | |
| 585 | - | log.Printf("[workspace] skipped title bar update for ACTIVE WebView %s: %s", webView.ID(), title) | |
| 585 | + | log.Printf("[workspace] skipped title bar update for ACTIVE WebView %d: %s", webView.ID(), title) | |
| 586 | 586 | } | |
| 587 | 587 | } | |
| 588 | 588 | } | |
| @@ -579,10 +579,10 @@ func (spm *StackedPaneManager) UpdateTitleBar(webView *webkit.WebView, title str | |||||
| 579 | if paneIndex != -1 && paneIndex != activeIndex { | 579 | if paneIndex != -1 && paneIndex != activeIndex { | ||
| 580 | // This is an INACTIVE pane - safe to update title bar | 580 | // This is an INACTIVE pane - safe to update title bar | ||
| 581 | spm.updateTitleBarLabel(node, title) | 581 | spm.updateTitleBarLabel(node, title) | ||
| 582 | - | log.Printf("[workspace] updated title bar for INACTIVE WebView %s: %s", webView.ID(), title) | 582 | + | log.Printf("[workspace] updated title bar for INACTIVE WebView %d: %s", webView.ID(), title) |
| 583 | } else { | 583 | } else { | ||
| 584 | // This is the ACTIVE pane - title bar should remain hidden | 584 | // This is the ACTIVE pane - title bar should remain hidden | ||
| 585 | - | log.Printf("[workspace] skipped title bar update for ACTIVE WebView %s: %s", webView.ID(), title) | 585 | + | log.Printf("[workspace] skipped title bar update for ACTIVE WebView %d: %s", webView.ID(), title) |
| 586 | } | 586 | } | ||
| 587 | } | 587 | } | ||
| 588 | } | 588 | } | ||
M internal/app/browser/window_shortcuts.go +2 -2
| @@ -337,10 +337,10 @@ func (h *WindowShortcutHandler) handleClosePane() { | |||
| 337 | 337 | for webView := range h.app.workspace.viewToNode { | |
| 338 | 338 | if webView != nil { | |
| 339 | 339 | isActive := webView.IsActive() | |
| 340 | - | log.Printf("[window-shortcuts] WebView %s: IsActive=%t", webView.ID(), isActive) | |
| 340 | + | log.Printf("[window-shortcuts] WebView %d: IsActive=%t", webView.ID(), isActive) | |
| 341 | 341 | if isActive { | |
| 342 | 342 | activeWebView = webView | |
| 343 | - | log.Printf("[window-shortcuts] Found active WebView: %s", webView.ID()) | |
| 343 | + | log.Printf("[window-shortcuts] Found active WebView: %d", webView.ID()) | |
| 344 | 344 | break | |
| 345 | 345 | } | |
| 346 | 346 | } | |
| @@ -337,10 +337,10 @@ func (h *WindowShortcutHandler) handleClosePane() { | |||||
| 337 | for webView := range h.app.workspace.viewToNode { | 337 | for webView := range h.app.workspace.viewToNode { | ||
| 338 | if webView != nil { | 338 | if webView != nil { | ||
| 339 | isActive := webView.IsActive() | 339 | isActive := webView.IsActive() | ||
| 340 | - | log.Printf("[window-shortcuts] WebView %s: IsActive=%t", webView.ID(), isActive) | 340 | + | log.Printf("[window-shortcuts] WebView %d: IsActive=%t", webView.ID(), isActive) |
| 341 | if isActive { | 341 | if isActive { | ||
| 342 | activeWebView = webView | 342 | activeWebView = webView | ||
| 343 | - | log.Printf("[window-shortcuts] Found active WebView: %s", webView.ID()) | 343 | + | log.Printf("[window-shortcuts] Found active WebView: %d", webView.ID()) |
| 344 | break | 344 | break | ||
| 345 | } | 345 | } | ||
| 346 | } | 346 | } | ||
M internal/app/browser/workspace_manager.go +2 -2
| @@ -420,7 +420,7 @@ func (wm *WorkspaceManager) OnWorkspaceMessage(source *webkit.WebView, msg messa | |||
| 420 | 420 | cleanupScript := fmt.Sprintf(` | |
| 421 | 421 | try { | |
| 422 | 422 | // Clean up popup_mapping_<parentId> (from Go code) | |
| 423 | - | localStorage.removeItem('popup_mapping_%s'); | |
| 423 | + | localStorage.removeItem('popup_mapping_%d'); | |
| 424 | 424 | ||
| 425 | 425 | // Clean up popup_<requestId>_* entries (from JavaScript) | |
| 426 | 426 | const requestId = '%s'; | |
| @@ -535,5 +535,5 @@ func (wm *WorkspaceManager) RegisterNavigationHandler(webView *webkit.WebView) { | |||
| 535 | 535 | return | |
| 536 | 536 | } | |
| 537 | 537 | ||
| 538 | - | log.Printf("[workspace] Registered navigation handler for webview: %s", webView.ID()) | |
| 538 | + | log.Printf("[workspace] Registered navigation handler for webview: %d", webView.ID()) | |
| 539 | 539 | } | |
| @@ -420,7 +420,7 @@ func (wm *WorkspaceManager) OnWorkspaceMessage(source *webkit.WebView, msg messa | |||||
| 420 | cleanupScript := fmt.Sprintf(` | 420 | cleanupScript := fmt.Sprintf(` | ||
| 421 | try { | 421 | try { | ||
| 422 | // Clean up popup_mapping_<parentId> (from Go code) | 422 | // Clean up popup_mapping_<parentId> (from Go code) | ||
| 423 | - | localStorage.removeItem('popup_mapping_%s'); | 423 | + | localStorage.removeItem('popup_mapping_%d'); |
| 424 | 424 | ||||
| 425 | // Clean up popup_<requestId>_* entries (from JavaScript) | 425 | // Clean up popup_<requestId>_* entries (from JavaScript) | ||
| 426 | const requestId = '%s'; | 426 | const requestId = '%s'; | ||
| @@ -535,5 +535,5 @@ func (wm *WorkspaceManager) RegisterNavigationHandler(webView *webkit.WebView) { | |||||
| 535 | return | 535 | return | ||
| 536 | } | 536 | } | ||
| 537 | 537 | ||||
| 538 | - | log.Printf("[workspace] Registered navigation handler for webview: %s", webView.ID()) | 538 | + | log.Printf("[workspace] Registered navigation handler for webview: %d", webView.ID()) |
| 539 | } | 539 | } | ||
M internal/app/browser/workspace_navigation.go +1 -1
| @@ -34,7 +34,7 @@ func (wm *WorkspaceManager) DispatchPaneFocusEvent(node *paneNode, active bool) | |||
| 34 | 34 | if err := node.pane.webView.DispatchCustomEvent("dumber:workspace-focus", detail); err != nil { | |
| 35 | 35 | log.Printf("[workspace] failed to dispatch focus event: %v", err) | |
| 36 | 36 | } else if wm.app.config != nil && wm.app.config.Debug.EnableWorkspaceDebug { | |
| 37 | - | log.Printf("[workspace] dispatched focus event for webview %s (active=%v)", node.pane.webView.ID(), active) | |
| 37 | + | log.Printf("[workspace] dispatched focus event for webview %d (active=%v)", node.pane.webView.ID(), active) | |
| 38 | 38 | } | |
| 39 | 39 | } | |
| 40 | 40 | ||
| @@ -34,7 +34,7 @@ func (wm *WorkspaceManager) DispatchPaneFocusEvent(node *paneNode, active bool) | |||||
| 34 | if err := node.pane.webView.DispatchCustomEvent("dumber:workspace-focus", detail); err != nil { | 34 | if err := node.pane.webView.DispatchCustomEvent("dumber:workspace-focus", detail); err != nil { | ||
| 35 | log.Printf("[workspace] failed to dispatch focus event: %v", err) | 35 | log.Printf("[workspace] failed to dispatch focus event: %v", err) | ||
| 36 | } else if wm.app.config != nil && wm.app.config.Debug.EnableWorkspaceDebug { | 36 | } else if wm.app.config != nil && wm.app.config.Debug.EnableWorkspaceDebug { | ||
| 37 | - | log.Printf("[workspace] dispatched focus event for webview %s (active=%v)", node.pane.webView.ID(), active) | 37 | + | log.Printf("[workspace] dispatched focus event for webview %d (active=%v)", node.pane.webView.ID(), active) |
| 38 | } | 38 | } | ||
| 39 | } | 39 | } | ||
| 40 | 40 | ||||
M internal/app/browser/workspace_utils.go +1 -1
| @@ -307,7 +307,7 @@ func formatPaneInfo(node *paneNode) string { | |||
| 307 | 307 | if node.isLeaf { | |
| 308 | 308 | info = fmt.Sprintf("leaf(container=%p", node.container) | |
| 309 | 309 | if node.pane != nil && node.pane.webView != nil { | |
| 310 | - | info += fmt.Sprintf(" webview=%s", node.pane.webView.ID()) | |
| 310 | + | info += fmt.Sprintf(" webview=%d", node.pane.webView.ID()) | |
| 311 | 311 | } | |
| 312 | 312 | if node.windowType == webkit.WindowTypePopup { | |
| 313 | 313 | info += " popup" | |
| @@ -307,7 +307,7 @@ func formatPaneInfo(node *paneNode) string { | |||||
| 307 | if node.isLeaf { | 307 | if node.isLeaf { | ||
| 308 | info = fmt.Sprintf("leaf(container=%p", node.container) | 308 | info = fmt.Sprintf("leaf(container=%p", node.container) | ||
| 309 | if node.pane != nil && node.pane.webView != nil { | 309 | if node.pane != nil && node.pane.webView != nil { | ||
| 310 | - | info += fmt.Sprintf(" webview=%s", node.pane.webView.ID()) | 310 | + | info += fmt.Sprintf(" webview=%d", node.pane.webView.ID()) |
| 311 | } | 311 | } | ||
| 312 | if node.windowType == webkit.WindowTypePopup { | 312 | if node.windowType == webkit.WindowTypePopup { | ||
| 313 | info += " popup" | 313 | info += " popup" | ||