fix(v3): implement BrowserWindow.SetScreen to fix -tags server build#5284
fix(v3): implement BrowserWindow.SetScreen to fix -tags server build#5284josh-padnick wants to merge 1 commit intowailsapp:masterfrom
-tags server build#5284Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughA single no-op method Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.11.4)level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies" Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.Comment |
|
✅ Triaged by Wails PR Reviewer This PR has been reviewed and accepted. Test sub-issues have been created for all platforms. Head Ref OID: This comment serves as a signature that this PR has been triaged. Future runs will skip this PR based on the headRefOid. |
|
Tested on Linux (Ubuntu 24.04 LTS) — verdict: ✓ PASS Platform: Ubuntu 24.04.4 LTS / WebKit2GTK v2.50.4 / Go 1.25.0
The |
|
My bad! I accidentally fixed this before seeing this 🙏 Thanks for bringing it up. |
|
No worries! Glad it got fixed, and thanks for the prompt response! |
Description
PR #5067 added
SetScreen(screen *Screen) Windowto theWindowinterface but did not updateBrowserWindow(the server-mode adapter inv3/pkg/application/browser_window.go, gated by//go:build server). As a result,*BrowserWindowno longer satisfiesWindowand any build with-tags serverfails to compile, breaking the documented headless / test-automation workflow.This PR adds a no-op
SetScreenimplementation on*BrowserWindowthat returns the receiver, matching the existing fluent no-op pattern already used by sibling setters likeSetTitle,SetMinSize, andSetMaxSize. Moving a browser client to a particular native screen isn't a meaningful operation, so a no-op is the correct behavior here, consistent with how the rest of the server-mode adapter handles native-only window operations.Fixes #5262.
No new dependencies.
Type of change
How Has This Been Tested?
Reproduced the failure on
masterand verified the fix with:How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration using
wails doctor.If you checked Linux, please specify the distro and version.
Test Configuration
Checklist:
website/src/pages/changelog.mdxwith details of this PR (v3 changelog entries are added automatically)Pre-existing failures unrelated to this change
While running the test suite to verify this PR, two pre-existing failures surfaced. Both reproduce on master without the patch applied:
TestGenerateIconinv3/internal/commands— fails withmac asset generation is only supported on macOSdespite running on macOS. Appears to require the full Xcode.app bundle (foractool); my local environment only has Xcode CLI tools installed.go vetfailure inv3/pkg/application/websocket_server.go:67—(*App).error call has arguments but no formatting directives. Only surfaces under-tags server, which suggests another instance of the same server-mode bit-rot that [v3] -tags server build fails (BrowserWindow missing Window.SetScreen) #5262 is fixing. Worth a follow-up PR.Neither failure is in code touched by this PR, and
go test -tags server -vet=off ./...passes cleanly otherwise.Summary by CodeRabbit