Commit graph

5,323 commits

Author SHA1 Message Date
github-actions[bot]
a13a426bcc chore(v3): bump to v3.0.0-alpha.48 and update changelog [skip ci] v3.0.0-alpha.48 2025-12-16 02:42:52 +00:00
Ndianabasi Udonkang
6eb9415d37
Update asset-server Documentation to Reflect Current Implementation (#4802)
* Refactor asset-server documentation for clarity

Updated references from 'frontend/Taskfile.yml' to 'build/Taskfile.yml' and adjusted environment variable names for clarity. Enhanced the explanation of how the dev proxy works and clarified the roles of the tasks in the templates.

* Update changelog

* 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-12-16 06:08:45 +11:00
Lea Anthony
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>
2025-12-16 06:05:40 +11:00
Lea Anthony
f3af37be72
fix(darwin): prevent window destruction when hiding with ApplicationShouldTerminateAfterLastWindowClosed (#4800)
* ## Summary

I've verified and fixed the bug reported in GitHub issue #4389. Here's what was done:

### Root Cause Analysis

The crash occurred on macOS when using `Hide()` and `Show()` to toggle window visibility via a system tray. The sequence was:

1. `Hide()` calls `orderOut:nil` which removes the window from screen
2. With `ApplicationShouldTerminateAfterLastWindowClosed = true` (default), macOS considers the app to have no visible windows
3. macOS triggers `windowShouldClose:` which emits `EventWindowShouldClose`
4. The event mapping translates this to `Common.WindowClosing`
5. The `WindowClosing` handler destroys the window and removes it from the window map
6. When `Show()` is called later, the window doesn't exist anymore → crash

### Fix Implementation

**File: `v3/pkg/application/webview_window_close_darwin.go`**
- Added new exported function `windowIsHidden()` that checks if a window is marked as hidden via `window.options.Hidden`

**File: `v3/pkg/application/webview_window_darwin.m`**
- Added extern declaration for `windowIsHidden`
- Modified `windowShouldClose:` delegate method to return `false` early (without emitting close events) if the window is hidden

The fix ensures that when a window is intentionally hidden (not closed), the close event sequence is not triggered, preserving the window for later re-showing.

### Test Case Created

Created `v3/tests/systray-hide-show-test/` - a test application that:
- Creates a window and system tray
- Clicking the tray toggles window visibility
- Previously crashed after hide→show→hide sequence; now works correctly

### Files Modified

1. `v3/pkg/application/webview_window_close_darwin.go` - Added `windowIsHidden()` function
2. `v3/pkg/application/webview_window_darwin.m` - Check hidden state in `windowShouldClose:`
3. `v3/UNRELEASED_CHANGELOG.md` - Added fix entry

### Files Added

1. `v3/tests/systray-hide-show-test/main.go` - Test case
2. `v3/tests/systray-hide-show-test/icon.png` - Icon for test

All existing tests pass. The fix is minimal and targeted, only affecting the specific scenario where a hidden window receives a close query.

* Done. The redundant test case has been removed. The fix is covered by the existing `v3/examples/hide-window/` example.

Current staged changes:
- Deleted `v3/tests/systray-hide-show-test/` (test case, icon, and binary)

The fix itself (in `webview_window_close_darwin.go` and `webview_window_darwin.m`) and the changelog entry were already committed in the previous commit.
2025-12-15 22:28:41 +11:00
Lea Anthony
531f9e0c5b
fix(v3): fix context menu memory leak and improve native resource reuse (#4801)
All tests pass. Let me provide a summary of the changes.

## Summary

This issue (#4012) is about **Dynamic Context Menu** support, labeled as a Bug affecting macOS.

### Root Cause Analysis

I identified two related issues:

1. **macOS Memory Leak**: In `webview_window_darwin.go`, the `openContextMenu` function created a **new** `macosMenu` and `NSMenu` every time a context menu was displayed, ignoring any existing `menu.impl`. This caused:
   - Memory leaks (NSMenu objects never released)
   - Wasted CPU cycles rebuilding the native menu each time
   - Inconsistent behavior with other platforms

2. **Windows Memory Leak**: In `webview_window_windows.go`, the `openContextMenu` function created a new `Win32Menu` each time without destroying the previous one, leaking Windows menu handles.

### Fixes Applied

**1. macOS (`v3/pkg/application/webview_window_darwin.go:889-897`):**
```go
func (w *macosWebviewWindow) openContextMenu(menu *Menu, data *ContextMenuData) {
    // Reuse existing impl if available, otherwise create new one
    if menu.impl == nil {
        menu.impl = newMenuImpl(menu)
    }
    thisMenu := menu.impl.(*macosMenu)
    thisMenu.update()
    C.windowShowMenu(w.nsWindow, thisMenu.nsMenu, C.int(data.X), C.int(data.Y))
}
```

This now:
- Reuses existing `menu.impl` if available (consistent with Linux)
- Only creates new impl on first display
- The `update()` call still rebuilds native items from current Go state for dynamic updates

**2. Windows (`v3/pkg/application/webview_window_windows.go:1174-1184`):**
```go
func (w *windowsWebviewWindow) openContextMenu(menu *Menu, _ *ContextMenuData) {
    // Destroy previous context menu if it exists to prevent memory leak
    if w.currentlyOpenContextMenu != nil {
        w.currentlyOpenContextMenu.Destroy()
    }
    // Create the menu from current Go-side menu state
    thisMenu := NewPopupMenu(w.hwnd, menu)
    thisMenu.Update()
    w.currentlyOpenContextMenu = thisMenu
    thisMenu.ShowAtCursor()
}
```

This now properly destroys the old `Win32Menu` before creating a new one.

**3. Updated `v3/UNRELEASED_CHANGELOG.md`** with fix entries.

### Files Changed
- `v3/pkg/application/webview_window_darwin.go`
- `v3/pkg/application/webview_window_windows.go`
- `v3/UNRELEASED_CHANGELOG.md`

### Testing
- Build passes ✓
- All existing tests pass ✓
- Manual testing recommended using `v3/examples/contextmenus` app
2025-12-15 22:26:31 +11:00
Ndianabasi Udonkang
9b03981d06
Fix documentation to Use singular 'Screen' (#4784)
* Fix documentation to use singular 'Screen'

Updated references from 'Screens' to 'Screen' in documentation.

* Update UNRELEASED_CHANGELOG.md
2025-12-15 22:19:51 +11:00
COD3HUNT3R
698d950add
Add desktop environment detection on linux (#4797)
* add desktop environment detection on linux

* Update UNRELEASED_CHANGELOG.md
2025-12-15 18:18:48 +11:00
github-actions[bot]
c5af373c43 chore(v3): bump to v3.0.0-alpha.47 and update changelog [skip ci] v3.0.0-alpha.47 2025-12-15 02:46:36 +00:00
Lea Anthony
35500c891e
fix(macos): Show hidden windows when dock icon is clicked (#4583) (#4790)
When an application starts with Hidden: true, clicking the dock icon
now correctly shows the window. This matches standard macOS UX where
clicking the dock icon should bring up the app's windows.

The fix adds a default handler for ApplicationShouldHandleReopen that
automatically shows all hidden windows when there are no visible windows.

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

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-14 15:26:16 +11:00
GitHub Actions
3da9b0a8de [skip ci] Publish @wailsio/runtime v3.0.0-alpha.77 2025-12-14 04:06:00 +00:00
Lea Anthony
2c9d23b040
fix(macos): fix print dialog not opening and add Window.Print() to runtime (#4789)
fix(macos): fix print dialog not opening and add Window.Print() to runtime (#4290)

The print dialog was not opening on macOS because the CGO windowPrint function was passing the wrong pointer type to NSPrintOperation's runOperationModalForWindow method. It was passing the raw void* window instead of the properly cast WebviewWindow* nsWindow.

This also adds a Window.Print() method to the JavaScript runtime, allowing frontend code to trigger the print dialog directly without needing a Go binding.

Changes:
- Fix webview_window_darwin.go to use nsWindow instead of window
- Add WindowPrint constant (51) and handler to messageprocessor_window.go
- Add Print() method to window.ts in the runtime
- Rebuild bundled runtime (runtime.js and runtime.debug.js)
- Add print example in v3/examples/print to demonstrate both Go API and JS runtime methods
- Update API documentation for Window.Print() in both Go and JavaScript references

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

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-14 15:04:54 +11:00
github-actions[bot]
780568b030 chore(v3): bump to v3.0.0-alpha.46 and update changelog [skip ci] v3.0.0-alpha.46 2025-12-14 02:47:08 +00:00
Lea Anthony
4fbe0353f7 chore: disable setup wizard from CLI
Remove the setup.Action that runs the wizard when calling `wails setup`.
The signing and entitlements subcommands are retained.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-14 07:23:49 +11:00
GitHub Actions
b1dd5a437b [skip ci] Publish @wailsio/runtime v3.0.0-alpha.76 2025-12-13 20:00:01 +00:00
Lea Anthony
f0a8bcad34
feat(linux): add WebKit2 load-change events (#4783)
* All changes are complete. Here's a summary of what was implemented for issue #3896:

## Summary

Added four new WebKit2 load-change events for Linux to match WebKitGTK's documented load-change signals:

### New Events
| Event | ID | WebKit Signal | Description |
|-------|-----|---------------|-------------|
| `WindowLoadStarted` | 1059 | `WEBKIT_LOAD_STARTED` | Fired when page load begins |
| `WindowLoadRedirected` | 1060 | `WEBKIT_LOAD_REDIRECTED` | Fired when a redirect occurs |
| `WindowLoadCommitted` | 1061 | `WEBKIT_LOAD_COMMITTED` | Fired when load is committed |
| `WindowLoadFinished` | 1062 | `WEBKIT_LOAD_FINISHED` | Fired when load completes |

### Files Modified
1. **`v3/pkg/events/events.go`** - Added new event types to `linuxEvents` struct and updated all platform event IDs (Mac, Windows, iOS shifted by +4 to accommodate new Linux events)
2. **`v3/pkg/events/events_linux.h`** - Added C defines for new events
3. **`v3/pkg/application/linux_cgo.go`** - Updated `handleLoadChanged()` to dispatch all four load events
4. **`v3/UNRELEASED_CHANGELOG.md`** - Documented the new feature

### Backward Compatibility
- The existing `WindowLoadChanged` event (1058) continues to fire on `WEBKIT_LOAD_FINISHED` for backward compatibility
- `WindowLoadFinished` also fires on `WEBKIT_LOAD_FINISHED` for consistent naming with the new events

Would you like me to commit these changes?

* These are the remaining changes that need to be committed - the generator properly updated:
1. `events.txt` - source of truth for events
2. `event_types.ts` - TypeScript runtime types for JS/TS clients
3. `events_darwin.h` - Mac C header with updated event IDs
4. `events_ios.h` - iOS C header with updated event IDs

These are the final changes needed on top of the previous commit. Would you like me to commit these changes?

* chore: add new Linux WebKit2 load events to known_events.go

Add WindowLoadStarted, WindowLoadRedirected, WindowLoadCommitted,
and WindowLoadFinished to the known events registry.

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

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

* docs: add Linux WebKit2 load events to events-reference guide

Document the new WindowLoadStarted, WindowLoadRedirected,
WindowLoadCommitted, and WindowLoadFinished events in the
Linux Events section of the events reference guide.

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

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

* Update UNRELEASED_CHANGELOG

* refactor(linux): remove deprecated WindowLoadChanged event

Remove the legacy WindowLoadChanged event and replace all internal
references with WindowLoadFinished. This simplifies the event system
by having granular events (LoadStarted, LoadRedirected, LoadCommitted,
LoadFinished) rather than a generic LoadChanged that fired on any state.

- Remove WindowLoadChanged from events.go and event_types.ts
- Update linux_cgo.go to only fire WindowLoadFinished
- Update webview_window_linux.go hooks to use WindowLoadFinished
- Regenerate runtime bundles and known_events
- Update events documentation

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

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

* docs: add breaking change note for WindowLoadChanged removal

🤖 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>
2025-12-14 06:59:01 +11:00
github-actions[bot]
bf1173c831 chore(v3): bump to v3.0.0-alpha.45 and update changelog [skip ci] v3.0.0-alpha.45 2025-12-13 02:39:16 +00:00
Lea Anthony
4607913b67
fix(doctor): correct webkit package detection on Fedora/DNF systems (#4781)
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-13 12:23:17 +11:00
Lea Anthony
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>
2025-12-13 12:22:59 +11:00
Lea Anthony
657ca6b2c4
docs: add Linux runtime dependencies and nfpm packaging guide (#4779)
Add documentation for:
- Runtime dependencies table for different Linux distributions
- WebKit2GTK ABI version differences (4.0 vs 4.1)
- Build tags for targeting different ABI versions
- nfpm configuration examples for packaging

Based on community contribution in #4339.

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

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-13 10:59:33 +11:00
Lea Anthony
404b49e3f4 Revert "docs: add Linux runtime dependencies and nfpm packaging guide"
This reverts commit 17bce06c58.
2025-12-13 10:57:05 +11:00
Lea Anthony
9ad954b8d8 Revert "chore: update ISSUES-PLATFORM.md with session progress"
This reverts commit 2b8baf0751.
2025-12-13 10:56:56 +11:00
Lea Anthony
2b8baf0751 chore: update ISSUES-PLATFORM.md with session progress 2025-12-13 10:55:17 +11:00
Lea Anthony
17bce06c58 docs: add Linux runtime dependencies and nfpm packaging guide
Add documentation for:
- Runtime dependencies table for different Linux distributions
- WebKit2GTK ABI version differences (4.0 vs 4.1)
- Build tags for targeting different ABI versions
- nfpm configuration examples for packaging

Based on community contribution in #4339.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-13 10:54:18 +11:00
Lea Anthony
acae20950f
fix(linux): fix file explorer opening wrong directory (#4397) (#4777)
The pathToURI function was using url.PathEscape which incorrectly
escapes forward slashes (/ -> %2F). This caused file URIs like:

  /home/angaz -> file://%2Fhome%2Fangaz (broken)

File managers couldn't parse these malformed URIs correctly, causing
them to open the wrong directory (often a parent directory).

Fixed by using url.URL struct to properly construct file URIs:

  /home/angaz -> file:///home/angaz (correct)

Spaces and other special characters are still properly escaped.

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

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-13 10:35:33 +11:00
Lea Anthony
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>
2025-12-13 09:56:13 +11:00
Lea Anthony
38c89e06b5 Revert "fix(linux): auto-detect and handle .relr.dyn sections for AppImage builds"
This reverts commit 3d46f4867d.
2025-12-13 08:16:14 +11:00
Lea Anthony
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>
2025-12-13 08:14:21 +11:00
Lea Anthony
b35ee41073 docs: add changelog entry for Windows drag-and-drop fix (#4701)
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-13 05:36:05 +11:00
Andraz Vrhovec
54942d4f34
[v3] Fix not enough memory error when initialising drag and drop on Windows
Fix not enough memory error when initialising drag and drop on windows

Co-authored-by: Andraz Vrhovec <andraz@koofr.net>
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
2025-12-13 05:35:39 +11:00
Lea Anthony
e80cf28578
fix: prevent window menu crash on Wayland (#4769) (#4770)
* fix: prevent window menu crash on Wayland by realizing window before showing

On Wayland with GTK3, the appmenu-gtk-module tries to set DBus properties
for global menu integration before the window is fully realized, causing
a crash with the error "GDK_IS_WAYLAND_WINDOW (window) assertion failed".

The fix calls gtk_widget_realize() before gtk_widget_show_all() to ensure
the window has a valid GdkWindow when the menu system accesses it.

This fix is applied to both the CGO and purego implementations.

Fixes wailsapp/wails#4769

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

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

* feat: add Wayland detection to wails3 doctor and test for #4769

- Add Wayland session detection row to `wails3 doctor` output on Linux
- Create test project v3/test/4769-menu to manually verify the menu fix

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

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

* fix: sanitize GTK application name to prevent crashes with invalid characters

Application names containing spaces, parentheses, hash symbols, or other
invalid characters would cause GTK to fail with an assertion error.

Added sanitizeAppName() function that:
- Replaces invalid characters with underscores
- Handles leading digits
- Removes consecutive underscores
- Defaults to "wailsapp" if empty

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

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

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-12 17:59:47 +11:00
github-actions[bot]
726c7546ce chore(v3): bump to v3.0.0-alpha.44 and update changelog [skip ci] v3.0.0-alpha.44 2025-12-12 02:42:17 +00:00
Lea Anthony
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>
2025-12-12 09:03:11 +11:00
Lea Anthony
2e396bd48f fix(ios): correct service implementation pattern for dock and notifications
The iOS service stubs were importing a non-existent package
`github.com/wailsapp/wails/v3/pkg/services` and using an incompatible
interface pattern.

This fix rewrites both files to follow the same pattern as other platforms
(Linux, Windows, Darwin):
- Implement the internal platformDock/platformNotifier interfaces
- Provide New() functions returning *DockService/*NotificationService
- Stub all required interface methods

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-12 06:01:38 +11:00
Michael Baklor
a878b2c1af
fix(config): dev server started with production build by default 2025-12-11 19:08:32 +02:00
github-actions[bot]
47d827c394 chore(v3): bump to v3.0.0-alpha.43 and update changelog [skip ci] v3.0.0-alpha.43 2025-12-11 02:42:53 +00:00
Lea Anthony
f2c90b00f2 chore: remove .crush directory
Remove local database files that shouldn't be tracked in version control.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 22:14:08 +11:00
GitHub Actions
6f4df3206d [skip ci] Publish @wailsio/runtime v3.0.0-alpha.75 2025-12-10 11:12:45 +00:00
Lea Anthony
04a5e4d768 feat: [EXPERIMENTAL] Add iOS and Android mobile platform support
⚠️ EXPERIMENTAL: This feature is under active development and may change.

This merge adds initial support for building Wails applications for iOS
and Android platforms. Desktop builds are completely unaffected as mobile
code uses platform-specific build tags.

## What's Included

### iOS Support
- Native iOS app structure with WKWebView
- iOS-specific runtime methods (haptics, device info, scroll settings, etc.)
- Xcode project generation (`wails3 ios xcode:gen`)
- iOS Simulator deployment via Taskfile
- Native UITabBar support
- iOS application lifecycle events

### Android Support
- Android app structure with WebView
- Android-specific runtime methods (haptics, device info, toast)
- Gradle-based build system
- APK generation and emulator deployment
- Android NDK cross-compilation support

### Transport Layer
- iOS and Android message processors adapted to new RuntimeRequest pattern
- Mobile-specific error types (InvalidIOSCallError, InvalidAndroidCallError)
- Platform stubs for non-mobile builds

### Build System
- New Taskfile includes for ios: and android: tasks
- Lazy SDK_PATH evaluation (iOS builds don't break Android on Linux)
- Project templates include mobile build configurations

## Requirements
- iOS: macOS with Xcode 15+
- Android: Android Studio with NDK r26d

## Known Limitations
- Some mobile APIs are stubbed pending full implementation
- Mobile builds require platform-specific toolchains
- Not yet tested in production environments

Report issues: https://github.com/wailsapp/wails/issues

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 22:11:29 +11:00
Lea Anthony
d1a7299e27 fix: restore events.go from v3-alpha to fix compilation errors
The iOS branch modified events.go with debug println statements and
changed the EventProcessor.Emit signature from returning error to void.
This broke compatibility with event_manager.go and messageprocessor_events.go.

Restored the v3-alpha version which:
- Uses atomic.Bool for cancelled flags (thread-safe)
- Has EventProcessor.Emit return error for validation
- Includes decodeEventData and validateCustomEvent functions
- Removes debug println statements

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 22:06:33 +11:00
Lea Anthony
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>
2025-12-10 21:59:12 +11:00
Lea Anthony
637713fae6 feat: adapt iOS and Android message processors to RuntimeRequest transport
Transport layer refactor adaptations for mobile platforms:

- Refactor processIOSMethod to use RuntimeRequest signature
- Refactor processAndroidMethod to use RuntimeRequest signature
- Add androidRequest constant (12) and handler to messageprocessor.go
- Update messageprocessor_mobile_stub.go for non-mobile builds
- Fix undefined windowID variable (use req.WebviewWindowID)
- Add iOS event generation to tasks/events/generate.go
- Add InvalidIOSCallError and InvalidAndroidCallError to errs package
- Update iOS delegate and webview files with generated event handlers

iOS methods refactored: Haptics.Impact, Device.Info, Scroll settings,
Navigation gestures, Link previews, Debug inspector, UserAgent

Android methods refactored: Haptics.Vibrate, Device.Info, Toast.Show

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 21:27:04 +11:00
Lea Anthony
c62a094b9a fix: resolve merge conflict in AndroidOptions and add AGENTS.md
- Fix merge conflict marker in application_options.go
- Add AGENTS.md with beads workflow documentation for AI agents

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 21:15:15 +11:00
Lea Anthony
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>
2025-12-10 18:37:24 +11:00
Lea Anthony
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>
2025-12-10 18:34:21 +11:00
Steve Tynor
7c8cc6c0e1
Add aria-label to elements in the helloworld app templates (#4760)
* Add aria-label to elements in the helloworld app templates so they can be directly tested by Appium based E2E test clients

* changelog updated

* fix: restore UNRELEASED_CHANGELOG.md to correct state

Remove accidentally merged changelog entries from other PRs and
restore the base entries from v3-alpha with only this PR's changelog entry.

🤖 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>
2025-12-10 18:19:40 +11:00
rxliuli
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>
2025-12-10 17:55:31 +11:00
Caleb Jasik
89f9365c3d
[v3] Ensure the window name is passed as header to AssetFileServer (#4687)
* Add window name header when making webview requests

* Add changelog item

* Update PR no in changelog entry

---------

Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
2025-12-10 05:22:28 +00:00
github-actions[bot]
f4d1a5db5d chore(v3): bump to v3.0.0-alpha.42 and update changelog [skip ci] v3.0.0-alpha.42 2025-12-10 02:41:47 +00:00
Lea Anthony
7545701088
Update UNRELEASED_CHANGELOG.md 2025-12-10 08:39:03 +11:00
Lea Anthony
c863d2ce87 fix(docs): use Starlight admonition syntax instead of Aside component
Replace <Aside type="caution"> JSX with :::caution markdown syntax
to fix the docs build error.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 08:26:36 +11:00