Commit graph

5,254 commits

Author SHA1 Message Date
Lea Anthony
ea2e0ec891 Merge origin/v3-alpha into v3-alpha-feature/android-support 2025-11-28 21:20:47 +11:00
Lea Anthony
4d8ec29feb feat: Add Android support for Wails v3
This commit adds comprehensive Android support for Wails v3, enabling
Go applications to run as native Android apps with WebView-based UI.

Key features:
- Android-specific application implementation with JNI bridge
- WebView integration via WebViewAssetLoader for serving assets
- JavaScript runtime injection and execution via JNI callbacks
- Binding call support with async result callbacks
- Event system support for Android platform
- Full example Android app with Gradle build system

Technical details:
- Uses CGO with Android NDK for cross-compilation
- Implements JNI callbacks for Go <-> Java communication
- Supports both ARM64 and x86_64 architectures
- WebView debugging support via Chrome DevTools Protocol
- Handles empty response body case in binding calls to prevent panic

Files added:
- v3/pkg/application/*_android.go - Android platform implementations
- v3/pkg/events/events_android.go - Android event definitions
- v3/internal/*/\*_android.go - Android-specific internal packages
- v3/examples/android/ - Complete example Android application
- v3/ANDROID_ARCHITECTURE.md - Architecture documentation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 21:06:59 +11:00
Lea Anthony
3f0091aba9 fix(docs): update starlight-blog to v0.25.1 to fix build error 2025-11-24 21:54:59 +11:00
Lea Anthony
55f2782559 fix(docs): update starlight to v0.36.2 to support social links array 2025-11-24 21:52:26 +11:00
Lea Anthony
0d02db8ce6 fix(docs): comment out all broken d2 diagrams and fix invalid aside type 2025-11-24 21:46:26 +11:00
Lea Anthony
7e21ce614a fix(docs): disable broken d2 diagram and fix installer 2025-11-24 21:33:15 +11:00
Lea Anthony
af2f054813 fix: Add path filters and fix env placement in docs workflow
- Add path filters to only trigger on docs/** changes
- Remove incorrectly placed GH_TOKEN env variable
- This should make the workflow trigger properly
2025-11-23 22:40:21 +11:00
Lea Anthony
3c78e45426 docs: Trigger rebuild with minor update 2025-11-23 22:36:06 +11:00
Lea Anthony
c42b84f2e2 fix: Correct D2 binary path from ~/.local/bin to /usr/local/bin 2025-11-23 22:32:38 +11:00
Lea Anthony
11b63088fb fix: Update D2 installation in GitHub Actions workflow
- Use cp instead of mv to copy D2 binary
- Add version check to verify installation
- This should resolve the D2 installation failure
2025-11-23 21:32:16 +11:00
Lea Anthony
c8c5bd15e7 fix: Add React integration to Astro config to resolve JSX renderer issue 2025-11-23 21:30:24 +11:00
Lea Anthony
fc510586df fix: Add D2 installation to GitHub Pages workflow and remove temp dev file
- Install D2 binary in GitHub Actions before building docs
- Remove DEVELOPER_GUIDE.md temporary file from docs content
- This fixes the docs build failure on GitHub Pages
2025-11-23 21:28:46 +11:00
Lea Anthony
c84506a8a8 docs: Comprehensive documentation redesign and v3-alpha updates
This commit represents a complete redesign of the Wails v3 documentation structure
and includes all recent v3-alpha updates.

## Major Changes

### Documentation Restructure
- Migrated from /learn to organized /features, /guides, /reference structure
- Created new Quick Start section with installation and first app guides
- Added comprehensive Concepts section explaining architecture and lifecycle
- Reorganized Contributing section with detailed guides for different contribution types
- Added complete API Reference with separate pages for each major component

### New Documentation
- Custom URL Protocols guide with NSIS automatic registration
- Windows Packaging guide with NSIS, MSI, and MSIX options
- Typed Events system with TypeScript binding generation
- Complete menu documentation (Application, Context, System Tray)
- Comprehensive dialog documentation (File, Message, Custom)
- Window management guides (Basics, Events, Frameless, Multiple Windows)
- Bindings documentation (Services, Methods, Models, Best Practices)
- New tutorials: Todo app and Notes app (vanilla JS)

### v3-alpha API Updates
- Typed Events: RegisterEvent[T] with strict mode and binding generation
- Custom Protocols: NSIS macros for automatic Windows protocol registration
- System Tray: Windows Show/Hide now fully functional with tooltip limits
- Window Hidden: Fixed white flash on Windows when creating hidden windows
- Notifications: Corrected import path to pkg/services/notifications
- Frontend Runtime: Events.Emit now returns Promise<boolean> for cancellation

### Documentation Improvements
- Updated all code examples to use @wailsio/runtime imports
- Added platform-specific event tables and examples
- Created comprehensive event reference with use cases
- Added security best practices and validation patterns
- Improved code examples with real-world use cases
- Added troubleshooting sections and common patterns

### Files
- Created: 60+ new documentation pages
- Deleted: Old /learn structure (13 files)
- Modified: 15 existing files for v3-alpha compatibility
- Added: Tutorial assets and showcase images
2025-11-23 20:57:25 +11:00
github-actions[bot]
986efc7e7f chore(v3): bump to v3.0.0-alpha.41 and update changelog [skip ci] v3.0.0-alpha.41 2025-11-23 02:46:07 +00:00
Brad Harker
b652e61e2c
Fix background color alpha on linux (#4722)
* Fix background color alpha on linux

* Add CHANGELOG entry

* Apply suggestion from @coderabbitai[bot]

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-11-22 03:58:11 +00:00
github-actions[bot]
c36618c2ac chore(v3): bump to v3.0.0-alpha.40 and update changelog [skip ci] v3.0.0-alpha.40 2025-11-13 02:38:55 +00:00
Lea Anthony
54d5b989bb
Fix Windows systray icon regression (#4706)
* Fix Windows systray icon regression (#4704)

This fixes a regression introduced in commit d58d4ba where the systray
icon no longer defaults to the application icon when no custom icon is
provided.

The issue was that the default icon loading was changed from:
  defaultIcon := w32.LoadIconWithResourceID(w32.GetModuleHandle(""), w32.RT_ICON)

To:
  defaultIcon := getNativeApplication().windowClass.Icon

This caused the systray to display the default Wails icon instead of
the application's custom icon.

The fix reverts the default icon loading back to using
w32.LoadIconWithResourceID with w32.RT_ICON, which correctly loads
the application's icon resource.

Fixes: #4704

* Update changelog for systray icon fix

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-11-13 07:57:46 +11:00
github-actions[bot]
c3b169f0d3 chore(v3): bump to v3.0.0-alpha.39 and update changelog [skip ci] v3.0.0-alpha.39 2025-11-12 02:38:00 +00:00
GitHub Actions
0ed4e05946 [skip ci] Publish @wailsio/runtime v3.0.0-alpha.73 2025-11-11 09:27:10 +00:00
Ian VanSchooten
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>
2025-11-11 20:25:57 +11:00
github-actions[bot]
6e4e340ade chore(v3): bump to v3.0.0-alpha.38 and update changelog [skip ci] v3.0.0-alpha.38 2025-11-04 02:38:30 +00:00
Atterpac
a3a5d25d90
[v3-linux] fileexplorer fix opening dir on Linux (#4521)
* convert file to use lf line-endings

* fileexplorer fix opening dir on Linux

* include update in unreleased changelog

---------

Co-authored-by: Angus Dippenaar <angusdippenaar@gmail.com>
2025-11-04 08:14:27 +11:00
DeltaLaboratory
d58d4ba758
[v3 alpha] windows tray minor refactor (#4653)
* remove systray add retry loop

* correct setTooltip truncation

* track Windows tray icon ownership to avoid destroying shared handles

* fix incorrect warning call

* stop leaking Windows tray theme listener after destroy

* fix default app icon loading

* fix incorrect truncation

* harden system tray flow

* implement windows tray show/hide

* improved readability

* updateIcon call path

* improve error handling

* systray clock example

* added changelog

---------

Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
2025-11-04 07:44:58 +11:00
github-actions[bot]
8ac5984dfd chore(v3): bump to v3.0.0-alpha.37 and update changelog [skip ci] v3.0.0-alpha.37 2025-11-02 02:39:44 +00:00
Leo
11751beb8a
[v3] Fix Windows package task failure (#4668)
* Fix package task incompatibility

* Update UNRELEASED_CHANGELOG.md
2025-11-01 22:01:59 +11:00
github-actions[bot]
57d55643bc chore(v3): bump to v3.0.0-alpha.36 and update changelog [skip ci] v3.0.0-alpha.36 2025-10-15 02:36:28 +00:00
Lea Anthony
f091eee98b
[v3] Fix Windows build error with go-webview2 v1.0.22 (#4645)
* Fix Windows build error with go-webview2 v1.0.22

Fixes #4513

The go-webview2 library changed the MessageCallback signature in v1.0.22
from `func(string)` to `func(message string, sender *ICoreWebView2, args *ICoreWebView2WebMessageReceivedEventArgs)`.

This caused a build error for users:
```
cannot use w.processMessage (value of type func(message string)) as
func(message string, sender *ICoreWebView2, args *ICoreWebView2WebMessageReceivedEventArgs)
value in assignment
```

Changes:
- Updated processMessage signature to match go-webview2 v1.0.22
- Upgraded go-webview2 dependency from v1.0.21 to v1.0.22

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Fix Windows build error with go-webview2 v1.0.22

Fixes #4513

The go-webview2 library changed the MessageCallback signature in v1.0.22
from `func(string)` to `func(message string, sender *ICoreWebView2, args *ICoreWebView2WebMessageReceivedEventArgs)`.

This caused a build error for users:
```
cannot use w.processMessage (value of type func(message string)) as
func(message string, sender *ICoreWebView2, args *ICoreWebView2WebMessageReceivedEventArgs)
value in assignment
```

Changes:
- Updated processMessage signature to match go-webview2 v1.0.22
- Upgraded go-webview2 dependency from v1.0.21 to v1.0.22

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-10-14 21:40:53 +11:00
github-actions[bot]
8cd89fc5ef chore(v3): bump to v3.0.0-alpha.35 and update changelog [skip ci] v3.0.0-alpha.35 2025-10-14 02:34:13 +00:00
COD3HUNT3R
0f23972fed
Fix linux appimage task (#4644)
* Fixes https://github.com/wailsapp/wails/issues/4642

* Fix Linux appimage appicon variable in Linux taskfile
2025-10-14 08:52:55 +11:00
github-actions[bot]
ca594c5919 chore(v3): bump to v3.0.0-alpha.34 and update changelog [skip ci] v3.0.0-alpha.34 2025-10-06 02:34:59 +00:00
Matthew
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>
2025-10-05 10:58:54 +00:00
github-actions[bot]
e2c95ba292 chore(v3): bump to v3.0.0-alpha.33 and update changelog [skip ci] v3.0.0-alpha.33 2025-10-04 02:28:46 +00:00
Jack Doan
84fcd705cc
[V3] Fix Linux systray updates (#4615)
* linux: Refresh the menu when it's set so dbus ever finds out

* changelog

* obey the rabbit
2025-10-03 13:39:41 +10:00
github-actions[bot]
f5fa1158dc chore(v3): bump to v3.0.0-alpha.32 and update changelog [skip ci] v3.0.0-alpha.32 2025-10-02 02:32:29 +00:00
rxliuli
6023f8ba5b
docs(v3): fixed notifications pkg path (#4617)
* docs(v3): fixed notifications pkg path

* chore(v3): update changelog

---------

Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
2025-10-02 12:29:51 +10:00
GitHub Actions
a72bc5039c [skip ci] Publish @wailsio/runtime v3.0.0-alpha.72 2025-10-02 02:03:00 +00:00
Lea Anthony
6665a3a4b3
fix: Move HandlePlatformFileDrop to window._wails internal API (#4616)
* fix: Move HandlePlatformFileDrop to window._wails internal API

Fixes #4489

## Problem
The npm package @wailsio/runtime doesn't work for drag-and-drop because
Go backend calls window.wails.Window.HandlePlatformFileDrop(), but the
npm package doesn't populate window.wails (by design for encapsulation).

## Root Cause
PR #3295 (March 2024) intentionally removed window.wails assignment from
the npm package to improve encapsulation. However, this broke platform
handlers that Go backend relies on.

## Solution
Move HandlePlatformFileDrop from public API (window.wails) to internal
API (window._wails), following the existing pattern:
- window._wails.invoke
- window._wails.environment
- window._wails.flags

## Changes
- Register handlePlatformFileDrop in window._wails namespace
- Update Go backend to call window._wails.handlePlatformFileDrop()
- Use camelCase naming for consistency with other internal API methods
- Rebuild bundled runtime with changes

## Benefits
 npm package works without window.wails pollution
 Maintains encapsulation of public API
 Platform handlers clearly separated as internal
 Follows existing internal API conventions

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* chore: Add changelog entry for drag-and-drop fix

Updates UNRELEASED_CHANGELOG.md with the fix for #4489.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-10-02 12:01:53 +10:00
Lea Anthony
4d888a3df6
fix: prevent white window flash when Hidden option is true (#4612)
* fix: prevent white window flash when Hidden option is true

Fixes #4611

When creating a window with Hidden: true, the window was briefly
visible as a white window before disappearing. This was caused by
CreateWindowEx using WS_OVERLAPPEDWINDOW style which includes
WS_VISIBLE by default.

The fix excludes WS_VISIBLE from the window style when the Hidden
option is set to true, ensuring the window remains invisible until
explicitly shown via window.Show().

* Update Changelog
2025-10-02 11:55:38 +10:00
GitHub Actions
f70b9bf229 [skip ci] Publish @wailsio/runtime v3.0.0-alpha.71 2025-09-27 22:01:45 +00:00
Lea Anthony
3d1dc86079 Fix commit of npm package changes 2025-09-28 08:00:42 +10:00
Lea Anthony
cb76ef8c60 Bump npm version and fix pipeline 2025-09-28 07:50:55 +10:00
Lea Anthony
4a9d693e93 Regenerate runtime package 2025-09-28 07:37:57 +10:00
github-actions[bot]
cbf70499c3 chore(v3): bump to v3.0.0-alpha.31 and update changelog [skip ci] v3.0.0-alpha.31 2025-09-27 02:30:33 +00:00
Lea Anthony
751e4afe3f
[V3] Fix Window Affinity weirdness (#4600)
* Fix window affinity weirdness

* Update changelog
2025-09-27 12:25:00 +10:00
github-actions[bot]
966e3d5fbc chore(v3): bump to v3.0.0-alpha.30 and update changelog [skip ci] v3.0.0-alpha.30 2025-09-26 02:33:55 +00:00
samstanier
bb53fcbfac
[V3 alpha] Fix ultrawide monitor support on Wayland (fixes #4429) (#4561)
* Fixed Wayland related window maximum size issues on ultrawide monitors by adding a monitor-window search fallback.

* Fixed Wayland related window maximum size issues on ultrawide monitors by adding a monitor-window search fallback.

* Added note to UNRELEASED_CHANGELOG.md regarding Wayland ultrawide monitor fix of issue 4439.

---------

Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
2025-09-25 06:01:16 +00:00
Lea Anthony
386034e1ef Update nightly release script 2025-09-25 14:42:51 +10:00
Lea Anthony
c6f6b0d054 Update nightly release script 2025-09-25 14:03:59 +10:00
Lea Anthony
91ee276115 Move to d2 diagrams in docs 2025-09-25 14:02:19 +10:00
Lea Anthony
bfd7a6279c chore(v3): bump to v3.0.0-alpha.29 and update changelog [skip ci] v3.0.0-alpha.29 2025-09-25 13:57:32 +10:00