Commit graph

5,172 commits

Author SHA1 Message Date
Lea Anthony
d863e525e3
Fix Windows crash bug (#4460) v3.0.0-alpha.19
* ## Summary

I've successfully fixed the nil pointer dereference bug in the Wails v3 system tray functionality on Windows. Here's what I addressed:

**Root Cause**: The bug occurred in `systemtray_windows.go:80` where `*trayBounds = PhysicalToDipRect(*trayBounds)` was dereferencing a potentially nil pointer without checking.

**Fixes Applied**:

1. **`positionWindow` method (lines 80-82)**: Added nil check for `trayBounds` before dereferencing
2. **`bounds` method (lines 121-123, 129-131)**: Added checks for uninitialized `hwnd` and nil return from `GetSystrayBounds`
3. **`iconIsInTrayBounds` method (lines 147-149, 155-157, 160-162)**: Added similar protective checks and taskbar position validation
4. **`getScreen` method (lines 173-175)**: Added `hwnd` initialization check
5. **`openMenu` method (lines 45-47)**: Added nil check for `trayBounds`

**Key Improvements**:
- Added proper initialization checks for `s.hwnd == 0`
- Added nil pointer checks for all Windows API return values
- Ensured graceful error handling instead of panics
- Maintained existing functionality while preventing race conditions

The fix addresses the race condition where system tray operations could be called before the tray was fully initialized, preventing the nil pointer dereference panic described in issue #4456.

* Update changelog
2025-08-04 20:45:01 +10:00
Atterpac
10447e6fcd
[V3] Drag-n-Drop Zones and improvements (#4318)
* new events

* macOS dnd improvements

* wailsio adds for dropzone

* update example

* sorta working

the top 300px of the window are not dropabble for some reason i suspect it has to do with the drag enter/drag leave xy as the performOperation needed to use the ContentView for appropriate X/Y

* implement attribute detection for data-wails-dropzone

* docs

* pass x/y dnd linux

* cleanup exmample

* changelog

* pass all attributes to golang on dragdrop

* filetree example

* fix dnd build windows

* Fix windows dnd

* update docs

* remove debug log

* appease the security bot

* Fix changelog

* Fix changelog

* Revert "Fix event generation issues."

This reverts commit ae4ed4fe

* Fix events

* Fix merge conflicts. Fix events generation formatting

* Update docs

* Fix duplicate bundledassets import causing build failures

Remove duplicate import of bundledassets package that was causing
compilation errors in PR #4318. The import was declared twice in
the same import block, causing "bundledassets redeclared" errors.

Fixes build issues in GitHub Actions for drag-and-drop zones feature.

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

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

* Replace fmt.Printf debug statements with globalApplication.debug

Replace all fmt.Printf debug logging statements in drag-and-drop
functionality with proper globalApplication.debug calls. This provides:

- Consistent logging with the rest of the application
- Proper key-value structured logging
- Better integration with the application's logging system
- Cleaner debug output format

Changes:
- application_darwin.go: Replace 2 fmt.Printf calls
- webview_window.go: Replace 6 fmt.Printf calls
- webview_window_windows.go: Replace 13 fmt.Printf calls
- Remove unused fmt import from application_darwin.go

All debug messages maintain the same information but now use
structured logging with key-value pairs instead of printf formatting.

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

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

* Add nil checks to WindowEventContext methods

Ensure all WindowEventContext methods properly handle nil c.data
by initializing the map when it's nil. This prevents panics when
methods are called on contexts that haven't been properly initialized.

Changes:
- DroppedFiles(): Add nil check and map initialization
- setCoordinates(): Add nil check and map initialization
- setDropZoneDetails(): Add nil check and map initialization
- DropZoneDetails(): Add nil check and map initialization

All methods now follow the same pattern as setDroppedFiles()
where a nil data map is automatically initialized to prevent
runtime panics during drag-and-drop operations.

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

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

* Update v3/pkg/application/webview_window_darwin.m

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

* reinstate events docs.

---------

Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-08-04 20:40:19 +10:00
hkhere
ca449a7706
[V3] Windows: fix(application): handle error and type assertion in save file dialog (#4284)
* fix(application): handle error and type assertion in save file dialog

---------

Co-authored-by: hkhere <hk@tinyclouds.cn>
Co-authored-by: Atterpac <89053530+atterpac@users.noreply.github.com>
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
2025-08-04 19:57:53 +10:00
mbaklor
9fe9c6647e
[V3] windows: fix html drag and drop (#4259)
* fix(windows): disable external drag only when EnableDragAndDrop is set

* update changelog for html dnd fix

* remove redundant commented out code for windows dnd

* Fix changelog

---------

Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
Co-authored-by: Atterpac <89053530+atterpac@users.noreply.github.com>
2025-08-04 19:29:47 +10:00
github-actions[bot]
1227f140b7 v3.0.0-alpha.18 2025-08-03 02:53:39 +00:00
Hudolus
4c70d4501e
Custom Windows Webview2 Args (#4467) v3.0.0-alpha.18
* Adding the ability to pass custom args to windows webview2

---------

Co-authored-by: Jason Gibson <jason@harbingerinteractive.com>
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
2025-08-02 21:03:41 +10:00
Lea Anthony
ed81ab01e7
Support allowsBackForwardNavigationGestures (#4453)
* ## Summary

I have successfully implemented support for `allowsBackForwardNavigationGestures` in Wails v3. Here's what I accomplished:

### Investigation Results
- **Issue Status**: The feature was **NOT** previously implemented in Wails v3
- **go-webview2**: This library is Windows-only and doesn't provide macOS WKWebView features
- **Need**: A native implementation was required specifically for macOS WKWebView

### Implementation Details
1. **Added new option**: `AllowsBackForwardNavigationGestures u.Bool` to `MacWebviewPreferences`
2. **Extended C bridge**: Updated the C struct to pass the preference to Objective-C code
3. **Implemented WKWebView setting**: Added code to set `webView.allowsBackForwardNavigationGestures` during initialization
4. **Updated preference processing**: Extended the Go code to handle the new preference

### Key Files Modified
- `v3/pkg/application/webview_window_options.go`: Added the preference option
- `v3/pkg/application/webview_window_darwin.go`: Implemented the C bridge and WKWebView configuration

### Usage Example
```go
window.SetOptions(application.WebviewWindowOptions{
    Mac: application.MacWindow{
        WebviewPreferences: application.MacWebviewPreferences{
            AllowsBackForwardNavigationGestures: u.True(),
        },
    },
})
```

### Testing
-  Code compiles successfully
-  Created working example demonstrating the feature
-  Follows existing Wails v3 patterns and conventions

### Benefits
- Provides native macOS two-finger swipe navigation
- Better performance than JavaScript alternatives
- Maintains accessibility features
- Seamless integration with existing Wails v3 API

The implementation is ready for testing and could be submitted as a PR to the Wails repository. The feature addresses the exact requirements from GitHub issue #1857 and provides both specific and API-consistent access to WKWebView's navigation gesture functionality.

* Perfect! I have:

1.  Removed the `NAVIGATION_GESTURES_FEATURE.md` file
2.  Removed the `example_navigation_gestures.go` file 
3.  Updated the `UNRELEASED_CHANGELOG.md` with a FIX entry

The changelog entry properly documents that this fix adds support for `allowsBackForwardNavigationGestures` in macOS WKWebView to enable two-finger swipe navigation gestures, referencing issue #1857.

The implementation is now clean and ready, with only the essential code changes remaining and the changelog properly updated to reflect the fix.
2025-08-02 21:02:52 +10:00
Lea Anthony
a9222b538d
Fix: Disabled menu item callback (#4469)
* Fix: macOS disabled menu item callback issue

Fixes bug where menu items that are initially disabled do not fire
their OnClick callbacks after being enabled via SetEnabled(true).

Problem:
- When creating disabled menu items, actions were not set
- When re-enabling, targets were not properly restored based on action type
- This caused callbacks to never fire for initially-disabled items

Solution:
1. Always set action during menu item creation regardless of disabled state
2. Set appropriate targets based on action type and disabled state
3. Enhanced setMenuItemDisabled to restore correct targets when re-enabling:
   - Custom callbacks (@selector(handleClick)): target = menuItem
   - Role-based actions (system selectors): target = nil (responder chain)

This ensures that menu items with OnClick callbacks work correctly
regardless of their initial disabled state.

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

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

* Update changelog

* Update changelog

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-08-02 20:22:09 +10:00
Lea Anthony
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>
2025-08-02 17:48:01 +10:00
Lea Anthony
55277fd695
feature: V3 alpha feature/snapassist support (#4463)
* initial implementation

* Push missed files

* linux fix

* Update changelog, runtime and docs.
2025-08-02 16:59:49 +10:00
TDF
6539c80ba2
Add goModTidy function to clean up Go module dependencies during inst… (#4286)
* Add goModTidy function to clean up Go module dependencies during installation (#4283)

* Add goModTidy function and update changelog for automatic execution after wails init (#4283)

* Update CLI documentation to clarify bypassing 'go mod tidy' during project initialization (#4283)

* Add -skipgomodtidy flag to CLI and update installation logic to conditionally run go mod tidy

* Update CLI documentation to reflect default value of -skipgomodtidy flag and clean up code (#4283)

* Update docs/src/content/docs/guides/cli.mdx

* fix changelog

---------

Co-authored-by: Triadmoko  Denny Fatrosa <triadmoko.fatrosa@codemi.co.id>
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
2025-08-02 15:51:30 +10:00
Lea Anthony
68c14d711b Prevent v3 workflow from running on PRs against master
Add explicit base_ref checks to ensure the v3 build and test workflow
only runs for PRs targeting the v3-alpha branch.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-02 14:03:23 +10:00
github-actions[bot]
afcdb15503 v3.0.0-alpha.17 2025-07-31 02:48:09 +00:00
Zach Botterman
48e3bd3dd4
[v3] bugfix/windows linux notifications (#4450) v3.0.0-alpha.17
* fix windows encoding

---------

Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
2025-07-30 12:40:58 +00:00
Lea Anthony
8d999ba34d Fix pipeline error
https://github.com/wailsapp/wails/actions/runs/16568203492/job/46853333131?pr=4446
2025-07-28 22:15:09 +10:00
Lea Anthony
5f1c2ff6dc Fix pipelines compile error 2025-07-28 21:34:57 +10:00
Lea Anthony
d9a003b56c
Merge and remove test release files 2025-07-26 08:26:56 +10:00
Lea Anthony
4721add9b8
Remove test release-notes.txt file 2025-07-26 08:21:14 +10:00
github-actions[bot]
09e71d82b5 v3.0.0-alpha.16 2025-07-25 22:17:30 +00:00
Lea Anthony
c2f25131d7
Fix YAML syntax error - indent heredoc content v3.0.0-alpha.16 2025-07-26 08:15:03 +10:00
Lea Anthony
a412b70be5
Fix nightly release workflow issues
- Fix backtick command substitution error using here-document
- Add extra spacing before disclaimer section
- Simplify commit message to just version number
2025-07-26 08:13:20 +10:00
Lea Anthony
81d1459b68
Add tests and documentation for --create-release-notes flag
- Add comprehensive test files for release notes creation
- Add edge case testing for empty changelogs and comments
- Add documentation explaining how the feature works
- Verify all functionality works as expected
2025-07-26 07:55:23 +10:00
Lea Anthony
db5b0dcd4b
Add --create-release-notes flag to release script 2025-07-26 07:45:37 +10:00
Lea Anthony
67058c0923
Fix UNRELEASED_CHANGELOG.md path in release script
The file is located at v3/UNRELEASED_CHANGELOG.md, not at the repository root
2025-07-25 22:03:26 +10:00
Lea Anthony
6dc51420ac
Update release workflow 2025-07-25 21:56:28 +10:00
github-actions[bot]
7bd1b4911c 🤖 Automated nightly release v3.0.0-alpha.15
Generated with [Claude Code](https://claude.ai/code)

    Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-25 11:47:24 +00:00
ALMAS
33a9c05213
[V3] feat: add Windows getAccentColor implementation (#4427) v3.0.0-alpha.15
* [V3] feat: add Windows getAccentColor implementation

---------

Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
2025-07-25 21:46:05 +10:00
Lea Anthony
9d6e6232d6
v3.0.0-alpha.14 2025-07-25 19:36:50 +10:00
Zach Botterman
23bf36d36f
[v3] improve service names for js/ts bindings (#4405) v3.0.0-alpha.13 v3.0.0-alpha.14
* name services

* update badge service with new app api

* update examples

* add dist dirs

* update changelog

* fix up examples

* Fix changelog

---------

Co-authored-by: Zach <zach@Zachs-MacBook-Pro-2.local>
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
2025-07-25 09:23:22 +10:00
Lea Anthony
906cd7003d
Fix TS error in runtime 2025-07-25 08:24:01 +10:00
Lea Anthony
f8e4eeb405
Fix build 2025-07-25 07:49:13 +10:00
Lea Anthony
9f2b992d36
Update changelog-validation-v3.yml 2025-07-25 07:43:59 +10:00
Lea Anthony
c08d2d72c3
Fix build 2025-07-25 07:31:29 +10:00
Lea Anthony
bf762699bd
Dark mode menus changelog 2025-07-25 06:41:28 +10:00
Lea Anthony
a29b4f0861
feat: Add full dark mode support for Windows menus 2025-07-25 06:31:46 +10:00
Atterpac
b5ef00fd42
Merge pull request #4289 from atterpac/v3/deeplink
V3 Deep-link (Port of v2 feature)
2025-07-23 15:24:59 -06:00
Lea Anthony
cc5b46cba1
Merge branch 'v3-alpha' into v3/deeplink 2025-07-22 21:46:04 +10:00
Lea Anthony
b566b1830d Fix CLI docs. Closes #4334 2025-07-22 07:06:49 +10:00
Lea Anthony
12022e4947 Fix tests for CI 2025-07-22 07:03:11 +10:00
Lea Anthony
4e2a3505bb
Update pull_request_template.md 2025-07-19 16:55:32 +10:00
Lea Anthony
fd89187c2f fix: remove branch restriction from nightly workflow job
The workflow now explicitly checks out v3-alpha branch, so the job-level
condition 'if: github.ref == refs/heads/v3-alpha' is no longer needed
and was preventing manual runs from other branches.
2025-07-18 14:44:12 +10:00
Lea Anthony
7a71836224 fix: explicitly checkout v3-alpha branch in nightly workflow
Ensures the workflow always checks out the v3-alpha branch regardless
of which branch triggers it (schedule from master or manual dispatch)
2025-07-17 06:59:29 +10:00
Lea Anthony
23e1f8923c Nightly release action 2025-07-17 06:28:19 +10:00
Atterpac
101b09676d Merge remote-tracking branch 'wails/v3-alpha' into v3/deeplink 2025-07-15 08:54:46 -06:00
Atterpac
810dfbb11b fix linux .desktop generation 2025-07-15 08:52:53 -06:00
Lea Anthony
e018ad6b92 v3.0.0-alpha.12 v3.0.0-alpha.12 2025-07-15 22:55:57 +10:00
Lea Anthony
234aea19bd Update runtime 2025-07-15 22:55:12 +10:00
Atterpac
5b88b485a9
window.ToggleFrameless() api (#4317)
* `window.ToggleFrameless() api`

* changelog and runtime version bump

---------

Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
2025-07-15 22:53:21 +10:00
Lea Anthony
112ba7ad4e Revert release script 2025-07-15 22:42:01 +10:00
Kodumulo
584872eb9a
[V3] fix: enhance doctor command to verify Windows SDK dependencies (#4392)
* fix: enhance doctor command to verify Windows SDK dependencies ([#4390](https://github.com/wailsapp/wails/issues/4390))

- Updated the doctor command to check for the presence of Windows SDK dependencies, improving the setup process for Windows users.
- Added relevant entry to the changelog for better documentation of this fix.

* Update changelog

---------

Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
2025-07-15 18:43:23 +10:00