mirror of
https://github.com/wailsapp/wails.git
synced 2026-03-15 15:15:51 +01:00
167 commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
4097aa363b |
feat(v3): add -tags flag to wails3 build command (#4968)
Allow users to pass custom build tags via `wails3 build -tags gtk4` instead of requiring Taskfile modifications. Tags are forwarded as EXTRA_TAGS to platform Taskfiles and appended to the go build command alongside the existing production tag. Works for both native and Docker cross-compilation builds. Closes #4957 Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> |
||
|
|
5dc3e21699 |
feat(linux): GTK4 + WebKitGTK 6.0 support (opt-in via -tags gtk4) (#4958)
* chore: add WebKitGTK 6.0/GTK4 epic and beads issue tracking
Initialize beads (bd) issue tracker with comprehensive epic for
WebKitGTK 6.0 / GTK4 support as the new default for Wails v3 Linux.
Epic: wails-webview2gtk6-t4e (40 tasks)
- GTK4/WebKit6 as default (no build tag needed)
- GTK3/WebKit4.1 via -tags gtk3 for legacy
- Docker container with both library sets for cross-compilation
- Comprehensive test strategy including benchmarks
- task build:linux (GTK4) and task build:linux:gtk3 (legacy)
* feat(linux): add WebKitGTK 6.0 / GTK4 support infrastructure [WIP]
Architecture change for modern Linux desktop support:
- GTK4/WebKitGTK 6.0 is the new DEFAULT (no build tag)
- GTK3/WebKit2GTK 4.1 is LEGACY (requires -tags gtk3)
Changes:
- Add gtk3 build constraint to existing GTK3 CGO files
- Create GTK4 stub implementations (linux_cgo_gtk4.go, application_linux_gtk4.go)
- Create WebKitGTK 6.0 asset server stubs (webkit6.go, request/responsewriter)
Known limitations (documented):
- Window positioning is NO-OP on GTK4/Wayland (protocol limitation)
- Menu system needs GMenu/GAction rewrite (stub only)
- Some methods have TODO markers for full implementation
This establishes the build infrastructure for GTK4 support.
Full implementation requires GTK4 dev environment for testing.
* docs: add implementation tracker for WebKitGTK 6.0/GTK4 work
- Create IMPLEMENTATION.md to track progress, decisions, and API differences
- Update AGENTS.md with instructions to maintain IMPLEMENTATION.md
- Document Phase 1 completion and remaining phases
* feat(linux): update doctor and capabilities for GTK4/WebKitGTK 6.0 support
- Update all 7 package managers (apt, dnf, pacman, zypper, emerge, eopkg, nixpkgs)
to check for GTK4/WebKitGTK 6.0 as primary dependencies
- Mark GTK3/WebKit2GTK packages as optional/legacy
- Add GTKVersion and WebKitVersion fields to Capabilities struct
- Create capabilities_linux_gtk3.go for legacy build path
- Update IMPLEMENTATION.md to mark Phase 2 complete
GTK4 packages are now checked by default. Legacy GTK3 packages
are marked optional and only needed when building with -tags gtk3.
* feat(linux): implement GTK4 window management and event handling
- Add GtkEventController-based event handling for GTK4:
- GtkEventControllerFocus for focus in/out
- GtkGestureClick for button press/release
- GtkEventControllerKey for keyboard events
- Implement window drag/resize using GdkToplevel API
- Add complete drag-and-drop support with GtkDropTarget
- Fix window state detection (minimized, maximized, fullscreen)
- Fix size() to properly return window dimensions in GTK4
- Update IMPLEMENTATION.md to mark Phase 3 complete
GTK4 uses a fundamentally different event model with controllers
instead of direct signal handlers. This commit implements all the
necessary event handling for window management.
* feat(linux): implement GTK4 menu system with GMenu/GAction
Phase 4 of WebKitGTK 6.0/GTK4 implementation.
GTK4 completely replaces the menu system. GTK3's GtkMenu/GtkMenuItem
are replaced by:
- GMenu: Menu model (data structure, not a widget)
- GMenuItem: Individual menu item in the model
- GSimpleAction: Action triggered when menu item is activated
- GSimpleActionGroup: Container for actions, attached to widgets
- GtkPopoverMenuBar: Menu bar widget created from GMenu model
Key changes:
- linux_cgo_gtk4.go: Added C helpers and Go functions for GMenu/GAction
- menuActionActivated() callback for action triggers
- menuItemNewWithId/menuCheckItemNewWithId/menuRadioItemNewWithId
- set_action_enabled/set_action_state for state management
- menu_linux_gtk4.go: GTK4 menu processing (processMenu, addMenuItem)
- menuitem_linux_gtk4.go: GTK4 menu item handling and role menus
- menu_linux.go: Added gtk3 build tag
- menuitem_linux.go: Added gtk3 build tag
Deferred to future work:
- Context menus with GtkPopoverMenu
- Keyboard accelerators with GtkShortcut
* feat(linux): add missing CGO exports for GTK4 asset server
Phase 5 of WebKitGTK 6.0/GTK4 implementation.
The GTK4 CGO file was missing two critical exports that existed in the
GTK3 version:
1. onProcessRequest - Handles WebKit URI scheme requests. This callback
is registered with webkit_web_context_register_uri_scheme and routes
asset requests to the webviewRequests channel for processing.
2. sendMessageToBackend - Handles JavaScript to Go communication. This
is called when JavaScript sends messages via the webkit user content
manager, enabling the IPC bridge.
The asset server files (webkit6.go, request_linux_gtk4.go,
responsewriter_linux_gtk4.go) were already complete from Phase 1.
WebKitGTK 6.0 uses the same URI scheme handler API as WebKitGTK 4.1.
* build(linux): add GTK4 support to Docker and Taskfile
Phase 6 of WebKitGTK 6.0/GTK4 implementation.
Docker containers (Ubuntu 24.04):
- Install both GTK4/WebKitGTK 6.0 (default) and GTK3/WebKit2GTK 4.1 (legacy)
- Build scripts support BUILD_TAGS environment variable
- Default build uses GTK4, BUILD_TAGS=gtk3 uses legacy GTK3
Taskfile targets:
- test:example:linux - Build with GTK4 (default)
- test:example:linux:gtk3 - Build with GTK3 (legacy)
- test:examples:linux:docker:x86_64 - Docker build with GTK4
- test:examples:linux:docker:x86_64:gtk3 - Docker build with GTK3
- test:examples:linux:docker:arm64 - Docker build with GTK4 (ARM64)
- test:examples:linux:docker:arm64:gtk3 - Docker build with GTK3 (ARM64)
This allows testing both the new GTK4 default and legacy GTK3 builds.
* feat(linux): implement GTK4 dialog system with GtkFileDialog and GtkAlertDialog
Phase 8 of WebKitGTK 6.0/GTK4 implementation.
GTK4 completely replaced the dialog APIs. GTK3's GtkFileChooserDialog
and gtk_dialog_run() are deprecated/removed in GTK4.
File Dialogs (GtkFileDialog):
- gtk_file_dialog_open() for single file selection
- gtk_file_dialog_open_multiple() for multiple files
- gtk_file_dialog_select_folder() for folder selection
- gtk_file_dialog_save() for save dialogs
- Filters use GListStore of GtkFileFilter objects
- All operations are async with GAsyncResult callbacks
Message Dialogs (GtkAlertDialog):
- gtk_alert_dialog_choose() with button array
- Configurable default and cancel button indices
- Async response via callback
Implementation:
- Request ID tracking for async callback matching
- fileDialogCallback/alertDialogCallback C exports
- runChooserDialog/runQuestionDialog Go wrappers
- runOpenFileDialog/runSaveFileDialog convenience functions
* feat(linux): implement GTK4 keyboard accelerators for menu items
Add keyboard accelerator support using gtk_application_set_accels_for_action():
- Add namedKeysToGTK map with GDK keysym values for special keys
- Add parseKeyGTK() to convert key names to GDK keysyms
- Add parseModifiersGTK() to convert Wails modifiers to GDK modifier masks
- Add acceleratorToGTK() for full accelerator conversion
- Add setMenuItemAccelerator() Go wrapper calling C helpers
- Integrate accelerator setting in newMenuItemImpl, newCheckMenuItemImpl,
and newRadioMenuItemImpl during menu item creation
- Update setAccelerator() method on linuxMenuItem to use new function
Completes Phase 9 of GTK4 implementation.
* refactor(linux): extract GTK4 C code to separate files and fix WebKitGTK 6.0 API
Extract C code from linux_cgo_gtk4.go to dedicated C files for better
IDE support and maintainability:
- linux_cgo_gtk4.h: Function declarations and type definitions
- linux_cgo_gtk4.c: C implementations for GTK4/WebKitGTK 6.0
WebKitGTK 6.0 API fixes:
- webkit_web_view_new_with_user_content_manager() removed
-> Use create_webview_with_user_content_manager() with g_object_new()
- WEBKIT_HARDWARE_ACCELERATION_POLICY_ON_DEMAND removed
-> Default to ALWAYS (only ALWAYS/NEVER available in 6.0)
- WebKitJavascriptResult replaced with JSCValue in callbacks
-> sendMessageToBackend now receives JSCValue* directly
Also:
- Remove duplicate show()/hide() methods (use shared file)
- Remove duplicate startResize() (wrong signature)
- Add set_app_menu_model() setter for C global variable access
- Fix webview.Scheme reference to use hardcoded 'wails' string
Note: Some pre-existing compilation errors remain in the codebase
that are unrelated to this refactoring.
* fix(linux): resolve GTK4 compilation errors and add missing platform methods
- Add missing App methods: logPlatformInfo, platformEnvironment, fatalHandler
- Add missing linuxApp methods: hide, show, on, isOnMainThread, getAccentColor
- Add missing CGO functions: getPrimaryScreen, openDevTools, enableDevTools, handleLoadChanged
- Fix options.Linux nil check (struct not pointer)
- Fix runSaveFileDialog return type to match interface
- Fix registerWindow signature to accept pointer type
- Fix GdkRGBA to use float instead of double
- Add webview import for asset request handling
- Add sanity check task to Taskfile for quick compilation verification
* fix(linux): resolve GTK3/GTK4 symbol conflict in operatingsystem package
- Add gtk3 build tag to webkit_linux.go to prevent GTK3 linking in GTK4 builds
- Create webkit_linux_gtk4.go with GTK4/WebKitGTK 6.0 pkg-config
- Move app initialization from init() to newPlatformApp() for cleaner setup
- Fixes runtime crash: 'GTK 2/3 symbols detected in GTK 4 process'
* docs: update implementation tracker for GTK3/GTK4 symbol conflict fix
* fix(linux): add GTK4 activation gate to prevent window creation before app activation
GTK4 requires the application to be 'activated' before gtk_application_window_new()
can be called. This adds a synchronization mechanism:
- Add activated channel and sync.Once to linuxApp struct
- Mark application as activated in activateLinux callback
- Wait for activation in WebviewWindow.Run() before creating windows
Fixes SIGSEGV crash when creating windows on GTK4.
* feat(linux): add primary menu style option and fix GTK4 menu issues
- Add LinuxMenuStyle option for MenuBar vs PrimaryMenu (hamburger) display
- Fix menu separators using GMenu sections instead of separator items
- Fix radio button styling with proper string-valued stateful actions
- Fix app not terminating when last window closed
- Fix Window→Zoom to toggle maximize instead of webview zoom
- Add build constraints to .c/.h files for GTK3 compatibility
- Document MenuStyle option in window reference docs
- Update implementation tracker with session changes
* chore(examples): use PrimaryMenu style in menu example
* feat(linux): implement Systray API v2 with smart defaults and window options
- Add smart defaults for systray click behavior:
- Window only: left-click toggles window
- Menu only: right-click shows menu
- Window + Menu: left-click toggles, right-click shows menu
- Add HideOnEscape and HideOnFocusLost window options:
- HideOnEscape: hides window when Escape key pressed
- HideOnFocusLost: hides window on focus lost (auto-disabled on
focus-follows-mouse WMs like Hyprland, Sway, i3)
- Add WebviewWindow.RegisterKeyBinding() public method
- Fix Linux systray handlers:
- Activate() now calls clickHandler (was doubleClickHandler)
- SecondaryActivate() calls rightClickHandler or opens menu
- ItemIsMenu always false to let handlers control behavior
- Add environment_linux.go with compositor detection:
- detectCompositor(), detectFocusFollowsMouse(), isTilingWM()
- Cursor position detection for Hyprland/Sway
- Add comprehensive manual test suite in v3/test/manual/systray/
- window-only, menu-only, window-menu, custom-handlers, hide-options
- Builds for both GTK3 and GTK4
- README with test matrix for different environments
- Update systray-basic example to use new options
* feat: add doctor-ng package with modern TUI for system diagnostics
Introduces a new pkg/doctor-ng package with a clean public API designed
for reuse by both CLI and future GUI tools. Features include:
- Public API types (Report, SystemInfo, Dependency, DiagnosticResult)
- Platform-specific dependency detection (Linux, macOS, Windows)
- Package manager support (apt, dnf, pacman, emerge, eopkg, nixpkgs, zypper)
- Modern TUI using bubbletea/lipgloss with:
- Interactive dependency navigation (j/k keys)
- Install missing dependencies prompt (i key)
- Refresh/rescan capability (r key)
- Non-interactive mode for CI/scripts (-n flag)
The new command is available as 'wails3 doctor-ng' for testing while
the existing 'wails3 doctor' command remains unchanged.
* fix(doctor-ng): stabilize display order, conditional cursor, add copy to clipboard
- Sort platform extras alphabetically to prevent bouncing
- Only show dependency cursor when there are missing deps to act on
- Add 'c' key to copy sanitized report to clipboard
- Update help text to be contextual based on system state
* feat(doctor-ng): add package manager detection for macOS/Windows, remove unused code
- macOS: detect homebrew, macports, nix; show in platform extras
- Windows: detect winget, scoop, choco; show in platform extras
- Remove unused tui/install.go (replaced by tea.ExecProcess)
- Remove unused stateInstall/viewInstall from model.go
- Remove j/k navigation from help (cursor was already removed)
* feat(cli): add wails3 tool capabilities command
Checks system build capabilities via pkg-config:
- GTK4 and WebKitGTK 6.0 availability
- GTK3 and WebKit2GTK 4.1 availability
- Recommends gtk4 or gtk3 based on what's installed
Output is JSON for easy parsing by Taskfile/scripts.
* fix(linux/gtk4): avoid checkptr errors when building with -race
Go's race detector enables checkptr, which flags storing integers
as pointers (a common GLib/C pattern using GINT_TO_POINTER).
Changes:
- Change signal_connect to accept uintptr_t instead of void* for data
- Change enableDND/disableDND to accept uintptr_t instead of gpointer
- Replace unsafe.Pointer(uintptr(id)) with C.uintptr_t(id) in Go code
- Replace g_object_set/get_data for menu item IDs with Go-side map
- Pass 0 instead of nil for unused signal data parameters
This allows building with 'go build -race' for debugging without
triggering 'checkptr: pointer arithmetic computed bad pointer value'
fatal errors.
* fix(examples/dialogs): use window menu for GTK4 compatibility
GTK4 requires menus to be set on windows, not the application.
Use LinuxMenuStylePrimaryMenu to show menu in header bar.
* test(linux): add manual dialog test suite
Comprehensive test programs for GTK4 dialogs:
- message-info, message-question, message-warning, message-error
- file-open, file-open-multi, file-save, file-directory
Each test has multiple test cases accessible via menu.
Use 'go-task build:gtk4' or 'go-task build:gtk3' to build.
* fix(linux/gtk4): fix file dialog hang by not prematurely freeing dialog
GtkFileDialog is async - gtk_file_dialog_select_folder() returns
immediately and the callback fires later. The defer g_object_unref
was freeing the dialog before the user could interact with it.
GTK manages the dialog lifecycle internally for async operations.
* fix: add mutex to protect runtimeLoaded and pendingJS from races
Multiple goroutines access runtimeLoaded and pendingJS concurrently:
- ExecJS reads/writes from window event handlers
- HandleMessage writes when runtime becomes ready
- InitiateFrontendDropProcessing reads/writes during drag-drop
Added pendingJSMutex to synchronize access. Also changed HandleMessage
to copy pending slice before releasing lock to avoid holding it during
InvokeSync calls.
* fix(linux/gtk4): fix dialog deadlock and alert dialog lifecycle
- dialogs_linux.go: Change InvokeAsync to go func() to prevent deadlock
when show() is called - runQuestionDialog uses InvokeAsync internally
and blocks on channel, which deadlocks if caller is also using InvokeAsync
- linux_cgo_gtk4.c: Remove premature g_object_unref from show_alert_dialog
as GtkAlertDialog is async and GTK manages the lifecycle
- linux_cgo_gtk4.c: Add DEBUG_LOG macro for compile-time debug output
(CGO_CFLAGS="-DWAILS_GTK_DEBUG" go build ...)
- linux_cgo_gtk4.c: Handle cancelled-with-no-error case in file dialogs
- linux_cgo_gtk4.go: Fix runQuestionDialog to use options.Title as message
- linux_cgo_gtk4.go: Add default OK button when no buttons specified
* feat(linux/gtk4): implement custom message dialogs with proper styling
GTK4's GtkAlertDialog lacks icon support and visual differentiation.
This implements a custom GtkWindow-based dialog with:
- Escape key triggers cancel button via GtkEventControllerKey
- Enter key activates default button via gtk_window_set_default_widget
- Custom icons from bytes with gtk_image_set_pixel_size (64px max)
- Symbolic icons for info/warning/error/question dialogs
- 300px minimum width for better short message appearance
- Proper memory cleanup via message_dialog_cleanup()
- close-request returns cancel button index or -1
* fix(linux/gtk4): use native size for custom dialog icons
Custom icons now display at their native size.
Built-in symbolic icons remain at 32px as designed.
* fix(linux/gtk4): implement native file drag-and-drop
Use GtkDropControllerMotion and GtkDropTarget with GTK_PHASE_CAPTURE
to intercept file drops before WebKit's internal GtkDropTargetAsync
handler in the bubble phase.
- Add on_drop_accept to filter for GDK_TYPE_FILE_LIST
- Add motion controller for enter/leave/motion events
- Set capture phase so our handlers run before WebKit's
- Both controllers attached to WebKitWebView widget
* docs: update implementation tracker and dialog docs
- Update IMPLEMENTATION.md with GTK4 dialog progress
- Add GTK4 dialog documentation to reference docs
- Fix RLock -> Lock in cleanup to allow window modification
- Simplify manual dialog test menus (remove nested submenus)
* fix(linux/gtk4): parse runtime call params from query string
WebKitGTK 6.0 sends POST data as URL query parameters for custom URI
schemes instead of in the request body. Add fallback to parse object,
method, and args from query params when body is empty.
* fix(linux): fallback to application menu when no window menu set
Windows without an explicit Linux.Menu option now inherit the
application-level menu set via app.Menu.Set().
* fix(linux/gtk4): implement sync clipboard API
GTK4 uses async clipboard operations. Implement clipboard_get_text_sync
which iterates the GLib main context until the async read completes.
This avoids deadlock when called from the main thread (e.g., menu handlers).
* fix(linux/gtk4): DPI scaling and menu duplication fixes
- Implement proper DPI scaling using gdk_monitor_get_scale (GTK 4.14+)
for fractional scaling support on Linux/GTK4
- Calculate PhysicalBounds correctly by multiplying logical coords by scale
- Fix menu items duplicating when creating new windows by adding
processed flag to prevent re-processing menus
- Add safe type assertion helpers in screen example to prevent crashes
- Add CSS to prevent text selection during drag in screen example
- Document tiling WM limitations (Hyprland, Sway, i3) in official docs
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat(tests): add GTK3 vs GTK4 benchmark suite
Add comprehensive benchmark suite for comparing GTK3 and GTK4 performance
in Wails applications. Benchmarks cover:
- Screen enumeration and primary screen query
- Window create/destroy, resize, show/hide operations
- Menu creation (simple, complex, with accelerators)
- Event emit and receive timing
- Dialog setup
Includes comparison tool for side-by-side analysis of results.
Usage:
go build -tags gtk3 -o benchmark-gtk3 .
go build -tags gtk4 -o benchmark-gtk4 .
./benchmark-gtk3 && ./benchmark-gtk4
go run compare.go benchmark-GTK3-*.json benchmark-GTK4-*.json
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat(examples): add WebView API compatibility checker
Cross-platform example that tests and reports which Web APIs are
available in the current WebView engine. Tests 200+ APIs across
categories:
- Storage (localStorage, IndexedDB, Cache API, File System)
- Network (Fetch, WebSocket, WebTransport, SSE)
- Media (Web Audio, MediaRecorder, Speech APIs)
- Graphics (Canvas, WebGL, WebGL2, WebGPU)
- Device (Geolocation, Sensors, Bluetooth, USB, Serial)
- Workers (Web Workers, Service Workers, Shared Workers)
- Performance (Observers, Timing APIs)
- Security (Web Crypto, WebAuthn, Credentials)
- UI/DOM (Custom Elements, Shadow DOM, Clipboard)
- CSS (CSSOM, Container Queries, Modern Selectors)
- JavaScript (ES Modules, BigInt, Private Fields)
Useful for understanding API availability differences between:
- WebKitGTK (Linux) vs WebView2 (Windows) vs WKWebView (macOS)
- GTK3/WebKit2GTK 4.1 vs GTK4/WebKitGTK 6.0
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat(examples): add Web API examples demonstrating browser capabilities
Add 15 interactive Web API examples in v3/examples/web-apis/:
- Storage: localStorage, IndexedDB
- Network: Fetch API, WebSocket
- Media: Canvas 2D, WebGL, Web Audio
- Device: Geolocation, Clipboard, Fullscreen
- Security: WebCrypto
- Notifications API
- Workers: Web Workers
- Observers: Intersection Observer, Resize Observer
Each example includes an interactive demo with API documentation
and feature detection to help developers understand what's
available in WebView environments.
Also updates webview-api-check with autorun support for
automated API compatibility testing.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat(examples): add 26 more Web API examples
Expand web-apis examples from 15 to 41 total, covering:
Storage: sessionStorage, Cache API, Page Visibility
Network: XMLHttpRequest, EventSource (SSE), Beacon API
Media: MediaDevices, MediaRecorder, Speech Synthesis
Device: Device Orientation, Vibration, Gamepad
Performance: Performance API, Mutation Observer
UI/DOM: Web Components, Pointer Events, Selection, Dialog
Messaging: Drag and Drop, Broadcast Channel, History API
Data: Streams, File API, Blob, Share, Permissions
Each example includes interactive demos, API detection,
and follows the consistent dark-themed styling pattern.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* docs: update changelog with full web-api examples count
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* refactor(examples): simplify beacon demo with local server
Replace the complex beacon demo with a simpler version that includes:
- Local HTTP server on port 9999 that receives beacon data
- Go service to retrieve and display received beacons
- Quick buttons for common beacon types (pageview, click, error, timing)
- Live display of received beacon data with auto-refresh
- Clear explanation of how the demo works
This makes the demo more educational by showing both the sending
and receiving sides of the Beacon API.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* refactor(examples): streamline beacon demo UI
Revert to original standalone implementation with httpbin.org endpoint
but with a compact two-column layout that fits without scrolling:
- Left: endpoint config, data type selector, data input, example buttons
- Right: stats (sent/queued/failed/bytes), auto-unload option, event log
Features retained: String/JSON/FormData/Blob data types, analytics/error/
timing examples, auto-beacon on page unload.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* refactor(examples): streamline blob demo with tabbed layout
Redesign blob demo to fit without scrolling using:
- Three-column layout: Create | Stored Blobs | Output
- Tabbed interface for blob creation (Text/JSON/Binary/SVG)
- Compact blob list with download and delete actions
- Operations panel for conversions and slicing
- Feature badges showing API support status
Reduced from 846 lines to 349 lines while keeping core functionality.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix(examples): fix dropdown styling in blob demo
Style select option elements with dark background to match theme.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat(examples): add MDN links to demo titles
Link API names in titles to their MDN documentation pages.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* refactor(examples): streamline broadcast-channel with Wails windows
Redesign broadcast-channel demo for Wails environment:
- Replace browser tabs with Wails windows via WindowService
- Compact two-column layout: Channel/Send | Messages
- "Open New Window" button creates new Wails window
- Each window gets unique ID for message tracking
- Join/leave notifications when windows open/close
- Quick message buttons, ping all, stats display
- MDN link in title
Reduced from 737 lines to 245 lines.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix(examples): simplify broadcast-channel to use multiple app instances
Remove WindowService that required generated bindings. Instead, instruct
users to run multiple instances of the app to test cross-window messaging.
BroadcastChannel API works across windows of the same origin.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat(examples): add API feature badges to broadcast-channel demo
Show supported features: BroadcastChannel, postMessage, close,
onmessage, onmessageerror, MessageChannel - consistent with other demos.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat(examples): add multi-window support to broadcast-channel demo
Use Wails runtime.js and WindowService to open new windows for
cross-window BroadcastChannel API testing. Streamlined UI with
feature detection badges and MDN link.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat(linux): make GTK4 opt-in via -tags gtk4, keep GTK3 as default
This change inverts the build tag logic so that:
- GTK3/WebKit2GTK 4.1 is the stable default (no tag required)
- GTK4/WebKitGTK 6.0 is experimental opt-in via `-tags gtk4`
This allows the branch to be merged into v3-alpha without breaking
existing apps, while enabling early adopters to test GTK4 support.
Changes:
- Updated 20 Go files: `gtk3` → `!gtk4`, `!gtk3` → `gtk4`
- Updated IMPLEMENTATION.md to reflect new build strategy
- Updated benchmark README with correct build commands
- Added GTK4_FEEDBACK_ISSUE.md template for community testing
- Added Armaan's signing guide link to docs
Build commands after this change:
go build ./v3/... # GTK3 (default)
go build -tags gtk4 ./v3/... # GTK4 (experimental)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* refactor(linux): rename capabilities files to follow naming convention
Renamed for consistency with other GTK3/GTK4 file pairs:
- capabilities_linux.go (default, GTK3)
- capabilities_linux_gtk4.go (opt-in, GTK4)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat(linux/gtk4): add experimental notice with feedback issue link
When building with -tags gtk4, the app now displays a notice at startup
directing users to the feedback issue for reporting problems.
Issue: https://github.com/wailsapp/wails/issues/4957
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* ci(linux): add GTK4 testing for webkit-gtk6-support branch
- Fix box alignment in experimental notice
- Add GTK4 dependency installation for this branch only
- Run Go tests with both default (GTK3) and -tags gtk4
- Build examples with both GTK versions
- Build templates with both GTK versions
The GTK4 tests only run when PR source branch is feature/webkit-gtk6-support.
This ensures existing PRs are not affected while enabling full GTK4 CI coverage.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix(doctor): make GTK3 primary, GTK4 experimental in package checks
Updated all 7 package managers to match new build tag strategy:
- GTK3/WebKit2GTK 4.1 → primary (required for default builds)
- GTK4/WebKitGTK 6.0 → optional/experimental (for -tags gtk4)
Affected: apt, dnf, pacman, zypper, emerge, eopkg, nixpkgs
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* docs(dialogs): fix GTK3/GTK4 documentation to reflect default behavior
GTK3 is the default, GTK4 is opt-in via -tags gtk4. Updated the dialogs
documentation to clarify this instead of suggesting GTK3 is opt-in.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix(examples): escape HTML in web-apis examples to prevent DOM XSS
Add escapeHtml() helper function and escape all user-controlled or
dynamic values before inserting them into innerHTML to address CodeQL
security alerts.
Files fixed:
- beacon: escape log type, message, and class names
- eventsource: escape time and type in log entries
- file-api: escape file name, size, and type
- mediadevices: escape time, type, and message in log entries
- selection: escape text content before applying highlight regex
- share: escape file name, size, and type in file list
- speech-synthesis: escape time, type, and message in log entries
- web-components: escape title and color in shadow DOM template
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix(linux): correct GTK4 build tags and Taskfile for GTK3 default
- Fix build tags in linux_cgo_gtk4.c and linux_cgo_gtk4.h from
`!gtk3` to `gtk4` to match the Go file constraints
- Update Taskfile.yaml to reflect GTK3 as default, GTK4 as opt-in
- Rename test:example:linux:gtk3 to test:example:linux:gtk4
- Comment out GTK4 tests in test:examples since CI doesn't have GTK4 deps
This fixes the CI failure where GTK4 C files were being compiled
by default due to incorrect build constraints.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix(systemtray): add missing defaultClickHandler method
Add the defaultClickHandler method that was in v3-alpha but not
properly merged. This method is called from systemtray_darwin.go
when handling tray icon clicks.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix(tests): add linux build constraint to gtk4-benchmark
The gtk4-benchmark test is Linux-only but was missing a build
constraint on main.go, causing build failures on macOS/Windows.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* ci(linux): skip hanging GTK4 service tests in CI
The service startup/shutdown tests hang in GTK4 CI environment due to
display initialization issues with xvfb. Skip these specific tests for
now while keeping other GTK4 tests running.
Skipped tests:
- TestServiceStartup
- TestServiceShutdown
- TestServiceStartupShutdown
The *Error variants of these tests still run as they fail fast before
the hang occurs.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* ci(linux): skip all service tests for GTK4 in CI
All service tests hang in GTK4 CI because they require a fully
functional GTK4 display that xvfb cannot provide. Skip all tests
matching "TestService" pattern.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* ci(linux): remove unsupported GTK4 template build test
The wails build command doesn't support the -tags flag yet.
GTK4 compilation is already verified by Go tests, so this
additional template build step is not necessary.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Fix Copilot review feedback on PR #4958
- Use JSON.stringify() for onclick handlers in storage examples to safely
handle keys with quotes (sessionstorage, localstorage)
- Guard DeviceOrientationEvent check to prevent ReferenceError on
unsupported browsers (device-orientation)
- Add type assertion check for Bounds to prevent panic on malformed
JSON (screens.go)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
|
||
|
|
284c67d037 |
perf(ci): use native ARM64 runner for linux/arm64 builds
Use ubuntu-24.04-arm runner for linux/arm64 cross-compile tests instead of QEMU emulation. This should reduce build time from ~20min to ~3min. - Remove QEMU and Buildx setup (not needed with native runner) - Remove --platform flag from Docker commands - Each matrix entry now specifies its runner Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> |
||
|
|
2db6a1c427 |
feat(v3): Support for Icon Composer Liquid Glass Icons (macOS) (#4934)
* feat(icons): implement Mac asset (.car) generation with actool - Check actool version >= 26 requirement - Generate asset.car from Icon Composer input - Validate compilation output and cleanup temp files * Wails Icon as Icon Composer file * a generated assets.car from the wails icon * handle absolute paths correctly in actool command - Check if paths are absolute before prepending "./" - Use filepath.Join for temp.plist path construction * add test for Assets.car generation * Skipping Asset.car generation and test on non mac-systems * add CFBundleIconName generation to plist, if Assets.car exists * also create .icns from .icon-File and use always absolut path Use absolut path, because otherwise we got strange behavior from actool. * update to use appicon as CFBundleIconName and optionally use the name from config * update the Taskfiles * remove log prints * the awesome new LiquidGlass icon files * update doc * Update UNRELEASED_CHANGELOG.md * Update UNRELEASED_CHANGELOG.md * fix security bug * Skip icon generation test with actool on CI * fix error from coderabbitai * solved the coderabbitai nitpicks * fix coderabbitai findings * Update changelog --------- Co-authored-by: Lea Anthony <lea.anthony@gmail.com> |
||
|
|
7e74a5d9d0 |
fix(build): use QEMU emulation for Linux cross-arch builds
For Linux ARM64 builds on x86_64 hosts, use Docker's QEMU emulation instead of trying to cross-compile with Zig or install multi-arch packages. Changes: - Workflow: Set up QEMU and Docker Buildx for Linux cross-arch builds - Workflow: Build Docker image with --platform for target architecture - Dockerfile: Simplify to use native GCC (QEMU handles arch translation) - Taskfile: Add --platform flag to docker run for Linux builds This approach is slower but reliable and doesn't require complex cross-compilation toolchain setup. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> |
||
|
|
d9348686dc |
fix(build): use proper cross-compilation toolchain for Linux ARM64
Instead of trying to use Zig for Linux cross-compilation (which has glibc header compatibility issues), install the proper aarch64-linux-gnu cross-compilation toolchain and ARM64 GTK/WebKit libraries. Changes: - Enable multi-arch and install gcc-aarch64-linux-gnu toolchain - Install ARM64 versions of libgtk-3-dev and libwebkit2gtk-4.1-dev - Set PKG_CONFIG_PATH for ARM64 libraries when cross-compiling - Use aarch64-linux-gnu-gcc as the cross-compiler Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> |
||
|
|
e6bf084197 |
fix(build): use Zig for Linux cross-arch compilation in Docker
Add Zig CC wrappers for Linux ARM64 and AMD64 targets. The build script now detects if host architecture matches target architecture: - If match: use native GCC (faster, better optimization) - If different: use Zig for cross-compilation This allows building Linux ARM64 binaries from an x86_64 Docker host without requiring multi-arch images or QEMU emulation. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> |
||
|
|
985ce8deed |
fix(build): remove --platform flag from Linux cross-compile Docker
The wails-cross image is an x86_64 image that uses Zig for cross-compilation. It doesn't need to run ON the target platform - it cross-compiles TO it. Remove the --platform flag that was causing Docker to try pulling a non-existent arm64 version of the image. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> |
||
|
|
d5cd33d4fb |
fix(build): use Docker for cross-arch Linux compilation
When building Linux binaries with a different target architecture than the host (e.g., arm64 on x86_64), use Docker-based cross-compilation instead of native build. The native GCC cannot compile ARM64 assembly on an x86_64 host. Adds a third condition to the build task selection: target architecture must match host architecture to use native build. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> |
||
|
|
70c969bf3b |
feat(build): use GCC for Linux cross-compilation
- Switch from Alpine to Debian (golang:1.25-bookworm) - Install GTK3/GTK4 and WebKit2GTK 4.1/6.0 dev packages - Use native GCC for Linux targets instead of Zig - Add --platform flag to Docker run for architecture matching - Remove unused zcc-linux-* wrappers (Zig had glibc header issues) - Keep Zig for Darwin (macOS SDK) and Windows (bundled mingw) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> |
||
|
|
f91b8cfeb1 |
feat: support ARM64 hosts in cross-compiler Docker image
Add TARGETARCH detection to download the correct Zig binary for the host architecture (aarch64 vs x86_64). This enables native performance on Apple Silicon Macs instead of requiring emulation. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> |
||
|
|
9a363d7be5 |
feat(v3): add server mode for headless HTTP deployment (#4903)
* feat(v3): add server mode for headless HTTP deployment Server mode allows Wails applications to run as pure HTTP servers without native GUI dependencies. Enable with `-tags server` build tag. Features: - HTTP server with configurable host/port via ServerOptions - WAILS_SERVER_HOST and WAILS_SERVER_PORT env var overrides - WebSocket event broadcasting to connected browsers - Browser clients represented as BrowserWindow (Window interface) - Health check endpoint at /health - Graceful shutdown with configurable timeout - Docker support with Dockerfile.server template and tasks Build and run: wails3 task build:server wails3 task run:server wails3 task build:docker wails3 task run:docker Documentation at docs/guides/server-build.mdx Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat(v3): add server mode for headless HTTP deployment Server mode allows Wails applications to run as pure HTTP servers without native GUI dependencies. Enable with `-tags server` build tag. Features: - HTTP server with configurable host/port via ServerOptions - WAILS_SERVER_HOST and WAILS_SERVER_PORT env var overrides - WebSocket event broadcasting to connected browsers - Browser clients represented as BrowserWindow (Window interface) - Health check endpoint at /health - Graceful shutdown with configurable timeout - Docker support with Dockerfile.server template and tasks Build and run: wails3 task build:server wails3 task run:server wails3 task build:docker wails3 task run:docker Documentation at docs/guides/server-build.mdx Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: address CodeRabbit review comments - Fix corrupted test file with embedded terminal output - Fix module name mismatch in gin-routing (was gin-example) - Fix replace directive version mismatch in gin-service - Fix placeholder module name in ios example (was changeme) - Fix Dockerfile COPY path to work from both build contexts - Fix bare URL in README (MD034 compliance) - Fix comment accuracy in getScreens (returns error, not empty slice) - Remove deprecated docker-compose version field - Add port documentation in Taskfile template Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: address CodeRabbit review comments - Add note about healthcheck wget not being available in distroless images - Add !server build constraint to menu_windows.go and menu_darwin.go - Downgrade window-visibility-test go.mod from 1.25 to 1.24 to match CI Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> |
||
|
|
ee7e95af52 |
fix(v3): fix macOS mkdir brace expansion when APP_NAME contains spaces (#4850)
fix(v3): fix macOS mkdir when APP_NAME contains spaces
Replace brace expansion {MacOS,Resources} with two separate mkdir commands.
Brace expansion doesn't work inside quoted strings and is shell-dependent.
Adds integration test to verify mkdir works with spaces in paths.
|
||
|
|
0b6dfe032c |
Improve Build Commands to Accommodate Spaces (#4845)
* fix: improve darwin build commands to accommodate spaces in APP_NAME * fix: improve android build commands to accommodate spaces in APP_NAME * fix: improve ios build commands to accommodate spaces in APP_NAME * fix: improve linux build commands to accommodate spaces in APP_NAME * fix: improve windows build commands to accommodate spaces in APP_NAME * docs: update `v3/UNRELEASED_CHANGELOG.md` * fix(docs): correct changelog * fix: remove quotes around GO_CACHE_MOUNT and REPLACE_MOUNTS --------- Co-authored-by: Lea Anthony <lea.anthony@gmail.com> |
||
|
|
cee729dd85 |
fix(v3): resolve some issues in template code when compiling macOS program on Linux (#4832)
* fix(v3): resolve Docker error "undefined symbol: ___ubsan_handle_xxxxxxx" when running 'wails3 build GOOS=darwin GOARCH=arm64' on Linux * fix(v3): correct command argument error when executing 'build:universal:lipo:go' task on Linux * docs(v3): update changelog * Fix CHANGELOG * Fix CHANGELOG --------- Co-authored-by: Lea Anthony <lea.anthony@gmail.com> |
||
|
|
ab33eb594e |
docs: fix custom protocol association documentation (#4825)
* docs: fix custom protocol association documentation
The documentation was incorrectly referencing `wails.json` with JSON format
when the actual configuration file is `build/config.yml` using YAML format.
Changes:
- Update config file reference from `wails.json` to `build/config.yml`
- Change format from JSON to YAML in code examples
- Fix structure: `protocols` is at root level, not nested under `info`
- Correct template variable references from `{{.Info.Protocols}}` to `{{.Protocols}}`
- Update Info.plist example to show actual generated format (`wails.com.scheme`)
- Add note about running `wails3 task common:update:build-assets` after changes
- Clean up redundant file path references in platform-specific sections
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* docs: consolidate custom protocol docs and add Universal Links
- Remove duplicate custom-protocol-association.mdx
- Add Universal Links section to macOS tab
- Add Web-to-App Linking section to Windows tab
- Keep the more comprehensive distribution/custom-protocols.mdx
Addresses review comment about duplicate documentation.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat(windows): add custom protocol support to MSIX packaging
- Add uap3 namespace and protocol extension to MSIX template
- Protocols defined in build/config.yml are now automatically
registered when building MSIX packages
- Update docs with MSIX section and clarify Web-to-App linking
requires manual manifest configuration
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
|
||
|
|
84b9021ea9 |
docs: Update dialogs documentation to match actual v3 API (#4793)
* All the documentation files have been updated. Here's a summary of the changes I made:
## Summary of Documentation Updates
### Key API Corrections Made:
1. **Dialog Creation**:
- Changed `app.InfoDialog()` → `application.InfoDialog()` (package-level functions)
- Also documented `app.Dialog.Info()` via DialogManager
2. **Question Dialog Buttons**:
- Removed non-existent `SetButtons("Save", "Don't Save", "Cancel")` method
- Now uses `AddButton("label")` which returns a `*Button`
- Button callbacks via `button.OnClick(func() { ... })`
3. **Default/Cancel Buttons**:
- Changed `SetDefaultButton("Cancel")` (string) → `SetDefaultButton(cancelBtn)` (`*Button`)
- Changed `SetCancelButton("Cancel")` (string) → `SetCancelButton(cancelBtn)` (`*Button`)
- Also documented fluent `SetAsDefault()` and `SetAsCancel()` methods on Button
4. **File Dialog Filters**:
- Changed `SetFilters([]application.FileFilter{...})` → `AddFilter("Display Name", "*.ext;*.ext2")`
5. **Save Dialog Filename**:
- Changed `SetDefaultFilename()` → `SetFilename()`
6. **Folder Selection**:
- Removed non-existent `app.SelectFolderDialog()`
- Now uses `application.OpenFileDialog().CanChooseDirectories(true).CanChooseFiles(false)`
7. **Show() Return Value**:
- Removed incorrect `result, err := dialog.Show()` pattern
- `Show()` returns nothing - responses are handled via button callbacks
### Files Modified:
- `docs/src/content/docs/features/dialogs/message.mdx` - Complete rewrite of question dialog examples
- `docs/src/content/docs/features/dialogs/overview.mdx` - Updated all code examples
- `docs/src/content/docs/features/dialogs/file.mdx` - Updated file dialog examples
- `v3/UNRELEASED_CHANGELOG.md` - Added changelog entry
* All changes are complete. Here's a summary of what was updated:
## Summary
I've updated the Wails v3 dialogs documentation to match the actual API. The documentation now consistently uses:
### DialogManager Pattern (Recommended)
- `app.Dialog.Info()`, `app.Dialog.Question()`, `app.Dialog.Warning()`, `app.Dialog.Error()`
- `app.Dialog.OpenFile()`, `app.Dialog.SaveFile()`
This is consistent with other runtime features like `app.Window`, `app.Event`, etc.
### Key API Corrections
1. **Dialog Creation**: Both `app.Dialog.*()` (DialogManager) and `application.*Dialog()` (package-level) are documented
2. **Question Dialog Buttons**: Use `AddButton("label")` which returns `*Button`, then `button.OnClick(callback)`
3. **Default/Cancel Buttons**: `SetDefaultButton(button)` and `SetCancelButton(button)` take `*Button` pointers
4. **File Filters**: Use `AddFilter("Display Name", "*.ext")` instead of `SetFilters()`
5. **Save Dialog Filename**: Use `SetFilename()` instead of `SetDefaultFilename()`
6. **Folder Selection**: Use `app.Dialog.OpenFile().CanChooseDirectories(true).CanChooseFiles(false)`
### Files Modified
- `docs/src/content/docs/features/dialogs/overview.mdx`
- `docs/src/content/docs/features/dialogs/message.mdx`
- `docs/src/content/docs/features/dialogs/file.mdx`
- `v3/UNRELEASED_CHANGELOG.md`
* Audit complete! All documentation files now consistently use `app.Dialog.*` for all code examples. Here's the summary:
## Audit Complete
All dialog documentation has been updated to consistently use the `app.Dialog.*` pattern:
### Changes Made:
**message.mdx:**
- All examples now use `app.Dialog.Info()`, `app.Dialog.Question()`, `app.Dialog.Warning()`, `app.Dialog.Error()`
- Function signatures updated to accept `app *application.App` parameter
- Nested dialog calls within callbacks also updated
**file.mdx:**
- All examples now use `app.Dialog.OpenFile()`, `app.Dialog.SaveFile()`
- Function signatures updated to accept `app *application.App` parameter
- All error/info dialogs within file operations also updated
**overview.mdx:**
- Already consistent from earlier edits
### Documentation Structure:
Each file now properly documents both approaches in a dedicated section:
```go
// Via DialogManager (recommended when you have an app instance):
app.Dialog.Info()
app.Dialog.OpenFile()
// Package-level functions (useful in callbacks or when app isn't in scope):
application.InfoDialog()
application.OpenFileDialog()
```
But all code examples use the `app.Dialog.*` pattern for consistency with other runtime features like `app.Window`, `app.Event`, etc.
* docs: Fix reference/dialogs.mdx and reference/application.mdx API documentation
Updated docs to match actual Wails v3 Dialogs API:
- reference/dialogs.mdx: Complete rewrite with correct API
- Use `app.Dialog.OpenFile()` and `app.Dialog.SaveFile()` instead of `app.OpenFileDialog()`
- Use `AddFilter("name", "pattern")` instead of `SetFilters([]FileFilter{...})`
- Use `SetFilename()` instead of `SetDefaultFilename()`
- Use `SetDirectory()` instead of `SetDefaultDirectory()`
- Remove non-existent `SelectFolderDialog()` - use `OpenFile().CanChooseDirectories(true).CanChooseFiles(false)`
- Use `AddButton()` with callbacks instead of `SetButtons()`
- Use `SetDefaultButton(*Button)` instead of `SetDefaultButton(int)`
- Document that `Show()` returns nothing, use callbacks
- reference/application.mdx: Fix Dialog Methods section
- Use `app.Dialog.*` manager pattern
- Show correct Question dialog with button callbacks
- Fix file dialog examples with `AddFilter()`
- Remove `SelectFolderDialog()` reference
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* docs: Remove package-level dialog function references
Remove all references to package-level dialog functions
(application.InfoDialog(), application.OpenFileDialog(), etc.)
from documentation. Only the app.Dialog manager pattern
should be used.
Updated files:
- reference/dialogs.mdx
- features/dialogs/overview.mdx
- features/dialogs/message.mdx
- features/dialogs/file.mdx
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* refactor: Remove package-level dialog functions in favor of app.Dialog manager
BREAKING CHANGE: Remove package-level dialog functions. Use app.Dialog manager instead.
Removed functions:
- application.InfoDialog()
- application.QuestionDialog()
- application.WarningDialog()
- application.ErrorDialog()
- application.OpenFileDialog()
- application.SaveFileDialog()
Use the Dialog manager pattern instead:
- app.Dialog.Info()
- app.Dialog.Question()
- app.Dialog.Warning()
- app.Dialog.Error()
- app.Dialog.OpenFile()
- app.Dialog.SaveFile()
This aligns dialogs with other runtime managers like app.Window and app.Event.
Updated files:
- v3/pkg/application/application.go - Remove exported dialog functions
- v3/pkg/application/dialog_manager.go - Use internal newMessageDialog/newOpenFileDialog
- v3/pkg/application/messageprocessor_dialog.go - Use internal dialog constructors
- v3/examples/* - Update all examples to use app.Dialog pattern
- v3/internal/commands/appimage_testfiles/main.go - Update test file
- v3/UNRELEASED_CHANGELOG.md - Document breaking change
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: Use application.Get() in dialogs-basic example and correct filter docs
- Update dialogs-basic helper functions to use application.Get() instead
of passing app through function parameters
- Fix incorrect documentation claiming space/comma delimiters work for
filter patterns (only semicolons are supported)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
|
||
|
|
41ba4e7d11 |
feat(linux): generate .desktop file during build (#4575) (#4780)
* ## Summary I've implemented the fix for issue #4575. Here's what was changed: ### Changes Made **File: `v3/internal/commands/build_assets/linux/Taskfile.yml`** 1. Added `generate:dotdesktop` as a dependency to `build:native` task (line 45) 2. Added `generate:dotdesktop` as a dependency to `build:docker` task (line 63) This ensures that the `.desktop` file is generated during every Linux build (both native and Docker-based), not just during packaging operations. ### How it works - When running `wails build` or `wails dev` on Linux, the build process now automatically generates a `.desktop` file at `build/linux/<app-name>.desktop` - The `.desktop` file contains: - Application name - Executable path - Icon reference - Categories (defaulting to "Development") - This allows Linux desktop environments to properly display the application icon and metadata even during development ### Testing To test the changes: 1. Create a new Wails v3 project: `wails3 init -n testapp` 2. Build it: `cd testapp && wails3 build` 3. Verify the `.desktop` file exists: `cat build/linux/testapp.desktop` Would you like me to run a test or make any additional changes? * feat(linux): generate .desktop file during build (#4575) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
e0cd24272c |
fix(linux): auto-detect and handle .relr.dyn sections for AppImage builds (#4772)
Modern Linux distributions (Arch, Fedora 39+, Ubuntu 24.04+) compile libraries with .relr.dyn ELF sections. The bundled strip binary in linuxdeploy cannot process these sections, causing AppImage builds to fail. This commit: - Adds hasRelrDynSections() to proactively detect modern toolchains - Automatically disables stripping (NO_STRIP=1) when detected - Fixes error output to properly display as string - Adds documentation explaining the issue and workaround Fixes #4642 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> |
||
|
|
38c89e06b5 |
Revert "fix(linux): auto-detect and handle .relr.dyn sections for AppImage builds"
This reverts commit
|
||
|
|
3d46f4867d |
fix(linux): auto-detect and handle .relr.dyn sections for AppImage builds
Modern Linux distributions (Arch, Fedora 39+, Ubuntu 24.04+) compile libraries with .relr.dyn ELF sections. The bundled strip binary in linuxdeploy cannot process these sections, causing AppImage builds to fail. This commit: - Adds hasRelrDynSections() to proactively detect modern toolchains - Automatically disables stripping (NO_STRIP=1) when detected - Fixes error output to properly display as string - Adds documentation explaining the issue and workaround Fixes #4642 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> |
||
|
|
c4b614cb10 |
fix: use structured logging for debug/info methods (#4767)
* fix: use structured logging for debug/info methods The debug() and info() methods were using fmt.Sprintf() which expects printf-style format directives, but callers were using slog-style key-value pairs. Changed to pass args directly to Logger.Debug/Info which properly handles structured logging. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * docs: add changelog entries for build fixes 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * chore: remove temporary debug print statements from mobile merge Remove emoji debug logs (🔴, 🟢, 🟠, 🔵, 🔥) that were accidentally left in from the iOS/Android mobile platform support merge. These were development debugging statements that should not have been included in the final code. Files cleaned: - application.go - application_debug.go - init_android.go - init_ios.go - mainthread_android.go - mainthread_ios.go - webview_window.go - webview_window_ios.go 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * docs: add changelog entries for debug cleanup and breaking change - Add breaking change note: production builds are now default - Add entry for debug print statement removal 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: convert remaining printf-style debug calls to slog-style Convert three debug() calls that were still using printf-style format strings to slog-style structured logging (key-value pairs): - systemtray_windows.go: ShellNotifyIcon show/hide failures - application_darwin.go: window lookup failure This addresses CodeRabbit review feedback and ensures consistency with the refactored debug() method. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: convert all printf-style info() calls to slog-style Convert remaining info() calls that were using printf-style format strings to slog-style structured logging (key-value pairs): - application_ios.go: iOS log messages and HandleJSMessage calls - webview_window_windows.go: WM_SYSKEYDOWN logging - application.go: handleWindowMessage and handleWebViewRequest logging Also removed debug fmt.Printf statements from handleWebViewRequest. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: add build tag to main.m to prevent Go from compiling it on non-iOS platforms Go's toolchain tries to process .m (Objective-C) files when they're in a directory with Go files. Adding a //go:build ios tag tells Go to only process this file when building for iOS, matching how darwin .m files handle this (e.g., //go:build darwin && !ios). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * chore: remove orphaned wails-mimetype-migration submodule reference The iOS merge added a submodule reference without a corresponding .gitmodules file, causing Cloudflare and other CI systems to fail with "No url found for submodule path" errors. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: auto-disable DMA-BUF renderer on Wayland with NVIDIA to prevent crashes WebKitGTK has a known issue with the DMA-BUF renderer on NVIDIA proprietary drivers running Wayland, causing "Error 71 (Protocol error)" crashes. This fix automatically detects NVIDIA GPUs (via /sys/module/nvidia) and sets WEBKIT_DISABLE_DMABUF_RENDERER=1 when running on Wayland. Also removes leftover debug print statements from mobile platform merge. See: https://bugs.webkit.org/show_bug.cgi?id=262607 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat: add NVIDIA driver info to wails3 doctor on Linux Shows NVIDIA driver version and srcversion in doctor output to help diagnose Wayland/NVIDIA compatibility issues. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
a878b2c1af |
fix(config): dev server started with production build by default | ||
|
|
29f751931a |
fix: remove duplicate iOS subcommand and make SDK_PATH lazy in iOS Taskfile
- Remove duplicate iOS subcommand registration in main.go (merge artifact) - Make SDK_PATH a task-level variable in iOS Taskfile to avoid eager evaluation that fails on non-macOS systems when running Android builds This fixes Android builds failing with "xcrun: command not found" on Linux systems where Xcode tools are unavailable. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> |
||
|
|
96dff3885d |
Merge Android support from v3-alpha-feature/android-support
This commit integrates Android platform support for Wails v3. Key changes: - Add Android-specific application, webview, and runtime files - Add Android event types - Add Android examples and build system (Gradle) - Add JNI bridge for Go <-> Java communication - Update application options for Android configuration - Add Android include to common Taskfile template Note: The Android branch was more recent than the iOS branch and had fewer conflicts with the transport layer refactor. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> |
||
|
|
873848a077 |
Merge iOS support from v3-alpha-feature/ios-support
This commit integrates iOS platform support for Wails v3, adapting the iOS-specific code to work with the new transport layer architecture. Key changes: - Add iOS-specific application, webview, and runtime files - Add iOS event types and processing - Add iOS examples and templates - Update messageprocessor to handle iOS requests - Move badge_ios.go to dock package Note: The iOS branch was based on an older v3-alpha and required significant conflict resolution due to the transport layer refactor (PR #4702). Some iOS-specific code may need further adaptation: - processIOSMethod needs to be implemented with new RuntimeRequest signature - iOS event generation in tasks/events/generate.go needs updating 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> |
||
|
|
9d9d67984f |
fix: https://github.com/wailsapp/wails/issues/4636 (#4682)
* fix(v3): fixed update plist, close https://github.com/wailsapp/wails/issues/4636 * chore: update changelog * feat: add recursive merge support for nested plist dictionaries Previously, the plist merge was shallow - nested dictionaries were completely replaced rather than recursively merged. This caused custom nested configurations to be lost during build asset updates. Now nested dictionaries are recursively merged, preserving custom keys at all levels while still allowing new keys to be added and existing keys to be updated. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * refactor: replace temp directory with backup-based plist merge Instead of extracting to a temp directory and copying files over, we now: 1. Rename existing plists to .plist.bak 2. Extract new assets directly to target 3. Merge backup content into newly extracted plists 4. Clean up backup files This is simpler, more crash-safe (backups remain if process crashes), and avoids the overhead of a temp directory and file copying. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Lea Anthony <lea.anthony@gmail.com> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> |
||
|
|
d16371b119 |
fix(commands): update task wrapper tests for cross-platform build system
Update tests to match the new wrapTask behavior introduced in the cross-platform build system: - Task names are now prefixed with platform (e.g., linux:build) - ARCH argument is automatically added based on GOARCH - GOOS/GOARCH args are filtered from remaining args - Environment variables are respected with arg overrides Also adds test for the new SignWrapper command. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> |
||
|
|
431869bf84 |
feat(setup): add global defaults, light/dark mode, and UI improvements
- Add global defaults config stored in ~/.config/wails/defaults.yaml - Add light/dark mode toggle with theme persistence - Add PKGBUILD support to Linux build formats display - Add macOS signing clarification (public identifiers vs Keychain storage) - Fix spinner animation using CSS animate-spin - Add signing defaults for macOS and Windows code signing - Compact defaults page layout with 2-column design - Add Wails logo with proper light/dark theme variants 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> |
||
|
|
b8630ca7b5 |
feat(v3): add interactive setup wizard command
- Add setup.go command that launches the web-based setup wizard - Register `wails3 setup` command in main.go - Fix SignWrapper registration to use NewSubCommand pattern 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> |
||
|
|
3594b77666 |
feat(v3): add cross-platform build system and signing support
Add Docker-based cross-compilation for building Wails apps on any platform: - Linux builds from macOS/Windows using Docker with Zig - Windows builds with CGO from Linux/macOS using Docker - macOS builds from Linux/Windows using Docker with osxcross Add wails3 tool lipo command using konoui/lipo library for creating macOS universal binaries on any platform. Add code signing infrastructure: - wails3 sign wrapper command (like build/package) - wails3 tool sign low-level command for Taskfiles - wails3 setup signing interactive wizard - wails3 setup entitlements for macOS entitlements - Keychain integration for secure credential storage Update all platform Taskfiles with signing tasks: - darwin:sign, darwin:sign:notarize - windows:sign, windows:sign:installer - linux:sign:deb, linux:sign:rpm, linux:sign:packages Reorganize documentation: - Move building/signing guides to guides/build/ - Add platform-specific packaging guides (macos, linux, windows) - Add cross-platform build documentation - Add comprehensive signing guide with CI/CD examples - Add auto-updates guide and updater reference - Add distribution tutorial 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> |
||
|
|
ea2e0ec891 | Merge origin/v3-alpha into v3-alpha-feature/android-support | ||
|
|
bbd5d99667 |
[v3] Typed Events, revisited (#4633)
* Add strong event typings * Make `EmitEvent` take one data argument only * Add event registration logic * Report event cancellation to the emitter * Prevent registration of system events * Add support for typed event data initialisation * Binding generation for events * Tests for event bindings * Add vite plugin for typed events * Fix dev command execution order Co-authored-by: Fabio Massaioli <fabio.massaioli@gmail.com> * Propagate module path to templates * Update templates Co-authored-by: Ian VanSchooten <ian.vanschooten@gmail.com> * Go mod tidy for examples * Switch to tsconfig.json for jetbrains IDE support * Replace jsconfig in example * Convert vite plugin to typescript * Downgrade vite for now The templates all use 5.x * Remove root plugins dir from npm files It's now '/dist/plugins' * Include types for Create But keep out of the docs * Assign a type for cancelAll results * Restore variadic argument in EmitEvent methods * Support registered events with void data * Test cases for void alias support * Support strict mode * Support custom event hooks * Update docs * Update changelog * Testdata for typed events * Test data for void alias support * fix webview_window emit event * Update changelog.mdx * Update events * Fix generator test path normalization for cross-platform compatibility The generator tests were failing on CI because they compared absolute file paths in warning messages. These paths differ between development machines and CI environments. Changes: - Normalize file paths in warnings to be relative to testcases/ directory - Handle both Unix and Windows path separators - Use Unix line endings consistently in test output - Update all test expectation files to use normalized paths This ensures tests pass consistently across different environments including Windows, macOS, Linux, and CI systems. * Remove stale comment * Handle errors returned from validation * Restore variadic argument to Emit (fix bad rebase) * Event emitters return a boolean * Don't use `EmitEvent` in docs Supposedly it's for internal use, according to comment * Fix event docs (from rebase) * Ensure all templates specify @wailsio/runtime: "latest" * Fix Windows test failure due to CRLF line endings The test was failing on Windows because: 1. Hardcoded "\n" was being used instead of render.Newline when writing warning logs, causing CRLF vs LF mismatch 2. The render package import was missing 3. .got.log files weren't being skipped when building expected file list Changes: - Add render package import - Use render.Newline instead of hardcoded "\n" for cross-platform compatibility - Skip .got.log files in test file walker 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Fix template tests by using local runtime package The template tests were failing because they were installing @wailsio/runtime@latest from npm, which doesn't have the new vite plugin yet. This change packs the local runtime and uses it in template tests instead. Changes: - Pack the runtime to a tarball in test_js job - Upload the runtime package as an artifact - Download and install the local runtime in template tests before building - Update cleanup job to delete the runtime package artifact * Apply suggestion from @leaanthony * Fix: Install local runtime in frontend directory with correct path The previous fix wasn't working because: 1. npm install was run in the project root, not in frontend/ 2. wails3 build runs npm install again, which would reinstall from npm Fixed by: - Using npm pkg set to modify package.json to use file:// protocol - This ensures subsequent npm install calls use the local tarball * Fix Vue template syntax conflicts with Go template delimiters The Vue templates were converted to .tmpl files to support dynamic module paths, but Vue's template syntax {{ }} conflicts with Go's template syntax. Fixed by escaping Vue template braces: - {{ becomes {{"{{"}} - }} becomes {{"}}"}} This allows the Go template engine to output the literal {{ }} for Vue to process. * Fix Vue template escaping and Windows shell compatibility Two issues fixed: 1. Vue template escaping: Changed from {{"{{"}} to {{ "{{" }} - The previous syntax caused "missing value for command" error - Correct Go template syntax uses spaces between delimiters and strings 2. Windows PowerShell compatibility: Added 'shell: bash' to template generation step - The bash syntax (ls, head, $()) doesn't work in PowerShell - Git Bash is available on all GitHub runners including Windows * Fix: test_templates depends on test_js for runtime package artifact The runtime-package artifact is created in test_js job, not test_go. Added test_js to the needs array so the artifact is available for download. * Fix Windows path compatibility for runtime package artifact Changed from absolute Unix path '/tmp/wails-runtime' to relative path 'wails-runtime-temp' which works cross-platform. Using realpath to convert to absolute path for file:// URL in npm pkg set command. * Fix realpath issue on Windows for runtime package realpath on Windows Git Bash was producing malformed paths with duplicate drive letters (D:\d\a\...). Replaced with portable solution using pwd that works correctly across all platforms. * Use pwd -W on Windows to get native Windows paths Git Bash's pwd returns Unix-style paths (/d/a/wails/wails) which npm then incorrectly resolves as D:/d/a/wails/wails. Using pwd -W returns native Windows paths (D:\a\wails\wails) that npm can handle correctly. This is the root cause of all the Windows path issues. * Improve typechecking for Events.Emit() * [docs] Clarify where `Events` is imported from in each example * Add docs for runtime Events.Emit() * Revert to v2-style Events.Emit (name, data) * Update changelog --------- Co-authored-by: Fabio Massaioli <fabio.massaioli@gmail.com> Co-authored-by: Atterpac <Capretta.Michael@gmail.com> Co-authored-by: Lea Anthony <lea.anthony@gmail.com> Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
11751beb8a |
[v3] Fix Windows package task failure (#4668)
* Fix package task incompatibility * Update UNRELEASED_CHANGELOG.md |
||
|
|
0f23972fed |
Fix linux appimage task (#4644)
* Fixes https://github.com/wailsapp/wails/issues/4642 * Fix Linux appimage appicon variable in Linux taskfile |
||
|
|
f1037c8e22 |
[v3] Fix Linux Desktop Template & Windows NSIS Template Added (#4510)
* feat: added custom protocols to tmpl for windows wails tools * fix:: .Info.Protocols, .Info doesn't exist and causes templater to error * test: tests for build assets * feat: updated changelog * feat: insert macro for custom protocols * Update changelog --------- Co-authored-by: Lea Anthony <lea.anthony@gmail.com> |
||
|
|
a937780218 |
Add iOS support for Wails v3 alpha
This commit introduces comprehensive iOS platform support for Wails v3, enabling developers to build native iOS applications using Go and web technologies. Key Features: - Full iOS application lifecycle management with WKWebView integration - Native iOS options configuration (scroll, bounce, navigation gestures, media playback) - iOS-specific build system with Xcode project generation - Support for iOS simulators and physical devices - Native tab bar (UITabBar) integration with SF Symbols - iOS runtime API for platform-specific functionality - Complete example iOS application with Puppertino UI framework - iOS template for new projects - Build tasks and configuration for iOS development - Support for input accessory view management - Custom user agent configuration - Background color support for iOS windows Technical Implementation: - iOS-specific message processor for event handling - Native Objective-C bridges for iOS APIs - WKWebView configuration and management - iOS asset handling and bundling - Proper build constraints for iOS platform - Integration with existing Wails v3 architecture This enables developers to target iOS alongside existing desktop platforms (macOS, Windows, Linux) using a single Go + web technology codebase. Co-Authored-By: Claude <noreply@anthropic.com> |
||
|
|
15812b4f80 |
fix: make options in update build-assets override (#4505)
* 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 |
||
|
|
bf805b4152 |
Update CLI to pass through variables (#4488)
* feat: Update CLI to pass parameters through to Task commands - Modified build and package commands to accept otherArgs parameter - Updated task wrapper to forward CLI variables to Task - Enhanced task.go to properly parse and handle CLI variables (KEY=VALUE format) - Fixes issue where 'wails3 build' and 'wails3 package' commands weren't forwarding parameters Fixes #4422 * Update changelog * Apply suggestion from @coderabbitai[bot] Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Fix cli.mdx --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> |
||
|
|
c2ba85663f |
Correct nfpm.yaml template package dependencies. (#4481)
* 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> |
||
|
|
fe717c42b5 |
Refactor to using Window interface (#4471)
Refactor window interface to eliminate type assertions and improve code maintainability |
||
|
|
b3c01f4c67 |
[v3] fix linux .desktop file appicon variable (#4477)
* [v3] fix linux .desktop file appicon variable * Update UNRELEASED_CHANGELOG.md --------- Co-authored-by: Lea Anthony <lea.anthony@gmail.com> |
||
|
|
b0871c19e1 |
[v3] Fix: Vite server not cleaned up when build fails (#4436)
* 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> |
||
|
|
810dfbb11b | fix linux .desktop generation | ||
|
|
d3d95e07d1 | Merge remote-tracking branch 'wails/v3-alpha' into v3/deeplink | ||
|
|
9f96439ba1 |
feat: Add distribution-specific build dependencies for Linux (#4339) (#4345)
* 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> |
||
|
|
504d456dea |
Fix window visibility issue #2861 - initialize showRequested based on Hidden option | ||
|
|
3087ba0bdc |
Refactor Manager API to use singular naming convention (#4367)
* 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> |
||
|
|
66ad93d9d5 |
feat: Complete App API restructuring with organized manager pattern (#4359)
* 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> |
||
|
|
a55c1fedcb |
fix: Resolve MSIX template field reference errors in wails3 init
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> |