- menus.mdx: add Update() call after adding items to context menu snippet
- application.mdx: fix Emit() signature — remove fabricated bool return
- events-reference.mdx: fix files-dropped JS example to account for
variadic wrapping (event.data[0] is the files array)
- bridge.mdx: fix progress event example — use variadic args directly
and destructure event.data array in JS
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ServiceStartup is for service resource initialization (DB, config),
NOT for application lifecycle hooks. Application lifecycle events
(events.Common.ApplicationStarted, ThemeChanged) are the correct
mechanism for reacting to lifecycle stages.
- architecture.mdx: replace misleading "Lifecycle hooks" section
- lifecycle.mdx: add Application Lifecycle Events section (new §3)
- lifecycle.mdx: rename "Service Startup" to "Service Initialisation"
- lifecycle.mdx: categorize reference table (events/services/options)
- lifecycle.mdx: update d2 diagram with ApplicationStarted stage
- lifecycle.mdx: update best practices to distinguish init vs lifecycle
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Address feedback from PR #4975 review by fbbdev and Copilot:
JS event callbacks (Principle 3 - 14 fixes across 10 files):
- All JS event callbacks now correctly receive event object, access
payload via event.data instead of receiving data directly
- Fixed in: reference/window, concepts/bridge, concepts/architecture,
migration/v2-to-v3, guides/gin-routing, guides/gin-services,
features/dialogs/custom, features/bindings/best-practices
Wails directives (Principle 2 - 2 files):
- Fixed //wails:internal semantics: IS exported to frontend but kept
module-private (not re-exported from index), NOT "prevents export"
- Fixed //wails:ignore description: completely excluded from JS bindings
- Added new "Internal + Inject Pattern" section with real SQLite service
example showing how //wails:internal + //wails:inject work together
ContextMenu.Update() (Principle 5):
- Added missing Update() call in guides/menus.mdx image gallery example
Lifecycle patterns verified correct - ServiceStartup usage is for
business logic init, not lifecycle hooks. EventManager.Emit confirmed
to return bool per source (Principle 4 in audit doc was incorrect).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove 28 temporary status/progress/audit files from the branch:
- All AUDIT_* files from documentation audit session
- All PHASE*_* progress files
- All *_SUMMARY.md and *_STATUS.md files
- Other temporary report files (SCRIPT.md, DOCS_UPDATE.md, etc.)
These were temporary files used during documentation work sessions
and should not be part of the branch.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Created three tabs in Getting Started guide for different contribution types
- Bug Fix tab: 9 steps focused on reproducing, fixing, and testing bugs
- Enhancements tab: 10 steps covering feature discussion, implementation, and documentation
- Documentation tab: 9 steps for improving docs with live preview workflow
- Each tab includes type-specific best practices and examples
- Maintained Steps component for better UX in each tab
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Updated Go requirement to 1.25+ (was 1.23+)
- Updated Node.js requirement to 20+ (was 18+)
- Changed fork link to direct fork URL
- Added "Contribution Process Overview" section with workflow bullet points
- Restructured content using Steps component for better UX
- Applied same version updates to Development Setup guide
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Reduced Contributing sidebar to three essential pages
- Created comprehensive Getting Started guide for new contributors
- Added detailed Development Setup guide with platform-specific instructions
- Created Coding Standards document covering Go/TypeScript conventions
- Removed v3 badge from "What's New" in sidebar
- Removed crown badge from "Credits" in sidebar
- All guides include practical examples and troubleshooting tips
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Restructured API Reference to use flat file structure instead of subdirectories
- Added complete API documentation for all major Wails v3 APIs
- Created comprehensive event tables documenting all built-in system events
- Fixed incorrect window lifecycle methods (OnClose/OnFocus/OnBlur don't exist)
- Replaced with correct OnWindowEvent() and RegisterHook() implementations
- Added detailed explanations of Common Events vs Platform-Native Events
- Expanded Frontend Runtime API with complete method signatures and examples
- Added comprehensive Dialogs, Menu, and Events API documentation
- Included practical code examples for Go and JavaScript throughout
- Documented event patterns with use case descriptions
- Removed placeholder content and "Best Practices" sections
- Made Go API Conventions collapsible with beginner-friendly intro text
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Change BETA to ALPHA across documentation
- Add new showcase images (mchat, edex-ui) to landing page sliders
- Remove bulletin board and emailit images from sliders
- Increase slider spacing from 350px to 550px to reduce overlap
- Fix tutorial links to use numbered filenames (02-todo-vanilla, 03-notes-vanilla)
- Update 7 broken tutorial links across 5 files
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Completes the documentation reorganization by migrating all /learn content
to proper locations and removing the legacy /learn directory.
Changes:
- Migrated 10 unique files from /learn to appropriate sections:
- features/notifications, keyboard, environment, browser, platform
- concepts/manager-api
- contributing/architecture/bindings
- reference/runtime
- guides/build/customization
- Removed /learn directory and 22 legacy files
- Updated sidebar navigation:
- Removed "Learn" section
- Added Manager API to Core Concepts
- Reorganized Features with new subdirectories
- Added Build Customization to Guides
- Added Binding System to Contributing/Architecture
- Fixed missing Card/CardGrid imports in 12 feature files
- Cleaned up stale d2 SVG files
All /features content verified to be more comprehensive than /learn versions.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add "Learn" section between Tutorials and Core Concepts
- Autogenerate sidebar items from /learn directory
- Includes 22 important documentation files: bindings, events, windows, menus, dialogs, etc.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Copy gamestacker.webp from merged PR #4724 to showcase-images
- Add GameStacker to Row 1 and Row 3 of scrolling background
- Replaces wombat and wally positions for better variety
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Extract "Why Wails?" from Quick Start section to standalone top-level item
- Position above Quick Start for better visibility and onboarding flow
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add detailed explanations to v2-to-v3 migration guide breaking changes sections
- Explain what changed, why it changed, and benefits of the new approach
- Add explanatory text to "How Wails Works" architecture section
- Center architecture diagram with improved layout
- Remove "For Contributors" badge from sidebar
- Add notes tutorial screenshot to tutorials overview
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Complete rewrite of TODO tutorial with detailed explanations and verified working code
- Complete rewrite of Notes tutorial demonstrating file dialogs and desktop patterns
- Add screenshots for both tutorials
- Update tutorial overview with improved descriptions
- Fix HTML entity encoding for < character in lifecycle and bridge docs
- Update API status from Beta to Alpha in reference documentation
- Change Beta APIs to Unstable APIs for clarity
- Remove "From Tauri" migration link from navigation
- Update wails.app references to wails.io
- Fix various typos and improve code examples throughout
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Reduced gin-routing.mdx from 584 to 263 lines by:
- Condensing static content serving section (38→18 lines)
- Replacing verbose Event Communication section with concise example (146→24 lines)
- Removing redundant "Interacting with Wails" section
- Simplifying Gin mode configuration (31→6 lines)
- Removing complete example (117 lines) - users can reference examples repo
- Replacing all instances of "leverage" with "use"
The guide now focuses on essential integration steps without
overwhelming detail, while maintaining all key concepts.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Update Go version requirement from 1.23+ to 1.25+ across all docs
- Update installation.mdx with links to official installers and actual wails3 doctor output
- Revert first-app.mdx to simple greet app tutorial (10 mins)
- Move TODO app to dedicated tutorial at tutorials/todo-vanilla.mdx (20 mins)
- Simplify next-steps.mdx: remove 50+ links, focus on essential paths
- Simplify tutorials/overview.mdx: remove emojis, cards, verbose sections
- Add Windows 11 Dev Drive performance tips to installation guides
- Fix auto-rebuild documentation (Go code auto-rebuilds, no manual restart needed)
- Remove "What You've Learned" section emojis
- Convert cards to bullet points throughout for better readability
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Fixed Wayland related window maximum size issues on ultrawide monitors by adding a monitor-window search fallback.
* Fixed Wayland related window maximum size issues on ultrawide monitors by adding a monitor-window search fallback.
* Added note to UNRELEASED_CHANGELOG.md regarding Wayland ultrawide monitor fix of issue 4439.
---------
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
* feat: Binds window menu to app windows
* chore: disables tab feature & controls from menu by default
* docs: Adds title to example for it to show in the window menu item
* style: removes redundant SetBackgroundColor call
* chore: rolls back disabling tab controls for a future optional config
* docs: adds change description to unreleased notes
---------
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
* fix: compilation issue when using react+next application
When building with next, I got an error during the "collecting page data" step.
Cannot find module '/home/node/application/node_modules/@wailsio/runtime/dist/utils' imported from /home/node/application/node_modules/@wailsio/runtime/dist/contextmenu.js] {
code: 'ERR_MODULE_NOT_FOUND',
* doc: added fix in the changelog
* fix: updated UNRELEASED_CHANGELOG.md
* doc: follow naming convention
* Remove v2 changelog entry
---------
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
* Check for empty buffers instead of nil in responsewriter
Use Case:
I am using a service that implements `http.Handler` to send streaming
video to the frontend. Reliably, when sending fragmented MP4 data on
MacOS, the app would panic because the buffer being sent through the
response passed a not-nil check but would panic when accessing the first
byte of the buffer.
This PR addresses that by checking if the buffer is not empty instead of
nil, accounting for the case where len(buf) == 0 and cap(buf) > 0, or
maybe where buf[0] == '\0' (I'm not sure how the nil checks work for
slices)
* Update UNRELEASED_CHANGELOG
* Update v3/internal/assetserver/webview/responsewriter_darwin.go
nil and len check
---------
Co-authored-by: Atterpac <89053530+atterpac@users.noreply.github.com>
* fix(macOS): Use visibleFrame for window centering to exclude menu bar
The windowCenter() function was using [screen frame] which includes
the menu bar and dock areas, causing windows to appear positioned
too high on the screen when centered.
This change uses [screen visibleFrame] instead, which excludes the
menu bar and dock areas, resulting in proper visual centering.
Fixes vertical centering issue on macOS in Wails v3 alpha.
* Update v3/UNRELEASED_CHANGELOG.md
* Update changelog entry format
---------
Co-authored-by: Atterpac <89053530+atterpac@users.noreply.github.com>
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
* feat: Implement native Liquid Glass effect for macOS
feat: Add platform check for Liquid Glass demo
Show informative dialog on Windows/Linux explaining that the Liquid Glass
effect is a macOS-specific feature. The demo will exit gracefully on
non-macOS platforms.
docs: Add Liquid Glass feature to unreleased changelog
feat: Enhanced Liquid Glass effect with NSVisualEffectMaterial support
Major improvements to the Liquid Glass implementation for macOS:
- Added comprehensive NSVisualEffectMaterial support with 15+ material options
- Removed debug NSLog statements for cleaner production code
- Created multi-window demo showcasing 7 different glass effects:
* Light Style - Clean light appearance
* Dark Style - Dark themed glass
* Vibrant Style - Enhanced transparency
* Blue Tint - Custom RGBA tint color example
* Sheet Material - NSVisualEffectMaterialSheet
* HUD Window - Ultra-light HUD material
* Content Background - With warm tint color
- Added Material field to MacLiquidGlass struct for fine-grained control
- Improved demo design with proper Title Case and cleaner layout
- Fixed logo sizing to prevent blur
- All windows fully draggable with InvisibleTitleBarHeight
- Added comprehensive README documentation
The implementation now provides developers with complete control over the
glass effect appearance, supporting both native NSGlassEffectView (macOS 15.0+)
and NSVisualEffectView fallback for older systems.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
feat: Implement native Liquid Glass effect for macOS
- Add support for NSGlassEffectView on macOS 15.0+
- Implement runtime detection of native glass APIs
- Add fallback to enhanced NSVisualEffectView for older systems
- Update liquid glass demo with frameless windows for better visibility
- Support all NSGlassEffectView properties (cornerRadius, tintColor, style)
- Properly handle webview layering with glass effect
- Remove binary from version control
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: Address CodeRabbit review feedback
- Comment out unimplemented ReduceMotion and StaticMode fields
- Remove overly broad draggable CSS properties
- Add corner radius validation
- Improve CSS with proper pointer-events and user-select
- Add clarifying comments about future features
* fix: Remove unimplemented ReduceMotion and StaticMode fields
Completely remove the commented-out performance optimization fields
as they are not implemented and have no timeline for implementation.
* fix: Update windowRemoveVisualEffects to also remove NSGlassEffectView instances
The cleanup function now properly removes both NSVisualEffectView and
NSGlassEffectView instances to prevent orphaned effect layers. Uses
NSClassFromString to avoid hard references to NSGlassEffectView which
is only available on macOS 15.0+.
* fix changelog
* Update v3/pkg/application/webview_window_darwin.m
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update v3/pkg/application/webview_window_darwin.m
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* fix: Fix compilation errors in windowSetLiquidGlass
- Add missing NSGlassEffectViewStyle enum definition
- Fix undefined tintColor variable by creating NSColor before use
- Add autorelease to prevent memory leaks for allocated views
These issues were causing CI build failures while working locally due to different compiler settings.
* Update Taskfile.yaml
* feat: Implement groupID and groupSpacing for NSGlassEffectView
- Add runtime detection for groupIdentifier/groupName selectors
- Apply groupID via performSelector if supported
- Apply groupSpacing via KVC if supported
- Parameters are now functional when NSGlassEffectView supports them
- Maintains backward compatibility by checking selector availability
* test: Add liquid-glass example to test suite
- Add liquid-glass to EXAMPLEDIRS in Taskfile.yaml
- Ensures the example is tested during CI builds
- Validates compilation on different platforms
Addresses review comment about missing test coverage
* fix: Correct NSGlassEffectView availability to macOS 26.0
- Update @available checks from macOS 15.0 to 26.0 for NSGlassEffectView
- NSGlassEffectView is a private API introduced in macOS 26.0
- Update README to reflect correct version requirement
- Keep NSVisualEffectMaterial checks at 15.0 as those are different APIs
* fix: Prevent exceptions from unsafe WebView reparenting
- Remove early WebView addition to glassView.contentView
- Consolidate all WebView reparenting in one safe location
- Always call removeFromSuperview before adding to new parent
- Set frame and autoresizing mask after safe reparenting
- Prevents NSInternalInconsistencyException from multiple parents
* fix: Make WebView reparenting more robust and thread-safe
- Always call removeFromSuperview before adding to new parent
- Remove brittle superview check, always detach and reattach
- Check both webView and glassContentView are non-nil before operations
- Ensure all UI operations run on main thread with dispatch_sync
- Set frame and autoresizing mask after safe reparenting
* Tidy up
* Update changelog
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* fix: make options in update build-assets override
Before this fix, if `-config` was passed to `wails3 update
build-assets`, the values in the config file, even if they were empty,
would be used. Now, we only use the config file value if the value was
not passed in on the command line (or is the zero value or default value
for the option).
I'll be honest, I feel a little dirty about this implementation since
I had to copy string constants out of struct tags. Not very DRY of me.
That said, there was no obvious way to get the default value of a given
option. If I missed something, happy to have this corrected, but I've
tested it and it seems to be doing the things it should be doing.
* Update v3 changelog
* Fix SetBackgroundColour on Windows
Update Chromium window color on calls to SetBackgroundColour.
* update changelog
* v3.0.0-alpha.23
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* Correct nfpm.yaml template package dependencies.
As is, the `nfpm.yaml` template pulls in `-dev` versions of the packages the built Wails application actually relies on, in addition to `build-essential`. Which will work, but is way overkill. This PR corrects this.
I have tested this on an Ubuntu 22.04 VM and a Rocky Linux 10 VM, *(which actually necessitated attaching the EPEL repository)* but I did not verify Arch beyond looking up packages.
Additionally, it appears that the package name for RPM distro family is not in tune with the rest of them, referring to an earlier version of webkit2gtk, which has also been corrected.
**P.S.** Could we supply our own templates or updatable build files pretty please?
* Addressing points brought up.
---------
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
* feat: Add Content Protection for Windows and macOS
- Prevents window contents from being captured by screen recording/sharing software
- Windows: Uses WDA_EXCLUDEFROMCAPTURE on Windows 10 2004+, falls back to WDA_MONITOR
- macOS: Uses NSWindowSharingType to set window as read-only for screen sharing
- Added ContentProtectionEnabled option to WebviewWindowOptions
- Added SetContentProtection() method for runtime control
- Added comprehensive documentation and example usage
* fix changelog.mdx
* Misc fixes
* Misc fixes
* Update v3/pkg/w32/user32.go
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* Remove debug line
---------
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* fix: v3-alpha WindowUnMinimise not fired when window is maximized ( Windows )
* add fix to changelog.mdx
* Apply suggestion from @coderabbitai[bot]
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
---------
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* (docs) installation.mdx: update required Go version to 1.24
* (docs) update for Manager API Refactoring https://github.com/wailsapp/wails/pull/4359
* add entry in UNRELEASED_CHANGELOG.md to satisfy github actions
* thx coderabbitai
* thx coderabbitai
* ## Summary
I've successfully fixed the nil pointer dereference bug in the Wails v3 system tray functionality on Windows. Here's what I addressed:
**Root Cause**: The bug occurred in `systemtray_windows.go:80` where `*trayBounds = PhysicalToDipRect(*trayBounds)` was dereferencing a potentially nil pointer without checking.
**Fixes Applied**:
1. **`positionWindow` method (lines 80-82)**: Added nil check for `trayBounds` before dereferencing
2. **`bounds` method (lines 121-123, 129-131)**: Added checks for uninitialized `hwnd` and nil return from `GetSystrayBounds`
3. **`iconIsInTrayBounds` method (lines 147-149, 155-157, 160-162)**: Added similar protective checks and taskbar position validation
4. **`getScreen` method (lines 173-175)**: Added `hwnd` initialization check
5. **`openMenu` method (lines 45-47)**: Added nil check for `trayBounds`
**Key Improvements**:
- Added proper initialization checks for `s.hwnd == 0`
- Added nil pointer checks for all Windows API return values
- Ensured graceful error handling instead of panics
- Maintained existing functionality while preventing race conditions
The fix addresses the race condition where system tray operations could be called before the tray was fully initialized, preventing the nil pointer dereference panic described in issue #4456.
* Update changelog
* new events
* macOS dnd improvements
* wailsio adds for dropzone
* update example
* sorta working
the top 300px of the window are not dropabble for some reason i suspect it has to do with the drag enter/drag leave xy as the performOperation needed to use the ContentView for appropriate X/Y
* implement attribute detection for data-wails-dropzone
* docs
* pass x/y dnd linux
* cleanup exmample
* changelog
* pass all attributes to golang on dragdrop
* filetree example
* fix dnd build windows
* Fix windows dnd
* update docs
* remove debug log
* appease the security bot
* Fix changelog
* Fix changelog
* Revert "Fix event generation issues."
This reverts commit ae4ed4fe
* Fix events
* Fix merge conflicts. Fix events generation formatting
* Update docs
* Fix duplicate bundledassets import causing build failures
Remove duplicate import of bundledassets package that was causing
compilation errors in PR #4318. The import was declared twice in
the same import block, causing "bundledassets redeclared" errors.
Fixes build issues in GitHub Actions for drag-and-drop zones feature.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Replace fmt.Printf debug statements with globalApplication.debug
Replace all fmt.Printf debug logging statements in drag-and-drop
functionality with proper globalApplication.debug calls. This provides:
- Consistent logging with the rest of the application
- Proper key-value structured logging
- Better integration with the application's logging system
- Cleaner debug output format
Changes:
- application_darwin.go: Replace 2 fmt.Printf calls
- webview_window.go: Replace 6 fmt.Printf calls
- webview_window_windows.go: Replace 13 fmt.Printf calls
- Remove unused fmt import from application_darwin.go
All debug messages maintain the same information but now use
structured logging with key-value pairs instead of printf formatting.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Add nil checks to WindowEventContext methods
Ensure all WindowEventContext methods properly handle nil c.data
by initializing the map when it's nil. This prevents panics when
methods are called on contexts that haven't been properly initialized.
Changes:
- DroppedFiles(): Add nil check and map initialization
- setCoordinates(): Add nil check and map initialization
- setDropZoneDetails(): Add nil check and map initialization
- DropZoneDetails(): Add nil check and map initialization
All methods now follow the same pattern as setDroppedFiles()
where a nil data map is automatically initialized to prevent
runtime panics during drag-and-drop operations.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Update v3/pkg/application/webview_window_darwin.m
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* reinstate events docs.
---------
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* fix(application): handle error and type assertion in save file dialog
---------
Co-authored-by: hkhere <hk@tinyclouds.cn>
Co-authored-by: Atterpac <89053530+atterpac@users.noreply.github.com>
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
* fix(windows): disable external drag only when EnableDragAndDrop is set
* update changelog for html dnd fix
* remove redundant commented out code for windows dnd
* Fix changelog
---------
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
Co-authored-by: Atterpac <89053530+atterpac@users.noreply.github.com>
* Adding the ability to pass custom args to windows webview2
---------
Co-authored-by: Jason Gibson <jason@harbingerinteractive.com>
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
* ## Summary
I have successfully implemented support for `allowsBackForwardNavigationGestures` in Wails v3. Here's what I accomplished:
### Investigation Results
- **Issue Status**: The feature was **NOT** previously implemented in Wails v3
- **go-webview2**: This library is Windows-only and doesn't provide macOS WKWebView features
- **Need**: A native implementation was required specifically for macOS WKWebView
### Implementation Details
1. **Added new option**: `AllowsBackForwardNavigationGestures u.Bool` to `MacWebviewPreferences`
2. **Extended C bridge**: Updated the C struct to pass the preference to Objective-C code
3. **Implemented WKWebView setting**: Added code to set `webView.allowsBackForwardNavigationGestures` during initialization
4. **Updated preference processing**: Extended the Go code to handle the new preference
### Key Files Modified
- `v3/pkg/application/webview_window_options.go`: Added the preference option
- `v3/pkg/application/webview_window_darwin.go`: Implemented the C bridge and WKWebView configuration
### Usage Example
```go
window.SetOptions(application.WebviewWindowOptions{
Mac: application.MacWindow{
WebviewPreferences: application.MacWebviewPreferences{
AllowsBackForwardNavigationGestures: u.True(),
},
},
})
```
### Testing
- ✅ Code compiles successfully
- ✅ Created working example demonstrating the feature
- ✅ Follows existing Wails v3 patterns and conventions
### Benefits
- Provides native macOS two-finger swipe navigation
- Better performance than JavaScript alternatives
- Maintains accessibility features
- Seamless integration with existing Wails v3 API
The implementation is ready for testing and could be submitted as a PR to the Wails repository. The feature addresses the exact requirements from GitHub issue #1857 and provides both specific and API-consistent access to WKWebView's navigation gesture functionality.
* Perfect! I have:
1. ✅ Removed the `NAVIGATION_GESTURES_FEATURE.md` file
2. ✅ Removed the `example_navigation_gestures.go` file
3. ✅ Updated the `UNRELEASED_CHANGELOG.md` with a FIX entry
The changelog entry properly documents that this fix adds support for `allowsBackForwardNavigationGestures` in macOS WKWebView to enable two-finger swipe navigation gestures, referencing issue #1857.
The implementation is now clean and ready, with only the essential code changes remaining and the changelog properly updated to reflect the fix.
* Fix: macOS disabled menu item callback issue
Fixes bug where menu items that are initially disabled do not fire
their OnClick callbacks after being enabled via SetEnabled(true).
Problem:
- When creating disabled menu items, actions were not set
- When re-enabling, targets were not properly restored based on action type
- This caused callbacks to never fire for initially-disabled items
Solution:
1. Always set action during menu item creation regardless of disabled state
2. Set appropriate targets based on action type and disabled state
3. Enhanced setMenuItemDisabled to restore correct targets when re-enabling:
- Custom callbacks (@selector(handleClick)): target = menuItem
- Role-based actions (system selectors): target = nil (responder chain)
This ensures that menu items with OnClick callbacks work correctly
regardless of their initial disabled state.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Update changelog
* Update changelog
---------
Co-authored-by: Claude <noreply@anthropic.com>
* fix: properly clean up Vite server when build fails
Ensures the Vite server process is terminated when a build fails
during 'wails3 dev', preventing port conflicts on subsequent runs.
Fixes#4403🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: add defer for watcher cleanup and tidy up returns
- Add defer cleanup() to ensure resources are always freed
- Remove manual cleanup in error path since defer handles it
- Simplify error handling for better maintainability
Addresses feedback on PR #4436
* fix: prevent channel deadlock in watcher cleanup
- Separate cleanup logic from channel notification
- cleanup() only stops the engine
- signalCleanup() handles both cleanup and channel notification
- Prevents deadlock when function exits normally
---------
Co-authored-by: Claude <noreply@anthropic.com>
* Add goModTidy function to clean up Go module dependencies during installation (#4283)
* Add goModTidy function and update changelog for automatic execution after wails init (#4283)
* Update CLI documentation to clarify bypassing 'go mod tidy' during project initialization (#4283)
* Add -skipgomodtidy flag to CLI and update installation logic to conditionally run go mod tidy
* Update CLI documentation to reflect default value of -skipgomodtidy flag and clean up code (#4283)
* Update docs/src/content/docs/guides/cli.mdx
* fix changelog
---------
Co-authored-by: Triadmoko Denny Fatrosa <triadmoko.fatrosa@codemi.co.id>
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
Add explicit base_ref checks to ensure the v3 build and test workflow
only runs for PRs targeting the v3-alpha branch.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Fix backtick command substitution error using here-document
- Add extra spacing before disclaimer section
- Simplify commit message to just version number
- Add comprehensive test files for release notes creation
- Add edge case testing for empty changelogs and comments
- Add documentation explaining how the feature works
- Verify all functionality works as expected
The workflow now explicitly checks out v3-alpha branch, so the job-level
condition 'if: github.ref == refs/heads/v3-alpha' is no longer needed
and was preventing manual runs from other branches.
* fix: enhance doctor command to verify Windows SDK dependencies ([#4390](https://github.com/wailsapp/wails/issues/4390))
- Updated the doctor command to check for the presence of Windows SDK dependencies, improving the setup process for Windows users.
- Added relevant entry to the changelog for better documentation of this fix.
* Update changelog
---------
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
Remove all test files, extra workflows, and artifacts.
Keep only:
- changelog-validation-v3.yml (main workflow)
- v3/scripts/validate-changelog.go (validation script)
Tested and working with act.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Remove problematic large workflow files
- Add final clean 'Changelog Validation (v3)' workflow
- Tested and working with act
- Uses external Go script for maintainability
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Successfully tested with act - validation script and PR diff detection working
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Created external Go validation script in v3/scripts/
- Clean workflow file without embedded scripts (much smaller)
- Should properly show workflow_dispatch trigger in GitHub
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Fixed line 422 YAML syntax error by using single-line commit message
Verified working with act dry-run test
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Fixed multiline commit message using HEREDOC syntax on line 421
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
This workflow validates changelog entries in PRs targeting v3-alpha branch:
- Detects entries added to already-released versions using diff analysis
- Automatically moves misplaced entries to [Unreleased] section
- Uses proper ### Category format for Keep a Changelog compliance
- Commits fixes back to PR with clear feedback
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* feat: Add distribution-specific dependencies using nfpm overrides
Implements feature #4339 by enhancing the nfpm.yaml.tmpl to use nfpm's built-in
overrides feature for different Linux distributions and package formats.
## Changes Made:
### Enhanced nfpm configuration with overrides:
- **Default**: Debian 12/Ubuntu 22.04+ with WebKit 4.1 dependencies
- Uses libgtk-3-dev, libwebkit2gtk-4.1-dev, build-essential, pkg-config
- **RPM override**: RHEL/CentOS/AlmaLinux/Rocky Linux with WebKit 4.0 dependencies
- Uses gtk3-devel, webkit2gtk3-devel, gcc-c++, pkg-config
- **Arch override**: Arch Linux with WebKit 4.1 dependencies
- Uses gtk3, webkit2gtk-4.1, base-devel, pkgconf
This approach uses nfpm's native override system to automatically select
the correct dependencies based on the target package format, ensuring
that each distribution gets the appropriate WebKit version and package names.
### How it works:
- DEB packages get WebKit 4.1 dependencies (default)
- RPM packages get WebKit 4.0 dependencies (RHEL/CentOS compatibility)
- Arch packages get WebKit 4.1 dependencies with Arch-specific package names
Fixes#4339🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* feat: Enhance wails doctor with WebKit fallback support
Improves the doctor command to better detect WebKit dependencies across
different Linux distributions by adding fallback package support.
## Changes Made:
### Enhanced Package Manager Detection:
- **APT (Debian/Ubuntu)**: Added WebKit 4.1 → 4.0 fallback support
- **DNF (Fedora/RHEL)**: Added webkit2gtk4.0-devel fallback for older systems
- **Zypper (SUSE)**: Added webkit2gtk4_1-devel for modern SUSE distributions
- **Emerge (Gentoo)**: Added support for both webkit-gtk:6 and webkit-gtk:4 slots
- **Pacman (Arch)**: Added fallback from webkit2gtk-4.1 to webkit2gtk
### Improved Developer Experience:
- Doctor command now tries newer WebKit versions first, falls back gracefully
- Provides more accurate dependency detection across distributions
- Better guidance for developers on different Linux systems
### How It Works:
- Each package manager lists multiple WebKit package options in order of preference
- The dependency system tries packages in order until it finds one that's available
- Developers get appropriate installation commands for their specific distribution
This complements the nfpm overrides by ensuring developers can properly
set up their development environment regardless of distribution.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* update changelog
---------
Co-authored-by: Claude <noreply@anthropic.com>
- Detects changes in v2 and v3-alpha branches independently
- Runs release scripts and extracts changelog notes
- Creates GitHub releases with proper tags and release notes
- Supports dry-run mode for testing
- Authorization controls for release permissions
- Comprehensive change detection and summary reporting
- Currently disabled (no schedule) for safety
- Added extractReleaseNotes function to extract content from Unreleased section
- Script now prints release notes between delimiter markers
- Release notes can be captured for use in GitHub release tags
- Maintains existing functionality for updating changelog with version/date
- Mirrors v2 release script functionality for consistency
- Created test-nightly-releases.yml for safe testing
- Added local test scripts for changelog extraction and version logic
- Updated nightly-releases.yml with changelog integration
- Ready for dry-run testing
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Fix OpenFileManager on windows
- Use cmd.SysProcAttr.CmdLine to invoke explorer.exe on Windows
- separate platform-specific code in package fileexplorer into separate files
* Update changelog.mdx
---------
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
Add path filter to ensure Build + Test v3 workflow only runs on
PRs targeting v3-alpha branch that actually modify v3/ directory.
This prevents the workflow from running on master branch PRs.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Remove `dir: examples` from test:examples task to fix working directory
conflict in GitHub Actions. The workflow sets working-directory to v3,
and the individual example tasks already specify their own directories.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fixed bug with nil window in processURLRequest
* added row to changelog and added log
* removed old code
* Fix getWindowForID undefined error in processURLRequest
Replace non-existent globalApplication.getWindowForID() call with
the correct globalApplication.Window.GetByID() method. This fixes
the compilation error while preserving the nil check functionality
that was intended in the original PR.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Add explicit nil check for safer window validation
Add an additional nil check alongside the boolean check from GetByID()
to handle edge cases where a window interface could theoretically be
nil even when the lookup indicates success. This provides defense
in depth against nil pointer dereferences.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Change window not found log to debug level
Use globalApplication.debug() instead of log.Println() for missing
window ID messages. This is more appropriate as it's diagnostic
information rather than a user-facing error.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Remove unused log import
Remove the "log" import that is no longer needed after switching
to globalApplication.debug() for logging.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
* Refactor Manager API to use singular naming convention
This is a RENAME-ONLY exercise that converts the Wails v3 Manager API from plural to singular naming for better consistency and clarity.
## Changes Applied
### API Transformations:
- `app.Windows.*` → `app.Window.*`
- `app.Events.*` → `app.Event.*`
- `app.ContextMenus.*` → `app.ContextMenu.*`
- `app.KeyBindings.*` → `app.KeyBinding.*`
- `app.Dialogs.*` → `app.Dialog.*`
- `app.Menus.*` → `app.Menu.*`
- `app.Screens.*` → `app.Screen.*`
### Files Updated:
- **Core Application**: 22 files in `v3/pkg/application/`
- **Examples**: 43+ files in `v3/examples/`
- **Documentation**: 13 files in `docs/src/content/docs/`
- **CLI Tests**: 1 file in `v3/internal/commands/`
### Critical Constraints Preserved:
- ✅ Event string constants unchanged (e.g., "windows:WindowShow")
- ✅ Platform event names preserved (events.Windows, events.Mac, etc.)
- ✅ TypeScript API remains compatible
- ✅ All functionality intact
### Verification:
- ✅ All examples build successfully (`task test:examples` passes)
- ✅ Application package compiles without errors
- ✅ Documentation reflects new API patterns
## Benefits
- **Improved Clarity**: Singular names are more intuitive (`app.Window` vs `app.Windows`)
- **Better Consistency**: Aligns with Go naming conventions
- **Enhanced Developer Experience**: Clearer autocomplete and API discovery
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Fix generator testcases and add cross-platform test cleanup
- Update 28 generator testcase files to use singular API (app.Window.New() vs app.Windows.New())
- Add cross-platform cleanup system with Go script to remove test artifacts
- Add test:all task with comprehensive testing and automatic cleanup
- Fix cleanup to target files vs directories correctly (preserves source directories)
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Fix remaining Windows CI failures by updating all plural API usage to singular
Fixed the last remaining instances of old plural Manager API usage:
- tests/window-visibility-test/main.go: Updated all app.Windows -> app.Window and app.Menus -> app.Menu
- internal/templates/_common/main.go.tmpl: Updated app.Windows -> app.Window and app.Events -> app.Event
- pkg/services/badge/badge_windows.go: Updated app.Windows -> app.Window (Windows-specific fix)
These fixes address the Windows CI failures where platform-specific files still used the old API.
The tests didn't catch this locally because Windows-specific files only compile on Windows.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
* Initial refactor
* More refactoring of API
* Update gitignore
* Potential fix for code scanning alert no. 134: Incorrect conversion between integer types
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
* Update v3/internal/generator/testcases/variable_single_from_function/main.go
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* Update v3/pkg/application/context_menu_manager.go
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* Update v3/pkg/application/event_manager.go
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* Update v3/pkg/application/context_menu_manager.go
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* Fix build issues
* Fix build issues
* Address CodeRabbitAI review feedback: fix goroutines, error handling, and resource management
- Fix infinite goroutines with proper context cancellation and ticker cleanup
- Add error handling to window creation calls
- Prevent unbounded slice growth in gin-service and screen examples
- Use graceful shutdown patterns with app.Context().Done()
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Fix manager API refactor issues and complete all v3 example builds
- Fixed slices import missing in event_manager.go
- Changed contextMenusLock from sync.Mutex to sync.RWMutex for RLock/RUnlock compatibility
- Updated all globalApplication calls to use new manager pattern (Windows.Current, Events.OnApplicationEvent, etc.)
- Fixed Events.Emit vs Events.EmitEvent method signature mismatch
- Corrected NewWithOptions calls (returns 1 value, not 2) in examples
- Added comprehensive .gitignore patterns for all v3 example binaries
- All 34 v3 examples now build successfully
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Fix Linux platform manager API calls
- Updated events_common_linux.go: OnApplicationEvent → Events.OnApplicationEvent
- Updated application_linux.go: OnApplicationEvent → Events.OnApplicationEvent
- Ensures Linux builds work with new manager pattern
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Fix remaining NewWithOptions assignment errors in examples
- Fixed badge/main.go: removed assignment mismatch and unused variable
- Fixed badge-custom/main.go: removed assignment mismatch and variable reuse
- Fixed file-association/main.go: removed assignment mismatch and unused variable
- All examples now use correct single-value assignment for NewWithOptions()
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Implement multi-architecture Docker compilation system for Linux builds
### New Features
- **Multi-Architecture Support**: Native ARM64 and x86_64 Docker compilation
- **Auto-Detection**: Automatic architecture detection in Taskfile tasks
- **Complete Cross-Platform Testing**: 129 builds (43 examples × 3 platforms)
### Docker Infrastructure
- `Dockerfile.linux-arm64`: Ubuntu 24.04 ARM64 native compilation
- `Dockerfile.linux-x86_64`: Ubuntu 24.04 x86_64 native compilation
- Architecture-specific build scripts with colored output and error handling
- Native compilation eliminates CGO cross-compilation issues
### Task System Updates
- **New Tasks**: `test:examples:all` for complete cross-platform testing
- **Architecture-Specific**: `test:examples:linux:docker:arm64/x86_64`
- **Auto-Detection**: `test:example:linux:docker` detects host architecture
- **Clear Parameter Usage**: Documented when DIR parameter is/isn't needed
### Build Artifacts
- Architecture-specific naming: `testbuild-{example}-linux-{arch}`
- ARM64: `testbuild-badge-linux-arm64`
- x86_64: `testbuild-badge-linux-x86_64`
### Documentation
- Complete TESTING.md overhaul with multi-architecture support
- Clear command reference distinguishing single vs all example builds
- Updated build performance estimates (10-15 minutes for 129 builds)
- Comprehensive troubleshooting and usage examples
### Infrastructure Cleanup
- Removed deprecated `Dockerfile.linux-proper`
- Updated .gitignore for new build artifact patterns
- Streamlined Taskfile with architecture-aware Linux tasks
**Status**: Production-ready multi-architecture Docker compilation system
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Fix CLI appimage testfiles API migration and add to testing system
### API Migration Fixes
- **Event Registration**: Updated `app.OnApplicationEvent()` → `app.Events.OnApplicationEvent()`
- **Window Manager**: Updated `app.CurrentWindow()` → `app.Windows.Current()`
- **Window Creation**: Updated `app.NewWebviewWindowWithOptions()` → `app.Windows.NewWithOptions()`
- **Menu Manager**: Updated `app.SetMenu()` → `app.Menus.SetApplicationMenu()`
- **Screen API**: Updated `app.GetPrimaryScreen()/GetScreens()` → `app.Screens.GetPrimary()/GetAll()`
### Testing System Enhancement
- **New Task**: `task test:cli` for CLI-related code compilation testing
- **Integration**: Added CLI testing to `task test:examples` and `task test:examples:all`
- **Documentation**: Updated TESTING.md to include CLI code testing
### Files Fixed
- `internal/commands/appimage_testfiles/main.go`: Complete API migration
- `Taskfile.yaml`: Added CLI testing tasks and integration
- `TESTING.md`: Updated documentation to reflect CLI testing
This ensures CLI code API migrations are caught by our testing system and prevents
future build breakages in CLI components.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Enhance testing infrastructure and fix API migration issues across v3 codebase
This commit introduces comprehensive testing infrastructure to catch API migration issues and fixes all remaining compatibility problems:
## Enhanced Testing Infrastructure
- Added `test:cli:all` task to validate CLI components compilation
- Added `test:generator` task to test code generator test cases
- Added `test:infrastructure` task for comprehensive infrastructure testing
- Updated `test:examples` to include CLI testing automatically
## API Migration Fixes
- Fixed manager-based API calls in window visibility test (app.Windows.NewWithOptions)
- Fixed manager-based API calls in screen manager tests (sm.GetAll, sm.GetPrimary)
- Fixed event registration API in 6 service test files (app.Events.OnApplicationEvent)
- Updated menu API calls (app.Menus.SetApplicationMenu)
## Cross-Platform Validation
- All 43 examples compile successfully on Darwin
- CLI components compile without errors
- Generator test cases validate correctly
- Application package tests pass compilation
The enhanced testing system integrates with existing GitHub Actions CI/CD and will automatically catch future API migration issues, ensuring ecosystem stability as the v3 API evolves.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Fix template API migration issues and add comprehensive template testing
This commit resolves the GitHub Actions template generation failures by fixing API migration issues in the template source files and adding comprehensive template testing to the infrastructure.
## Template API Fixes
- Fixed `app.NewWebviewWindowWithOptions()` → `app.Windows.NewWithOptions()` in main.go.tmpl
- Fixed `app.EmitEvent()` → `app.Events.Emit()` in main.go.tmpl
- Updated the _common template used by all framework templates (lit, react, vue, etc.)
## Enhanced Testing Infrastructure
- Added `test:templates` task to validate template generation and compilation
- Tests lit and react template generation with API migration validation
- Integrated template testing into `test:infrastructure` task
- Templates now tested alongside CLI components, generator, and application tests
## GitHub Actions Compatibility
- Resolves template generation failures in CI/CD pipeline
- Ensures all generated projects use correct manager-based API calls
- Maintains template consistency across all supported frameworks
The template testing validates that generated projects compile successfully with the new manager-based API pattern, preventing future template generation failures in GitHub Actions.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Reorganize Docker testing files into test directory
- Move Dockerfiles from root to test/docker/
- Update all Taskfile.yaml Docker build paths
- Update TESTING.md documentation
- Maintain full backward compatibility
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Address CodeRabbit review: improve resource management and API patterns
- Store event handler cleanup functions for proper resource management
- Fix goroutine management with context-aware cancellation patterns
- Add documentation for error handling best practices
- Improve API consistency across examples
Examples updated:
- plain: Fixed event handlers and goroutine lifecycle
- badge: Added cleanup function storage
- gin-example: Proper event handler management
- gin-service: Service lifecycle cleanup
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Address CodeRabbit nitpicks: optimize Docker images and docs
Docker Optimizations:
- Add --no-install-recommends and apt-get clean for smaller images
- Add SHA256 checksum verification for Go downloads
- Remove unnecessary GO111MODULE env (default in Go 1.16+)
- Add hadolint ignore for here-doc blocks
Build Enhancements:
- Add --pull flag to Docker builds for fresh base images
- Improve build reliability and consistency
Documentation Fixes:
- Add proper language tags to code blocks (bash, text)
- Fix heading formatting and remove trailing punctuation
- Improve syntax highlighting and readability
Files updated:
- test/docker/Dockerfile.linux-arm64
- test/docker/Dockerfile.linux-x86_64
- Taskfile.yaml
- TESTING.md
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Update changelog: document Manager API refactoring and improvements
Breaking Changes:
- Manager API Refactoring: Complete reorganization from flat structure
to organized managers (Windows, Events, Dialogs, etc.)
- Comprehensive API migration guide with all method mappings
- References PR #4359 for full context
Added:
- Organized testing infrastructure in test/docker/ directory
- Improved resource management patterns in examples
- Enhanced Docker images with optimizations and security
This documents the major architectural changes and improvements
made to the Wails v3 API and development infrastructure.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Support cross-platform testing
---------
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
* fix incorrect window destroy
* remove duplicate common signals
* Better handling of "shouldclose"
* Better handling of "shouldclose"
* Fix ABI safety issues in exported function for macOS window closing
Address CodeRabbit feedback on ABI safety and data races:
- Change exported function signature to use C types (C.uint, C.bool) for ABI safety
- Convert unconditionallyClose field from bool to atomic uint32 for thread safety
- Update all read/write operations to use atomic operations across platforms
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
This fixes the template execution errors that occurred when running 'wails3 init' with MSIX-related templates. The issue was that the templates were trying to access fields under an 'Info' sub-struct that doesn't exist in the BuildConfig context.
Changes:
- Fixed app_manifest.xml.tmpl to use direct field references (e.g., .ProductIdentifier instead of .Info.ProductIdentifier)
- Fixed template.xml.tmpl with the same field reference corrections
- Added missing MSIX-related fields to BuildAssetsOptions struct (Publisher, ProcessorArchitecture, ExecutablePath, ExecutableName, OutputPath, CertificatePath)
- Set appropriate default values for the new fields in GenerateBuildAssets function
Resolves the error: "can't evaluate field Info in type commands.BuildConfig"
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Fixes Windows compilation error where iconIsInTrayBounds was being
assigned without declaration. Declares the variable explicitly
before assignment to resolve 'undefined: iconIsInTrayBounds' error.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Remove CLAUDE.md and API_MANAGERS.md files that were not intended
for this branch. The Windows compilation fixes remain intact.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Fixes two Windows-specific compilation issues that were preventing
GitHub Actions builds from passing:
## Issues Fixed
### 1. chromium.PutIsVisible undefined error
- **Problem**: Method call `chromium.PutIsVisible(true)` not available in
current go-webview2 package version
- **Solution**: Commented out the call with TODO note for future restoration
- **File**: pkg/application/webview_window_windows.go:1686-1690
- **Impact**: Temporarily disables efficiency mode prevention until method available
### 2. Variable redeclaration error
- **Problem**: `err` variable redeclared with `:=` in same function scope
- **Solution**: Changed second assignment from `:=` to `=` for proper reassignment
- **File**: pkg/application/systemtray_windows.go:65
- **Context**: iconIsInTrayBounds assignment in positionWindow function
## Additional Changes
- Added CLAUDE.md for development guidance
- Added API_MANAGERS.md documenting new manager-based API structure
- Implemented functional DMG package creation (internal/commands/dmg/)
- Restored DMG support in CLI tool with proper validation
## Verification
- ✅ Commands package builds successfully
- ✅ Main CLI builds successfully
- ✅ Tests run without compilation errors
- ✅ Example builds pass
Resolves GitHub Actions Windows build failures introduced in recent commits.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Addresses the issue where application windows fail to show on Windows 10 Pro
due to efficiency mode preventing WebView2 NavigationCompleted events.
## Changes Made
### Windows (webview_window_windows.go)
- **Decouple window container from WebView state**: Window now shows immediately
- **Add timeout fallback**: 3-second timeout to show WebView if navigation is delayed
- **Prevent efficiency mode**: Set WebView2 IsVisible=true per Microsoft recommendation
- **Enhanced state tracking**: Added showRequested, visibilityTimeout, windowShown fields
- **Robust navigation completion**: Improved handler to work with new visibility logic
### macOS (webview_window_darwin.go)
- **Documentation**: Added comment noting macOS already follows best practices
- **No functional changes**: macOS implementation already robust
### Linux (webview_window_linux.go, linux_cgo.go, linux_purego.go)
- **Add missing methods**: Implemented show()/hide() methods in main Linux file
- **CGO implementation**: Added windowShow()/windowHide() delegation methods
- **Purego implementation**: Added windowShow()/windowHide() methods for purego builds
- **Consistent behavior**: Matches CGO implementation with position saving
## Implementation Pattern
Adopts the following pattern:
1. **Separate concerns**: Window container vs WebView content readiness
2. **Immediate visibility**: Show window container immediately
3. **Progressive enhancement**: Show WebView content when ready
4. **Robust fallbacks**: Timeout and multiple strategies for edge cases
## Testing Considerations
- Windows 10 Pro efficiency mode scenarios
- WebView2 navigation delays or failures
- Cross-platform consistency
- Performance impact of timeout mechanisms
Fixes#2861🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Upgraded from v0.13.0 to v0.17.0 to get latest improvements
- Includes enhanced hardware detection capabilities
- Bug fixes for GPU path parsing and PCI address handling
- Verified wails doctor command continues to work correctly
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add UAC trustInfo section to Windows manifest template with default 'asInvoker' execution level
- Update badge example manifest to include UAC configuration
- Add comprehensive documentation for Windows UAC configuration
- Ensure consistent UAC behavior across different machines
Fixes issue where Windows applications lost admin requirements when copied between machines.
The UAC configuration is now always present in the manifest, making it explicit and easily
customizable by users since v3 expects users to edit their own build assets.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add badge_linux.go with no-op implementation for Linux compatibility
- Fix capabilities_linux.go to not require webkit version detection
- Add missing build tag to webkit_linux.go
Resolves "undefined: badge.NewWithOptions" and "undefined: badge.New" errors
that were causing Linux build failures in GitHub Actions for badge examples.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Update systray.mdx
GUI operations must run on the main thread I guess? this example calling systray.Run() from a non-main thread context and it will panic.
* Update systray.mdx
OnClick function takes *application.Context. the example if not complete
Serve runtime from assetserver if requested.
Add gin guide, fix asset server merge, add gin example
adding http.CloseNotifier and http.Flusher interface to assetserver.contentTypeSniffer, for Gin (and other framework) compatibility.
* Enable go1.24 tests
This reverts commit e38684e7885c9c7b5ad3f704ad500c39bbce7715.
* Testdata for go1.24
This reverts commit 7ed397dc452f420551dfdd05dfe0c6a7646b3ba4.
* Require go 1.24
* Update changelog
* Add test for omitzero
---------
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
* Add prepend and clear method to menus
* Document appending and clearing menus
* Add `Destroy()`
Add notes to documentation.
* Remove menu item from map when destroying
* Remove menu items from map when clearing
* Update v3/pkg/application/menu.go
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* Minor updates
* Fix build error
---------
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* Rename predicates source file
* Overhaul and document type predicates
* Fix model collection logic for named types
* Fix map key type rendering
* Fix map creation code
* Fix rendering of structs that implement marshaler interfaces
* Fix type cycle detection to take type args into account
* Fix enum and typeparam field initialisation
* Improve unsupported type warnings
* Remove internal models file
* Deduplicate template code
* Accept generic aliases in static analyser
* Support new `encoding/json` flag `omitzero`
* Handle special cases when rendering generic aliases
* Update npm test dependencies
* Test class aliases and implicit private dependencies
* Test marshaler combinations
* Test map key types
* Remove bad map keys from unrelated tests
* Test service discovery through generic aliases
* Test generic aliases
* Test warning messages
* Disable go1.24 tests
* Update changelog
* Restore rendering of injected lines in index file
* Test directives
* Add wails:ignore directive
* Fix typo
* Move injections to the bottom of service files
* Handle errors from closing files
* Do not emit messages when services define only lifecycle methods
* Add internal directive for services and models
* Update changelog
* Fix error in service templates
* Test internal directive on services/models
* Fix error in index template
* Base testdata updates
* Testdata for class aliases and implicit private dependencies
* Testdata for marshaler combinations
* Testdata for map key types
* Testdata for bad map key fixes
* Add weakly typed enums aka alias constants
* Testdata for enum and typeparam field fixes
* Testdata for generic aliases
* Testdata for warning messages
* Testdata for directives
* Testdata for weakly typed enums
* Update binding example
* Update services example
* Remove go1.24 testdata
* Update cli doc
* Fix analyser tests
* Fix windows tests... hopefully
* go mod tidy on examples
* Update bindings guide
---------
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
* Fix and optimize content type sniffer
- Minimize copying and buffering
- Ensure it sniffs the full 512-bytes prefix
* Fix assorted warnings
* Cleanup error formatting
- Remove unnecessary formatting calls
- Fix invalid format strings
- Standardise logging calls
* Fix and optimize index fallback method
- Pass through non-404 responses correctly
- Do not buffer original response
* Test content sniffing and index fallback
* Update changelog
* Remove obsolete check
* Add safety checks in sniffer
* New ContextMenu API + example
* Remove redundant code
* ContextMenuData now returns a string.
New Menu guide.
* Update readme
* Update v3/pkg/application/context.go
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* Add new menubar option
* Fix docs
---------
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* Pass build flags to binding generator
* Update changelog
* Track variable dependencies using task labels
* Track JS/TS sources for binding generator
The `/wails:include` directive allows for the inclusion of additional JS/TS files in the generated bindings.
* Pass production var to frontend task
* Track binding generator output as source
* Fix generates pattern for frontend build task
* Fix typo in function `term.Warningf`
* Use facilities from `internal/term` in bindings command instead of `pterm`
---------
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
* Gather and document service API
* Update changelog
* Add NewServiceWithOptions
* Revert static analyser change
* Remove infinite loop in NewService[WithOptions]
* Fix compiler warning in bindings command
* Add test for NewServiceWithOptions
* Update changelog
* Fix service example
---------
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
* Add some clarifying comments
* Remove special handling of window parameters
* Improve internal method exclusion
* Add test for internal method exclusion
* Remove useless blank field from app options
This is a leftover from an older version of the static analyser. It should have been removed long ago.
* Remove redundant godebug setting
gotypesalias=1 is the default starting with go1.23
* Use new range for syntax to simplify code
* Remove generator dependency on github.com/samber/lo
* Ensure generator testing tasks do not use the test cache
* Rename cyclic types test
* Test for cyclic imports
* Fix import cycle between model files
* Sort class aliases after their aliased class
* Test class aliases
* Fix length of default value for array types
* Test array initialization
* Add changelog
* Update changelog
* Fix contrived marking technique in model sorting algorithm
* Update binding example
* Update test data
---------
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
* [v3] Update Templates (macOS Target Version and Linux aarch64 AppImage)
* Update changelog.mdx
---------
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
OpenFileManager for opening with the native file manager and optional
file selection support
Closes#3197
Co-authored-by: Krzysztofz01 <krzysztof.zon2001@gmail.com>
* docs: fix tip
* update packages
* add showase
* add 3 showcases from v2
* mdx -> md
* add links page
* add templates page with a caution
* add a tip
* move desc up
* use X instead of twitter
* fix link
* Add clave
* add how to section
* init docs
* add few categories
* add more
* update home
* add blog
* update favicon
* fix few links and
* untouch
* untouch more
* add some icons
* add icons
* move ggetting started at the top and collapse the rest
* actually collapse
* format
* remove includes
* more format
* remove includes
* move assets
* add i18n
* fix i18n
* formatting
* order
* Prevent sidebar from making the page shake during load
* Prevent sidebar from making the page shake during load
* organize docs
* fix link
* expand a bit
* add credits page
* update all contributors file
* remove underlines
* add alternative
* use html
* lets get the first success build
* add latest entry
* remove example file
* fix examples
* more fixes
* fix grammar
* grammar
* remove dupes
* fix link
* grammar
* typo
* typo
* typo
* Logo update. Minor changes.
* update changelog
* update changelog
* rabbit is right
---------
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
* rework service.OnStartup to close applicatoin on error
CHANGELOG.md
fix index out of bounds potential
* os.Exit -> runtime.Goexit
* Revert to os.Exit
---------
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
* Support for linux deb,rpm,arch linux packager packaging
* remove optional tasks from linux:package task
CHANGELOG.md
* Update Taskfile.linux.yml
* Integrated nfpm into CLI.
Fixed task update.
* package tool fixes and add bundle name field
empty name guard
* add linux depdencies
* Add some docs
* Fixed tests. Updated task to latest.
* Update v3/internal/commands/tool_package.go
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* Remove doctor references to nfpm
---------
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Support linux systrays first click to open
- Convert event handling to switch statement for better readability
- Fix menu event handlers to properly trigger open/close callbacks
- Update click behavior to use doubleClickHandler for Activate
CHANGELOG.md
* bugfix: update version to support application.ServiceOptions
* [v3] docs: update changelog
---------
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
* Update nsis template
* Move app data into config.yml
* mac support
* Add FileAssociations application config option
Support `ApplicationOpenedWithFile` event on Windows
Add docs
* Add FileAssociations application config option
Support `ApplicationOpenedWithFile` event on Windows
Add docs
Add test project
* Update example & docs.
Fix show window bug.
* Fix window show event bug
* Update changelog
* Update nsis template
* Move app data into config.yml
* mac support
* Add FileAssociations application config option
Support `ApplicationOpenedWithFile` event on Windows
Add docs
* Add FileAssociations application config option
Support `ApplicationOpenedWithFile` event on Windows
Add docs
Add test project
* Update example & docs.
Fix show window bug.
* Fix window show event bug
* Update changelog
* [v3] actions: run in forks and also build v3/* or v3-* branches
* [v3] actions: don't fail fast in test build actions
* [v3] actions: update actions to node20
* [v3] actions: specify cache dependency path for setup-go
to get rid of warnings
* plugin handler and lifecycle
* rebase
* remove reflect
s
* remove Config and NewPlugin from plugin template
* Remove plugin manager, generation of plugin interface
* implement http handlers for services
remove log
trim path
prefix wails/services
* update plugine example
* Misc updates
* Ported plugins to services, rewritten example
* Added fileserver
* Update OnStartup and use a context for the application
* Rename PathPrefix to Route. Create docs.
* Use service config copy. Add Name to Service Options. Improve service generation.
* Use service config copy. Add Name to Service Options. Improve service generation. Update README
* Remove rogue db
* Update changelog.md
---------
Co-authored-by: Lea O'Anthony <lea.anthony@gmail.com>
* [linux] emit system specific event for theme change
Code was incorrectly emitting the `events.Common.ThemeChanged` event
instead of the OS Specific `events.Linux.SystemThemeChanged` event.
It is the reponsibility of the code in events_common_linux.go to map
it to the common variety.
* [linux] implement WindowDidMove
* [linux] implement debounce for WindowDidMove
* [example] listen for events.Common.WindowDidMove
* [windows] move WindowDidMove mapper outside of DnD guard
* WindowDidResize implementation
* windows: WindowDidResize
* chore: changelog update
* events.Common.WindowDidMove and events.Common.WindowDidResize
* Add proposal.
Reference Mac implementation
* Add windows support. Update proposal.
* Update example
* Rename Active->Enable,Inactive->Disabled. Ensure window can get controls back after hiding close on windows. Added guide. Updated example.
* Add ExStyle option for setting titlebar style.
* Fix linux builds
* Tidy up
* Expose `DefaultApplicationMenu`.
Add `FindByLabel` and `ItemAt` for finding menu items in a menu
* Add `Menu.RemoveMenuItem()`, `MneuItem.GetAccelerator()` and `MenuItem.RemoveAccelerator()`
* Remove `Update`
* Iterate when removing menu items
* Add `GetSubmenu()`
* Subject generator output to stricter TS linting
* Fix runtime support code typing
* Relax tsconfig for templates
* Update test data
* Update binding example
* Support variadic arguments and slice, pointer types
* Fix computation of type namespaces
* Improve comments and general formatting
* Set default values correctly for composite types
* Add templates for bindings
Additionally:
* fixes generation of tuple return type
* improves imports and namespacing in JS mode
* general cleanup of generated code
* Simplify import list construction
* Refactor type generation code
Improves support for unknown types (encoded as any) and maps (using
Typescript index signatures)
* Support slices with pointer elements
* Match encoding/json behaviour in struct parser
* Update tests and example
* Add tests for complex method signatures and json tag parsing
* Add test `function_multiple_files`
* Attempt looking up idents with missing denotation
* Update test data
* fix quoted bool field
* Test quoted booleans
* Delete old parser code
* Remove old test data
* Update bindgen flags
* Makes call by ID the default
* Add package loading code
* Add static analyser
* Temporarily ignore binding generation code
* Add complex slice expressions test
* Fix variable reference analysis
* Unwrap casts to interface types
* Complete code comments
* Refactor static analyser
* Restrict options struct usage
* Update tests
* Fix method selector sink and source processing
* Improve Set API
* Add package info collector
* Rename analyser package to analyse
* Improve template functions
* Add index file templates
* Add glue code for binding generation
* Refactor collection and rendering code
* Implement binding generator
* Implement global index generation
* Improve marshaler and alias handling
* Use package path in binding calls by name
* Implement model collection and rendering
* Fix wrong exit condition in analyser
* Fix enum rendering
* Generate shortcuts for all packages.
* Implement generator tests
* Ignore non-pointer bound types
* Treat main package specially
* Compute stats
* Plug new API into generate command
* Support all named types
* Update JS runtime
* Report dual role types
* Remove go1.22 syntax
* Fix type assertion in TS bindings
* encoding/json compliance for arrays and slices
* Ignore got files in testdata
* Cleanup type rendering mechanism
* Update JS runtime
* Implement generic models
* Add missing field in renderer initialisation
* Improve generic creation code
* Add generic model test
* Add error reporting infrastructure
* Support configurable file names
* Detect file naming collisions
* Print final error report
* New shortcut file structure + collision detection
* Update test layout and data
* Autoconfiguration for analyser tests
* Live progress reporting
* Update code comments
* Fix model doc rendering
* Simplify name resolution
* Add test for out of tree types
* Fix generic creation code
* Fix potential collisions between methods and models
* Fix generic class alias rendering
* Report model discovery in debug mode
* Add interface mode for JS
* Collect interface method comments
* Add interface methods test
* Unwrap generic instantiations in method receivers
* Fix rendering of nullable types in interface mode
* Fix rendering of class aliases
* Expose promise cancel method to typescript
* Update test data
* Update binding example
* Fix rendering of aliased quoted type params
* Move to strongly typed bindings
* Implement lightweight analyser
* Update test cases
* Update binding example
* Add complex instantiation test
* Load full dependency tree
* Rewrite collector
* Update renderer to match new collector
* Update generator to match new collector
* Update test data
* Update binding example
* Configure includes and injections by language
* Improve system path resolution
* Support rich conditions in inject/include directives
* Fix error handling in Generator.Generate
* Retrieve compiled go file paths from fileset
* Do not rely on struct info in struct flattening algorithm
* Fix doc comment for findDeclaraion
* Fix bugs in embedded field handling
* Fix bugs and comments in package collection
* Remove useless fields from ServiceInfo
* Fix empty line at the beginning of TS indexes
* Remove global index and shortcuts
* Remove generation tests for individual packages
* Enforce lower-case file names
* Update test data
* Improve error reporting
* Update binding example
* Reintroduce go1.22 syntax
* Improve relative import path computation
* Improve alias support
* Add alias test
* Update test data
* Remove no services error
* Rename global analyser test
* Add workaround and test for bug in typeutil.Map
* Update test data
* Do not split fully qualified names
* Update typeutil package and remove workaround
* Unify alias/named type handling
* Fix rendering of generic named class aliases
* Fix rendering of array types
* Minor tweaks and cleanups
* Rmove namespaced export construct
* Update test data
* Update binding example
* Break type cycles
* Fix typo in comment
* Fix creation code for cyclic types
* Fix type of variadic params in interface mode
* Update test data
* Fix bad whitespace
* Refactor type assertions inside bound methods
* Update test data
* Rename field application.Options.Bind to Services
* Rename parser package to generator
* Update binding example
* Update test data
* Update generator readme
* Add typescript test harness
* Move test output to new subfolder
* Fix code generation bugs
* Use .js extensions in TS mode imports
* Update test data
* Revert default generator output dir to frontend/bindings
* Bump runtime package version
* Update templates
* Update changelog
* Improve newline handling
---------
Co-authored-by: Andreas Bichinger <andreas.bichinger@gmail.com>
* webkitgtk4.0->webkitgtk4.1
changelog
* Update mkdocs-website/docs/en/changelog.md
* Update deps in pipeline
* Update deps in pipeline
* Install 4.1 only when v3
* Install 4.1 only when v3
---------
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
* Add `port` flag to dev command, ...
Add support for environment variable WAILS_VITE_PORT
* Check if port is already in use
* Update changelog
---------
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
* Unmarshal arguments to appropriate type in binding calls
* Marshal multiple return values to arrays in binding calls
* Improve logging of remote method calls
* Add tests for `BoundMethod.Call`
* Fix return value if error is nil
* Update changelog
---------
Co-authored-by: Andreas Bichinger <andreas.bichinger@gmail.com>
* allow for non-Window WailsEvent listeners
- adds a RegisterListener function on the App struct such
that code can listen for WailsEvent(s) even if it isn't a Window
- rename dispatchEventToWindows -> dispatchEventToListeners
- add all windows and WailsEventListeners to slice before emitting
* Update v3/pkg/application/application.go
---------
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
* Fix: #3270
removes an unnessecary check which returned a double nil wich in turned causes a crash if systray doesn't have an attached window.
* Add iconIsInFlyout method to systray_windows
and use it to determine if the icon is in the
flyout or not when positioning an attached window.
* optimize the windows systray window positioning
we only need to get the systray bounds if
the icon is in the flyout area.
* Use correct behavior for placing the window
if the systray icon is visible in the taskbar the
window should be centered on the systray icon
otherwise the icon is in a flyout are and the
window should be placed in the corner.
Added comments to explain placement logic
* consistent placing of systray menu on right vs left click
* add PR info in changelog
---------
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
* Fix appimage file sourcing
Add findGTKFiles to source webkit files for appimage generation
s
* Update refresh version to fix CPU usage
s
* update changelong
* refresh version up
---------
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
* Fix appimage file sourcing
Add findGTKFiles to source webkit files for appimage generation
s
* Update refresh version to fix CPU usage
s
* update changelong
`linux` suffix means it won't compile on non-Linux platforms.
Shorten the name to avoid:
../../pkg/application/options_webview_window.go:104:8: undefined: LinuxWindow
../../pkg/application/options_application.go:28:8: undefined: LinuxOptions
../../pkg/application/options_webview_window.go:104:8: undefined: LinuxWindow
* Fix computing 'startURL' when 'FRONTEND_DEVSERVER_URL' is present.
* Respect provided URL when computing 'startURL' and 'FRONTEND_DEVSERVER_URL' is present.
* Update changelog.
* Correctly produce absolute URI in 'GetStartURL' when input is provided.
Introduced the ability to clone a menu, along with its submenus, in Linux-based web applications to create a full deep copy. This fixes reusing the application menu for window menus.
This update introduces a LinuxOptions struct for Linux-specific application configurations and refines webview for Linux. The 'windows' map has been renamed to 'windowMap' to avoid confusion. Moreover, a method to unregister Windows has been added to ensure the Linux application automatically quits when the last window closes, unless explicitly disabled in the new LinuxOptions structure. Reset Window position after hiding. Some debug output has been removed.
The commit introduces a set of webview GPU policies to control hardware acceleration. These policies define when hardware acceleration is enabled on the webview. An option for this has been added to the LinuxWindow struct for Linux specific windows. Additional code modification was carried out to use this new GPU policy option when calling `windowNew` function. Finally, the sequence of the GPU Policies in the const declaration has been updated for better readability.
This commit includes the addition of common events for the Linux platform. Refactored and standardized the method receivers for the application from 'm' to 'l'. Also, the application startup events in the window example have been updated according to the new naming scheme.
Introduced the ability to clone a menu, along with its submenus, in Linux-based web applications to create a full deep copy. This fixes reusing the application menu for window menus.
This update introduces a LinuxOptions struct for Linux-specific application configurations and refines webview for Linux. The 'windows' map has been renamed to 'windowMap' to avoid confusion. Moreover, a method to unregister Windows has been added to ensure the Linux application automatically quits when the last window closes, unless explicitly disabled in the new LinuxOptions structure. Reset Window position after hiding. Some debug output has been removed.
The commit introduces a set of webview GPU policies to control hardware acceleration. These policies define when hardware acceleration is enabled on the webview. An option for this has been added to the LinuxWindow struct for Linux specific windows. Additional code modification was carried out to use this new GPU policy option when calling `windowNew` function. Finally, the sequence of the GPU Policies in the const declaration has been updated for better readability.
This commit includes the addition of common events for the Linux platform. Refactored and standardized the method receivers for the application from 'm' to 'l'. Also, the application startup events in the window example have been updated according to the new naming scheme.
* Add option for showing the toolbar in fullscreen mode on macOS
* Add an example demonstrating the ShowToolbarWhenFullscreen option
* Update docs
* Add changelog entry
* Run go mod tidy
* Add JS Window API example
* Add ToggleMaximise button to Window API example
* Restore ToggleMaximise method in Window interface
* Update docs and changelog
Three new options have been introduced in the application options for MacOS to disable the minimize, maximize, and close buttons on the window. Corresponding functionality has been added in the webview window for darwin to handle these new options. These changes have been showcased in the window example main.go file.
This commit introduces the functionality to disable the minimise and maximise buttons on windows. These options have been added to the `application.WebviewWindowOptions` and integrated in the Windows application logic. Effectively, developers can now control the availability of these buttons in their windows applications.
This update adds implementation to several menu item functions, replacing their previous 'not implemented' state. This includes actions for close, reload, forcing reload, toggling of fullscreen, reset zoom, and others. The update also includes modifications for the handling of developer tools toggle under different build configurations. This refactoring is aimed to standardize devtools configuration across different operating systems.
* Fix systray click handling
* Open Menu if no window is attached in defaultClickHandler()
* Remove systemTraySetMenu function
* Fix a crash in hide-window example
* Update changelog
The code update sets the default extension to the first pattern in the save dialog file filter when options.Filters is populated. This improvement applies to Windows platform interface function for 'Save File Dialog' and provides a more intuitive user experience.
This update allows the application shutdown to be cancelled. It implements the shouldQuit function, which can prevent the application from quitting if it returns false. Additional checks have been added to ensure cleanup and quit processes are performed only if required. The darwin delegate and linux and windows applications were modified to include this new functionality.
A new method OnShutdown was introduced to allow adding tasks to be run when the application shuts down. The shutdown tasks are run on the main thread and in the order they were added, with the application option `OnShutdown` being run first. This allows more controlled and managed shutdown of the application.
An option to disable AssetServer logging has been introduced in the application options. This will suppress every request log from the AssetServer if set to true. This adjustment is useful for preventing log saturation in certain scenarios or environments.
The application shutdown process has been significantly reworked to be more efficient and robust. The refactored code removes the event listener for the 'ApplicationTerminate' event. Instead, an in-process flag is added to the 'Quit' method to prevent recursive calls. Additionally, an optional 'OnShutdown' function variable is introduced to allow custom cleanup operations upon app termination.
This commit adds a robust teardown process for windows on application shutdown. It introduces a field to track the destruction state of each window and checks such before performing window operations. Also, it enhances the destroy functions within application for thorough clean up. Finally, redundant event handlers related to application termination were removed while fixing file generating challenge in go tasks.
Without this patch there's a really strange behaviour if there are
multiple windows.
Having two windows with a webview open with an input field.
Focusing the input field on one window, then focusing the input
field on the second one. Then clicking directly on the non client
area of the first one, e.g. to trigger a minimze, the minimize is
not executed until the mouse is getting moved. As long as the
mouse is not moved the event for the click is blocked and not
executed.
Using this new mode fixes that problem, but we need to handle
‘alt+f4’ on our own.
The frontend interaction has been significantly updated, including improvements to the Greet function and the addition of an ongoing time display. Additionally, dependencies in package.json have been updated to their latest versions. Also, redundant print statement was removed from messageprocessor_call.go and changes were made to layout structure and styles in the main.go.tmpl and index.html files.
The Wails runtime has been updated to correctly handle debug checks and the version in the package.json has been bumped to 3.0.0-alpha.6. Fixed reference to global wails object in WML.
* Add Taskfile entry for run:linux, used by task dev
Signed-off-by: Marcus Crane <marcus@utf9k.net>
* Add updated CHANGELOG entry
Signed-off-by: Marcus Crane <marcus@utf9k.net>
* Correct CHANGELOG entry
---------
Signed-off-by: Marcus Crane <marcus@utf9k.net>
* remove 'test' project
* dynamic template list generation
- uses a single fs.Embed to contain all templates
- walks and rebuilds the list of TemplateData using the cached data
- pulls the `description` out of the required `template.json` file in
the template directory
* [v3] template handling update
- move "common" template files to a _common directory
- update generator to render from _common/* first
- render selected template last to overwrite anything provided by
_common if needed
- remove duplicate files from all templates that do not change
* cleanup template project directory after test
* add linux to _common/Taskfile.yaml
* noop: whitespace cleanup _common/Taskfile.yaml
- use unsafe.Pointers for 'signal_connect'
- add handler for 'script-message-received::external'
need to update this to handle older versions of webkit2gtk better
currently removed the ifdef guards (since they don't work in Go code
directly) - need to reimplement using build tags if required.
* add check for GPU device info
* add changelog note
* change return to continue
* Small refactor
---------
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
- disable output of `import <model> from models` line
- update README to generate bindings in usable location for HTML
- update HTML to reference bindings correctly
- update javascript to call and process the bound Greet function
* Fixes doctor bug for apt package manager
* Actually fix it
* Pad the text " all"
Adding a space to ensure checking against "all" doesn't always catch "install" or "not-installed" etc
* Update changelog.md
Doctor Apt Verify
---------
Co-authored-by: atterpac <michael@atterpac.dev>
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
* [v3 linux/systray] dbus generation
* [v3 linux] systemtray dbus implementation
* [v3] add 'id' for MenuSeparator
This is needed in order to have a unique value for all
menuItem(s) such that the Linux implementation doesn't have to
generate new identifiers.
Allowing the reuse keeps a 1-1 mapping in place without any extra effort.
* [v3 example/systray] add radio group to example
* [v3 linux] stub out ExportStatusNotifierItem callbacks
Can only seem to get the `SecondaryActivate` to fire when doing a
3-finger click! I was expecting a right-click interaction to trigger it.
- drop the gtkSignalHandlers map entirely (wasn't used)
- use 'uint' for mapping signal IDs to MenuItem
- store and retrieve the menuitem identifier to/from the menu item widget
Linux requires a `gtk_menu_bar` for a gtk_window to display a menu.
For the `systray` a `gtk_menu` is needed instead.
This change creates the correct type of `impl` for the `Menu`
depending on how it is being used.
The constant x-wails-client-id is generated once on startup and then
sent with each request to the Wails host. It is used primarily by
the server plugin to distinguish different remote sessions.
- remove type assertions
- update contentTypeSniffer to capture the status code
- move logic in ServeHTTP to serveHTTP
- wrap serveHTTP with ServeHTTP adding logging & duration calculation
* [v2, darwin] Add "Hide, Hide Others, Show All“ to appmenu
This also includes shortcuts support for those commands.
Arrange the menu items in the well known MacOS order.
* [v2, darwin] Add Window menu with well known shortcuts Minimize, Full-Screen and Zoom.
This fixes some long-standing inconsistencies between
dev mode builds and production builds but is a breaking
change. Dev mode uses custom scheme for Vite versions >= 3.0.0
and for older it still behaves in the old way.
}else if (result === 'fixed' && committed === 'true') {
message = '## 🔧 Changelog Updated\n\nMisplaced entries were automatically moved to the `[Unreleased]` section. The changes have been committed to this PR.';
}else if (result === 'fixed' || result === 'cannot_fix' || result === 'error') {
'@'+ author + ' Your PR contains changelog entries that were added to already-released versions. These need to be moved to the `[Unreleased]` section.\\n\\n' +
(committed === 'true' ?
'✅ **Auto-fix applied**:The changes have been automatically committed to this PR.' :
'<summary>📝 Click to see the corrected changelog content</summary>\\n\\n'+
'```mdx\\n'+
fixedContent +
'\\n```\\n\\n'+
'</details>\\n\\n'+
'**What happened?** \\n'+
'The validation script detected that you added changelog entries to a version section that has already been released (like `v3.0.0-alpha.10`). All new entries should go in the `[Unreleased]` section under the appropriate category (`### Added`, `### Fixed`, etc.).\\n\\n'+
(committed !== 'true' ? '**Action needed:** Please copy the corrected content from above and replace your changelog file.' :'');
# Trigger the workflow every time you push to the `main` branch
# Using a different branch name? Replace `main` with your branch’s name
push:
branches:[v3-alpha]
# Allows you to run this workflow manually from the Actions tab on GitHub.
workflow_dispatch:
# Allow this job to clone the repo and create a page deployment
permissions:
contents:read
pages:write
id-token:write
jobs:
build:
runs-on:ubuntu-latest
if:github.event.repository.fork == false
steps:
- name:Checkout your repository using git
uses:actions/checkout@v4
- name:Install, build, and upload your site output
uses:withastro/action@v2
with:
path:docs
node-version:20# The specific version of Node that should be used to build your site. Defaults to 18. (optional)
# package-manager: pnpm@latest # The Node package manager that should be used to install dependencies and build your site. Automatically detected based on your lockfile. (optional)
The repository hosts the current Wails tooling in `v3/`, the maintained v2 runtime in `v2/`, and shared assets under `assets/` and `pkg/`. CLI entrypoints live in `v3/cmd/wails3`, while reusable runtime code is grouped under `v3/internal/*` (platform integrations, packaging, templates) and `v3/pkg/*` (application, services, UI helpers). Example applications used for testing and documentation reside in `v3/examples`, with Docker build scripts and harnesses in `v3/test` and targeted regression suites in `v3/tests`. Documentation and site content are stored in `docs/` and `website/`; keep tutorial updates alongside related code changes.
## Build, Test, and Development Commands
Run `task v3:install` to compile and install the v3 CLI locally, and `task v3:precommit` before submitting changes to execute `go test ./...` and apply repository formatters. Use `task v3:test:examples` for a full platform-agnostic build of every example, or scope work with `task v3:test:example:windows DIR=badge` (replace `badge` as needed). Markdown formatting is standardized with `task format:md`, and changelog automation is driven via `task contributors:update` when contributor metadata changes.
## Coding Style & Naming Conventions
Go code must remain `gofmt`-clean with idiomatic package names (lowercase, no underscores) and exported API names following Go's PascalCase. Match existing directory naming by grouping platform-specific code under clearly named packages (e.g., `mac`, `w32`) and keep generator templates in `internal/templates`. Frontend or documentation updates should respect Prettier defaults; run `npx prettier --write "**/*.md"` or the Taskfile wrapper to stay consistent.
## Testing Guidelines
Unit and integration tests accompany Go sources inside the nearest package; add new suites under `v3/tests` for regression coverage. Cross-platform build validation relies on the Taskfile matrix—`task test:examples:all` exercises macOS, Windows, and Linux Docker pipelines, while `task test:example:linux:docker DIR=<name>` verifies a single sample with architecture auto-detection. Prefer deterministic tests and clean up generated binaries (`testbuild-*`) after manual runs.
## Commit & Pull Request Guidelines
Adopt conventional commits recognized by the release tooling (`feat:`, `fix:`, `chore:`, with `!` or `BREAKING CHANGE:` when necessary) so nightly pipelines classify versions correctly. Reference issues or discussion threads in the body, and update `v3/UNRELEASED_CHANGELOG.md` with concise entries under the appropriate heading. Pull requests should summarize scope, list validation commands executed (e.g., `task v3:precommit`), and include platform-specific notes or screenshots for UI-affecting work. Ensure CI passes and that new docs or samples link from the relevant navigation files in `docs/src/content` before requesting review.
This guide provides a technical, developer-focused overview of the Wails v3 codebase located under the `v3` directory. It is the start of a comprehensive series that will later dive into each package and file in detail. For now, it establishes orientation, architecture, responsibilities, and workflows so contributors have a reliable high-level map before we document every component thoroughly.
Scope: Only the `v3` directory is in scope for this guide.
Last updated: 2025-09-24
## Goals of Wails v3
Wails lets you build desktop applications using Go for the backend and web technologies (HTML/CSS/JS) for the frontend, packaging them into a native desktop experience across platforms. Version 3 focuses on modular internal packages, improved runtime and tooling, and clearer boundaries between build-time and run-time responsibilities.
## High-Level Architecture
- Command-line tooling (CLI): developer-facing entry points for building, generating, packaging, and inspecting Wails apps.
- Internal libraries: build orchestration, runtime integration, OS abstractions, packaging, capabilities, templates, and utilities. These are mostly under `v3/internal` and not intended as public API.
- Public Go packages: simple APIs for applications to use (e.g., `v3/pkg/application`, `v3/pkg/ui`, `v3/pkg/services`, etc.).
- Runtime (desktop): the bridge between the Go app and the web frontend, with bindings, window control, events, and platform integrations.
- Examples and tests: reference implementations and validation.
## Directory Map (top-level under v3)
- `cmd/` — CLI entrypoints.
- `wails3/` — The main Wails v3 CLI. Includes `main.go`, usage docs, and a prebuilt binary (when present in repo artifacts).
- `examples/` — Working sample apps demonstrating various capabilities.
- Examples include, among others: drag-and-drop, raw message handling, etc. These show best practices and can be used to validate changes.
- `internal/` — Internal (non-public) packages used by the CLI and by build/runtime components.
- `assetserver/` — Static file serving logic for development or build steps.
- `buildinfo/` — Build metadata and version stamping.
- `capabilities/` — Capabilities gating or feature flags across subsystems.
- `changelog/` — Utilities for changelog parsing/validation.
- `commands/` — Implementation of CLI subcommands and orchestration logic.
- `dbus/` — D-Bus integration for Linux desktop features.
- `test/`, `tests/`, `tooltest/` — Test suites, fixtures, and tools used for verifying functionality.
- `.task/`, `wep/` — Project tooling/configuration directories (to be detailed later as needed).
## Build and Development Overview
- CLI usage: The `v3/cmd/wails3` command is the primary interface. Typical workflows include:
- Project creation via templates (generator).
- Development server and live reload for the frontend (assetserver, runtime dev helpers).
- Building a production bundle and packaging for the target OS (packager).
- Internal packages are not part of the public API contract and may change. Public Go APIs under `v3/pkg/` are maintained for application developers.
- The desktop runtime bridges Go and the Web frontend via a JS/TS runtime (`internal/runtime/desktop/@wailsio/runtime`). This provides window controls, eventing, and invocation bridges to Go.
## Key Data Flows (Conceptual)
1. Developer runs a CLI command (wails3) → CLI delegates to `internal/commands` and uses helpers under `internal/*` for build, generate, package, etc.
2. The application code (using `v3/pkg/*`) defines the Go-side application, services, and event handlers.
3. At runtime, the desktop bridge injects a JS runtime into the web app so frontend can call Go methods and subscribe to events. The Go-side emits events to the frontend via the runtime channel.
4. Packaging uses `internal/packager` to produce OS-native bundles, using OS-specific helpers from `pkg/mac`, `pkg/w32`, etc., as needed.
## Contributing Workflow (High-Level)
- Make small, focused changes. For cross-platform features, ensure Linux, macOS, and Windows implications are considered.
- Run example apps under `v3/examples` to validate changes.
- Use scripts under `v3/scripts` and tasks under `v3/tasks` where applicable (e.g., changelog validation or release workflows).
- When modifying the runtime bridge, ensure TypeScript builds for `@wailsio/runtime` are up-to-date and integration-tested against example apps.
## Next Steps in This Guide
This is the top-level overview. In subsequent iterations, we will deep-dive into every package and file in the `v3` directory with:
- Detailed per-package responsibilities and structure.
- File-by-file documentation including key types, functions, and data flow.
- Build, test, and troubleshooting instructions for each component.
If you need a specific package documented next, please indicate which one, and we’ll start the in-depth coverage there.
# Deep Dive: pkg/application
Scope: This section documents every file under v3/pkg/application and explains the end-to-end data flows for how an application is initialised and then run. It complements the top-level overview above.
Last reviewed: 2025-09-24
Overview of the application package
- Purpose: Provides the public API and core runtime glue for building and running a Wails desktop application. It owns the App type and orchestrates windows, menus, dialogs, system trays, eventing, and platform-specific main loops.
- Key types:
- App: The core application object exposed to developers.
- Window/WebviewWindow: Represents a browser-hosted UI Window (WebView2 on Windows, WKWebView on macOS, WebKitGTK on Linux).
- Managers: Subsystems that manage windows, menus, dialogs, events, clipboard, screens, environment, system trays, etc.
- Options: Configuration used to create the App and its initial windows and services.
- EventProcessor and event contexts: Abstractions for custom events and application/window event flows.
Lifecycle and data flow (initialisation -> run -> shutdown)
1) Construction via New(options)
- File: application.go (New)
- Actions:
- Merge defaults (mergeApplicationDefaults) and normalize Options (application_options.go).
- Construct the App: allocate fields, set logger, prepare asset serving (middleware, asset handlers), store any initial services from options.
- Prepare developer tooling (dev vs production variants in application_dev.go/application_production.go). In dev, static server may proxy to dev server; in production, use bundled assets.
- Defer platform-specific initialization; platform-specific App (platformApp) is created later in Run() via newPlatformApp(...) implemented per-OS.
2) App.init()
- File: application.go (init method on App)
- Actions:
- Create root context (a.ctx) and cancellation function.
- File: application.go (Run -> preRun -> service startup)
- Actions:
- preRun() executes any post-creation hooks (e.g., build/runtime settling, menu prep, assetserver finalization). If this fails, Run aborts.
- Services provided in Options.Services are started in order (startupService). On failure, an error is returned and started services are tracked for orderly shutdown.
4) Platform App creation
- File: application.go (Run)
- Calls newPlatformApp(a) which selects implementation based on GOOS:
- These goroutines run for the lifetime of the app and route messages from the platform layer and WebView bridges into App managers and windows.
6) Final run
- File: application.go (Run)
- Marks a.running = true, drains any a.pendingRun tasks scheduled before the run loop started, sets the application menu (darwin) and icon (if provided), and then calls a.impl.run() which enters the platform event loop (message pump on Windows, CFRunLoop on macOS, GTK main loop on Linux).
- Cancel root context, tear down windows/system trays/menus, stop services in reverse order, and exit the platform loop. Fatal errors use handleFatalError to log and os.Exit(1).
File-by-file guide (v3/pkg/application)
Note: Brief purpose for each file and how it participates in init/run and data flows.
Core App and options
- application.go: Defines App and its lifecycle. Key functions/methods: New, init (method), Run, cleanup, Quit, event and message handlers, Hide/Show, SetIcon, runOrDeferToAppRun. Creates managers and coordinates inter-manager communication via channels and callbacks.
- application_options.go: Defines Options for configuring the App: window defaults, asset options, logger, middlewares, platform-specific options (MacOptions, WindowsOptions, LinuxOptions), and asset server helpers. Contains middleware chaining and helpers for serving assets from fs.FS.
- services.go: Declares Service interface and service lifecycle integration with App (startupService, shutdownServices) and registration via App.RegisterService.
- environment.go / environment_manager.go: Detects and exposes environment info to the app (dev/prod, capabilities, platform variables), often referenced when preparing runtime flags and window defaults.
- errors.go: Error types, including FatalError used by handleFatalError in App.
- panic_handler.go: Centralized panic recovery where goroutines defer handlePanic() to avoid crashing the app silently.
- mainthread*.go: Utilities to ensure code runs on the GUI main thread when required by the OS toolkit; used by platformApp implementations and App.dispatchOnMainThread.
- messageprocessor*.go: Message router between WebView frontend and Go backend; different files focus on different domains (application, window, dialogs, clipboard, context menus, screens, system). They parse inbound messages (e.g., from JS runtime) and call into managers/App methods.
- bindings.go: Handles Go<->JS binding registration and call routing, including returning values/errors to the frontend via WebView.
Platform-specific app implementations
- application_windows.go: windowsApp implements platformApp for Windows. Responsibilities:
- init(): OS integration (DPI awareness, COM init as needed via WebView2 loader), building application menu, creating hidden “application” window for message routing if needed.
- run(): Enters the Windows message loop, dispatches messages to wndProc, and integrates with WebView2 (go-webview2).
- wndProc(): Translates native window messages into Wails events: focus, resize, menu select, accelerator keys, system tray clicks, drag/drop, etc., forwarding into channels consumed by App.Run goroutines.
- setApplicationMenu(), setIcon(), show/hide, registration of windows and system trays.
- logPlatformInfo() and platformEnvironment() provide environment metadata used during startup.
- application_darwin.go and related Objective-C files (.h/.m): darwinApp uses Cocoa and WKWebView. Objective-C delegate files integrate with NSApplication, NSWindow, menus, and app activation policy; bridge callbacks enqueue events into Go channels.
- application_linux.go plus linux_cgo.go/linux_purego.go: GTK-based implementation; CGO variant integrates with GTK main loop and dialogs; purego variant offers a fallback depending on build tags.
- application_dev.go / application_production.go: Build-tagged files that adjust behavior for development vs production (e.g., logger defaults, asset server wiring, runtime flags). logger_dev*.go/logger_prod.go customize logging sinks by target OS and mode.
Windows/macOS/Linux specific helpers
- keys*.go: Keyboard key codes and modifier mappings per OS; used to parse accelerators and handle key bindings.
- Input handling: processKeyBinding and HandleKeyEvent for accelerators; integrates with menu accelerator mappings.
- Messaging bridge: HandleMessage (routes call responses and RPC from JS), DialogResponse/CallResponse, drag-and-drop (HandleDragAndDropMessage), context menus.
- Internal queues: dispatchWindowEvent, isDestroyed checks, destroyed state management.
- webview_window_options.go: Defines WebviewWindowOptions, styling and behavior (title, size, min/max constraints, position, background color, frameless, URL/HTML/Assets, debug flags, dev tools, zoom policy, theme, user agent, drag regions, etc.). Also includes GPU policy and per-OS defaults. Options feed directly into platform window creation.
- webview_window_* per-OS files: Implement webviewWindowImpl for each platform. They translate cross-platform window API to native toolkit calls and send back events via channels (e.g., windowEvents, windowMessageBuffer, windowKeyEvents).
- window.go and window_manager.go: The common Window interface and its manager. The manager tracks windows by ID, exposes Find/All/Focused, and routes broadcast events.
Menus, roles, and accelerators
- menu.go/menu_darwin.go/menu_linux.go/menu_windows.go: Cross-platform Menu representation with platform renderers. Supports app menu (macOS), window menus, and menu bar visibility.
- menuitem.go and family: MenuItem definition, roles, selectors (macOS), per-OS renderers. menuitem_roles.go defines standard roles (Copy, Paste, Quit, etc.).
- roles*.go: Dev vs production role sets.
- popupmenu_windows.go and context_menu_manager.go: Context menu helpers and manager lifecycle.
- key_binding_manager.go: Manages registration of accelerators (e.g., "CmdOrCtrl+Shift+P") and dispatches to window/menu handlers.
Dialogs
- dialogs.go: Cross-platform API for dialogs. Provides MessageDialog, OpenFileDialog, SaveFileDialog with builder-style options; delegates to per-OS implementations via messageDialogImpl/openFileDialogImpl/saveFileDialogImpl.
- dialogs_* per-OS: Bridge to native dialog toolkits (NSAlert/NSSavePanel on macOS, IFileDialog/MessageBox on Windows, GTK dialogs on Linux).
Eventing
- events.go: Custom event system for the application package. Provides:
- CustomEvent (name, data, cancellation) and ApplicationEvent/WindowEvent wrappers with Context() access to typed event contexts.
- EventProcessor to register listeners (On/Once/OnMultiple), hooks, and to Emit events. Safe for concurrent use via sync primitives.
- Bridges to pkg/events for enum types (ApplicationEventType, WindowEventType) used throughout.
- context_application_event.go, context_window_event.go: Define typed context payloads for app/window events passed to listeners (e.g., theme change info, file open URL, window IDs).
- events_common_*.go and event_manager.go: Glue code that maps platform events to high-level events and exposes App.Event API used by apps and internal subsystems.
Miscellaneous utilities
- browser_manager.go: Tracks browser/webview state across windows; used by certain operations that need to coordinate with the web runtime.
- image.go: Image helpers (e.g., RGBA), icons.
- path.go: Small helpers for path normalization when interacting with OS file dialogs or asset paths.
- urlvalidator.go: Validates URLs provided for window content (security and correctness). Unit tests in urlvalidator_test.go.
- single_instance*.go: Optional single-instance enforcement per OS; integrates with platform IPC or file locks.
- systemtray.go: Cross-platform SystemTray API given to app developers; platform-specific implementations in systemtray_*.go.
- clipboard.go: Cross-platform Clipboard API facade; platform-specific glue in clipboard_*.go.
- logger_dev*.go/logger_prod.go: Logging helpers per build mode and OS.
- TODO.md: Notes for maintainers.
Detailed init/run sequence with call graph highlights
- Platform impl may do platform-specific pre-main-loop init in impl.init().
6. Start services: for each options.Service, a.startupService(service) and record for shutdown order.
7. Start event pumps: spin goroutines to drain internal channels and dispatch to managers and windows (see channels list above).
8. Flip a.running = true and execute any pending runnables queued before Run (runOrDeferToAppRun).
9. Apply app-level UI state: set application menu (macOS), set icon if provided.
10. Enter platform loop: return a.impl.run(). From here, the native main loop owns the thread and dispatches native events that are bridged back into Go via callbacks and channels.
- Runtime interactions:
- Window creation: NewWindow(options) constructs a WebviewWindow, invokes platform creation, and registers it with WindowManager and platformApp. Events from native layer (resize, focus, key) become messages in windowEvents/windowMessageBuffer/windowKeyEvents and are dispatched by App handlers to per-window callbacks.
- Dialogs: The public dialog builders call through to per-OS implementations; responses are sent back via DialogResponse/DialogError into the originating Window.
- Menus and accelerators: Menu items with accelerators are registered with KeyBindingManager. Native key events are turned into accelerator strings per-OS (keys_*.go) and routed back to WebviewWindow.processKeyBinding.
- Custom events: App.Event.Emit(CustomEvent) dispatches to registered listeners and also to windows (DispatchWailsEvent) so frontends subscribed via the JS runtime receive them.
- Shutdown:
- Triggered by App.Quit(), window close that results in shouldQuit() returning true, or fatal errors.
- App.cleanup() tears down windows, trays, menus, and services in order; cancels root context; releases native resources via platformApp.destroy().
Data channels and queues (core ones referenced in application.go)
- applicationEvents: carries ApplicationEvent to App.Event handler.
- windowEvents: carries internal windowEvent to App.handleWindowEvent which locates the Window and emits a typed WindowEvent.
- webviewRequests: transports webview asset HTTP requests to the asset server pipeline (headers, middleware, handlers).
- windowMessageBuffer: messages from webview to window (RPC responses, console/log, menu clicks, etc.).
- windowKeyEvents: key accelerator strings per window; processed by WebviewWindow to run actions or menu accelerators.
- windowDragAndDropBuffer: drag-and-drop messages containing filenames and drop-zone details; dispatched to the destination window.
- menuItemClicked: menu item selection IDs enqueued by platform menu handlers and dispatched to Menu manager.
How to trace the flow yourself
- Set breakpoints in application.go Run() and platform newPlatformApp(...) to observe startup.
- On Windows, observe application_windows.go run() and wndProc() to see message dispatch into channels.
- Create a simple Example (see v3/examples) and instrument NewWindow() and WebviewWindow.HandleMessage() to see frontend<->backend calls.
- Enable dev logging (logger_dev*.go) to see debug lines emitted when events and drag-and-drop messages are processed.
Practical usage pattern (developer API surface)
- Create and configure the app:
- app := application.New(application.Options{ /* set windows, assets, menu, services, etc. */ })
- Register services via app.RegisterService(...) before Run().
- Use app.Event.On/Once to register for application events (ApplicationStarted, ThemeChanged, etc.).
- Use window.OnWindowEvent to subscribe to per-window events.
- Use dialogs via application.InfoDialog()/OpenFileDialog()/SaveFileDialog(), etc.
This deep dive should equip you to understand and trace how an application is initialised and run across platforms within the v3/pkg/application package.
- Wails v3 supports two drag-and-drop surfaces when `EnableDragAndDrop` is set: a native window-level file drop channel and HTML drag/drop within the embedded webview. You can see the end-to-end flow in `v3/pkg/application/webview_window_windows.go` (native bridge) and `v3/internal/runtime/desktop/@wailsio/runtime/src/window.ts` (runtime dispatcher).
- Native drops rely on a custom `IDropTarget` implementation that gathers files/coordinates from Win32, pushes them through the Wails event system, and fan out as `events.Common.WindowDropZoneFilesDropped` with enriched context (`DropZoneDetails`, attribute map, coordinates).
- Pure HTML drag/drop (e.g. `v3/examples/html-dnd-api`) is handled entirely by the browser layer; Wails only needs to stay out of the way so standard DOM APIs operate normally.
## Native/Go Pipeline
1. When a window is created with `EnableDragAndDrop`, line ~1948 of `v3/pkg/application/webview_window_windows.go` instantiates `w32.NewDropTarget()` and (optionally) calls `chromium.AllowExternalDrag(false)` to disable WebView2’s built-in file handling.
2. `EnumChildWindows` registers the COM drop target against every current child HWND. The callbacks (`OnEnter`, `OnOver`, `OnLeave`, `OnDrop`) emit Windows-specific events (`events.Windows.WindowDragEnter` etc.) via `w.parent.emit`, so listeners can react even before files are delivered.
3. `DropTarget.Drop` (see `v3/pkg/w32/idroptarget.go:69-140`) extracts filenames from the `IDataObject`, then hands control back to the window impl. Coordinates arrive as screen pixels (`POINT`), so `OnDrop` converts to window-relative coordinates and then calls `convertWindowToWebviewCoordinates` (lines ~1908-1990). Finally `InitiateFrontendDropProcessing` (in `v3/pkg/application/webview_window.go:1484-1515`) formats a JS call: `window.wails.Window.HandlePlatformFileDrop([...], x, y)`.
4. `MessageProcessor` case `WindowDropZoneDropped` (`v3/pkg/application/messageprocessor_window.go:430-488`) decodes the payload that the runtime posts back, wraps it in `DropZoneDetails`, and pushes it through the buffered `windowDragAndDropBuffer`. `App.handleDragAndDropMessage` picks it up and forwards to `WebviewWindow.HandleDragAndDropMessage`, which attaches dropped files + drop-zone metadata to the `WindowEventContext`.
5. The consumer API is the `events.Common.WindowDropZoneFilesDropped` event. The drag-n-drop example shows how to subscribe (`v3/examples/drag-n-drop/main.go:109-158`) and propagate to the frontend via custom events.
## Runtime/JS Behaviour
- `@wailsio/runtime/src/window.ts:538-680` controls the frontend side. `HandlePlatformFileDrop` locates a drop target using `document.elementFromPoint` and `closest([data-wails-dropzone])`; if nothing qualifies it returns early, so native drops that miss a registered dropzone never reach Go.
- The runtime maintains hover styling by tracking `dragenter/over/leave` on `document.documentElement` and toggling `wails-dropzone-hover`. This is how the example achieves live highlighting.
- A legacy helper still exists: `System.HandlePlatformFileDrop` in `@wailsio/runtime/src/system.ts:159-184` marshals a different payload and calls method id `ApplicationFilesDroppedWithContext`, but there is no matching handler in `messageprocessor_application.go`. That means any codepath that invokes it would receive an HTTP 400/500.
- The window runtime bundles `drag.ts`, which manages `--wails-draggable` regions so window dragging/resizing does not swallow pointer events. Developers must ensure dropzones are not also marked draggable.
## Example Insights
- `v3/examples/drag-n-drop/assets/index.html` annotates folders with `data-wails-dropzone` and demonstrates how attributes flow through to Go (`DropZoneDetails.Attributes`). It also shows that the frontend expects `dropX/dropY` in CSS pixels, which helps when validating coordinate transforms.
- `v3/examples/html-dnd-api` confirms standard HTML DnD works without the native bridge; it is a useful regression test when tweaking `drag.ts` so pointer suppression does not break DOM events.
## Potential Bug Hotspots
- **Window-level drops ignored** - `window.ts:554-569` bails if no dropzone is discovered, so the documented `WindowFilesDropped` event never fires. Users expecting “drop anywhere” support lose file payloads entirely.
- **Coordinate scaling** - `convertWindowToWebviewCoordinates` (`webview_window_windows.go:1908-1994`) computes offsets using physical pixels but never converts to WebView2 DIPs. On mixed-DPI or >100% scaling setups, `elementFromPoint` will query the wrong DOM position.
- **Drop target lifecycle** - `EnumChildWindows` runs only once during initialisation. WebView2 can spawn new `Chrome_RenderWidgetHostHWND` instances on navigation or GPU process resets, leaving them unregistered and breaking drops until the app restarts.
- **OLE cleanup** - `DropTarget.Drop` never calls `w32.DragFinish` after `DragQueryFile`. Windows docs recommend doing so to release HDROP resources; skipping it risks leaks on repeated drops.
- **Stale runtime API** - `System.HandlePlatformFileDrop` references a non-existent backend method (`messageprocessor_application.go` lacks case 100). Any future JS that follows the generated docs will fail at runtime.
- **Backpressure risk** - `windowDragAndDropBuffer` (channel size 5) blocks the HTTP handler if event consumers stall. Heavy processing in listeners could cause the runtime call to hang and, on Windows, freeze the drag cursor until the fetch resolves.
## Improvement Opportunities
1. Emit a fallback `WindowFilesDropped` event directly from `DropTarget.OnDrop` when `HandlePlatformFileDrop` declines the payload, preserving drop-anywhere behaviour.
2. Introduce DPI-aware coordinate conversion (use `globalApplication.Screen.PhysicalToDipPoint`) before invoking `elementFromPoint`.
3. Re-run `RegisterDragDrop` whenever a new WebView child window appears (CoreWebView2 `FrameCreated` / `NewBrowserVersionAvailable` callbacks) and on navigation completions.
4. Either wire up the `ApplicationFilesDroppedWithContext` method or remove the `System.HandlePlatformFileDrop` export to avoid misleading integrators.
5. Add integration tests that exercise drops on high-DPI displays and across multiple monitors using the drag-n-drop example as a harness.
6. Consider surfacing drop-target state (e.g., active element id) via diagnostic logging so Windows reports can be correlated without attaching a debugger.
## Open Questions
- Do we need to respect WebView2’s native `AllowExternalDrop(true)` when `EnableDragAndDrop` is disabled, or should we expose both behaviours concurrently?
- How should conflicting CSS states (`--wails-draggable` vs `data-wails-dropzone`) be resolved? Current logic leaves it up to the developer, but documenting or enforcing precedence could prevent accidental suppression.
- Can we guarantee that `elementFromPoint` is safe when overlays or transparent windows are involved, or do we need hit-testing improvements using `elementsFromPoint`?
- Would it be safer to move drop processing entirely to Go (dispatching both window-wide and targeted events) and keep JS solely for hover styling?
This report compiles all drag and drop related issues found in Wails v3 GitHub repository. The issues span across multiple platforms (Windows, macOS, Linux) and various versions of Wails.
---
## Issue #1: [V3] Drag-and-drop broken on Windows since alpha 19
**Title:** [V3] Drag-and-drop broken on windows since alpha 19
**Summary:** Backend drop handler registered with `runtime.OnFileDrop` never gets executed when dropping files on Windows 10, though JavaScript drop events do fire. The event is not being propagated to the backend properly.
**Summary:** Two main issues: 1) WebView fails to set AllowExternalDrag to false, causing WebView to automatically open dragged files. 2) Backend `runtime.OnFileDrop` doesn't work - no events are triggered.
**Reproduction:**
1. Build windows/amd64 app on macOS
2. Move .exe files to Win10 and run
3. Drag and drop files into app window
4. WebView DnD not disabled, backend events not called
**System:** Built on macOS 15.0, tested on Windows 10, Wails v2.9.2
**Summary:** Two issues: 1) When only `EnableFileDrop: true`, every D'n'D triggers an `OnDomReady` event. 2) When `EnableFileDrop: true, DisableWebViewDrop: true`, D'n'D doesn't work at all for files.
**Summary:** When dragging and dropping a file onto the Window, the `OnFileDrop` handler runs successfully, but the entire GUI is replaced with a view of the file if the browser supports it (e.g., images, PDFs). This makes the dropped file unusable as all UI is gone.
**Reproduction:**
1. Enable file dropping and add a simple handler
2. Try and drop an image file with WebKit on Linux
3. Observe the UI get replaced with a view of the image
**Summary:** `OnFileDrop` does not apply the `wails-drop-target-active` class unless `--wails-drop-target: drop` is set directly via the element's `style` attribute, even though the `OnFileDrop` callback does fire.
**Reproduction:**
1. Set up a new wails project
2. Set EnableFileDrop in Application Options
3. Add CSS with `--wails-drop-target: drop` in stylesheet
4. Run app and drag file to target element
5. Base path gets set but element doesn't change styles
**System:** Windows 10/11 Pro, AMD Ryzen 7 5800X3D, Wails v2.10.2
**Note:** Issue was closed on 2025-08-02. Problem was in draganddrop.js using element.style instead of getComputedStyle.
---
## Issue #8: Use a user-agent that is more recognizable by front-end code
**Title:** Use a user-agent that is more recognizable by front-end code
**Summary:** SortableJS (drag-and-drop library) doesn't work properly in Wails' webview because the userAgent doesn't contain standard browser identifiers like 'Safari/605.1.15', causing library detection to fail.
**Reproduction:**
Libraries like SortableJS check userAgent for specific strings ('Edge', 'Firefox', 'Chrome', 'Safari') and fail to work properly when these are not present.
**Summary:** Using vue-virtual-scroller component causes the application to crash on Linux builds, rendering a grey screen and hanging the inspector window. Works fine on Windows and in dev view.
**Reproduction:**
1. Create new wails instance with `wails init -n myproject -t vue-ts`
2. Add vue-virtual-scroller component
3. Create Linux build (`wails build -tags webkit2_41`)
**Summary:** A panic occurs when dropping non-file objects (like strings or browser tabs) into the webview. The application crashes with a nil pointer dereference.
**Reproduction:**
1. Enable DragAndDrop
2. Add a drop target on frontend with `--wails-drop-target`
3. Register a callback with `OnFileDrop((x,y,f) => { console.log(f) }, true)`
4. Drop a Browser Tab onto the element
5. Application panics
**System:** Windows 10 Enterprise, AMD Ryzen 7 PRO 4750U, Wails v2.9.1
**Note:** Issue was closed on 2024-08-18. A simple nil check fix was provided.
---
## Common Patterns Identified:
1. **Platform-specific issues:** Windows has the most reported issues, particularly with events not reaching the backend
2. **Version regression:** Multiple reports indicate v3 alpha 19+ broke drag and drop on Windows
3. **WebView configuration:** Several issues relate to DisableWebViewDrop not working correctly
4. **Cross-platform builds:** Issues when building for Windows on other platforms
5. **Frontend/Backend disconnect:** Common pattern of JavaScript events firing but Go handlers not receiving events
6. **UI replacement on Linux:** Specific issue where dropped files replace the entire UI in WebKit
## Recommendations:
1. Focus on Windows platform issues first as they are most prevalent
2. Investigate the changes in PR #4318 which allegedly broke Windows DnD
3. Review the event propagation mechanism between frontend and backend
4. Test cross-platform builds more thoroughly
5. Improve documentation on DragAndDrop configuration options
10:08:53 [WARN] [starlight-blog-plugin] It looks like you already have a `MarkdownContent` component override in your Starlight configuration.
10:08:53 [WARN] [starlight-blog-plugin] To use `starlight-blog`, either remove your override or update it to render the content from `starlight-blog/overrides/MarkdownContent.astro`.
10:08:54 [content] Syncing content
10:08:54 [WARN] [glob-loader] The base directory "E:\wails\docs\src\content\i18n\" does not exist.
10:08:55 [WARN] [astro-expressive-code] Error while loading code block language "pseudo" in document "E:\wails\docs\src\content\docs\DEVELOPER_GUIDE.md". Using "txt" instead. You can add custom languages using the "langs" config option. Error details: Unknown language "pseudo"
10:08:55 [WARN] [astro-expressive-code] Error while loading code block language "pseudo" in document "E:\wails\docs\src\content\docs\DEVELOPER_GUIDE.md". Using "txt" instead. You can add custom languages using the "langs" config option. Error details: Unknown language "pseudo"
10:08:55 [WARN] [astro-expressive-code] Error while loading code block language "pseudo" in document "E:\wails\docs\src\content\docs\DEVELOPER_GUIDE.md". Using "txt" instead. You can add custom languages using the "langs" config option. Error details: Unknown language "pseudo"
10:08:55 [WARN] [astro-expressive-code] Error while loading code block language "pseudo" in document "E:\wails\docs\src\content\docs\DEVELOPER_GUIDE.md". Using "txt" instead. You can add custom languages using the "langs" config option. Error details: Unknown language "pseudo"
10:08:55 [WARN] [astro-expressive-code] Error while loading code block language "pseudo" in document "E:\wails\docs\src\content\docs\DEVELOPER_GUIDE.md". Using "txt" instead. You can add custom languages using the "langs" config option. Error details: Unknown language "pseudo"
10:08:55 [WARN] [astro-expressive-code] Error while loading code block language "pseudo" in document "E:\wails\docs\src\content\docs\DEVELOPER_GUIDE.md". Using "txt" instead. You can add custom languages using the "langs" config option. Error details: Unknown language "pseudo"
10:08:55 [WARN] [astro-expressive-code] Error while loading code block language "pseudo" in document "E:\wails\docs\src\content\docs\DEVELOPER_GUIDE.md". Using "txt" instead. You can add custom languages using the "langs" config option. Error details: Unknown language "pseudo"
10:08:55 [WARN] [astro-expressive-code] Error while loading code block language "pseudo" in document "E:\wails\docs\src\content\docs\DEVELOPER_GUIDE.md". Using "txt" instead. You can add custom languages using the "langs" config option. Error details: Unknown language "pseudo"