mirror of
https://github.com/wailsapp/wails.git
synced 2026-03-16 15:45:50 +01:00
* 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>
|
||
|---|---|---|
| .. | ||
| assets/alpha | ||
| internal/tests | ||
| application.go | ||
| application_android.go | ||
| application_android_nocgo.go | ||
| application_darwin.go | ||
| application_darwin.h | ||
| application_darwin_delegate.h | ||
| application_darwin_delegate.m | ||
| application_debug.go | ||
| application_dev.go | ||
| application_ios.go | ||
| application_ios.h | ||
| application_ios.m | ||
| application_ios_delegate.h | ||
| application_ios_delegate.m | ||
| application_linux.go | ||
| application_options.go | ||
| application_production.go | ||
| application_windows.go | ||
| bindings.go | ||
| bindings_test.go | ||
| browser_manager.go | ||
| clipboard.go | ||
| clipboard_android.go | ||
| clipboard_darwin.go | ||
| clipboard_ios.go | ||
| clipboard_linux.go | ||
| clipboard_manager.go | ||
| clipboard_windows.go | ||
| context.go | ||
| context_application_event.go | ||
| context_menu_manager.go | ||
| context_window_event.go | ||
| dialog_manager.go | ||
| dialogs.go | ||
| dialogs_android.go | ||
| dialogs_darwin.go | ||
| dialogs_darwin_delegate.h | ||
| dialogs_darwin_delegate.m | ||
| dialogs_ios.go | ||
| dialogs_linux.go | ||
| dialogs_windows.go | ||
| dialogs_windows_test.go | ||
| environment.go | ||
| environment_manager.go | ||
| errors.go | ||
| event_manager.go | ||
| events.go | ||
| events_common_android.go | ||
| events_common_darwin.go | ||
| events_common_ios.go | ||
| events_common_linux.go | ||
| events_common_windows.go | ||
| events_loose.go | ||
| events_strict.go | ||
| events_test.go | ||
| image.go | ||
| init_android.go | ||
| init_desktop.go | ||
| init_ios.go | ||
| ios_runtime_api.go | ||
| ios_runtime_ios.go | ||
| ios_runtime_stub.go | ||
| key_binding_manager.go | ||
| keys.go | ||
| keys_android.go | ||
| keys_darwin.go | ||
| keys_ios.go | ||
| keys_linux.go | ||
| keys_windows.go | ||
| linux_cgo.go | ||
| linux_purego.go | ||
| logger_dev.go | ||
| logger_dev_windows.go | ||
| logger_ios.go | ||
| logger_prod.go | ||
| mainthread.go | ||
| mainthread_android.go | ||
| mainthread_darwin.go | ||
| mainthread_ios.go | ||
| mainthread_linux.go | ||
| mainthread_windows.go | ||
| menu.go | ||
| menu_android.go | ||
| menu_darwin.go | ||
| menu_ios.go | ||
| menu_linux.go | ||
| menu_manager.go | ||
| menu_test.go | ||
| menu_windows.go | ||
| menuitem.go | ||
| menuitem_android.go | ||
| menuitem_darwin.go | ||
| menuitem_darwin.h | ||
| menuitem_darwin.m | ||
| menuitem_dev.go | ||
| menuitem_ios.go | ||
| menuitem_linux.go | ||
| menuitem_production.go | ||
| menuitem_roles.go | ||
| menuitem_selectors_darwin.go | ||
| menuitem_test.go | ||
| menuitem_windows.go | ||
| messageprocessor.go | ||
| messageprocessor_android.go | ||
| messageprocessor_application.go | ||
| messageprocessor_args.go | ||
| messageprocessor_browser.go | ||
| messageprocessor_call.go | ||
| messageprocessor_clipboard.go | ||
| messageprocessor_contextmenu.go | ||
| messageprocessor_dialog.go | ||
| messageprocessor_events.go | ||
| messageprocessor_ios.go | ||
| messageprocessor_mobile_stub.go | ||
| messageprocessor_screens.go | ||
| messageprocessor_system.go | ||
| messageprocessor_window.go | ||
| panic_handler.go | ||
| path.go | ||
| popupmenu_windows.go | ||
| roles.go | ||
| roles_dev.go | ||
| roles_production.go | ||
| screen_android.go | ||
| screen_darwin.go | ||
| screen_ios.go | ||
| screen_linux.go | ||
| screen_windows.go | ||
| screenmanager.go | ||
| screenmanager_test.go | ||
| services.go | ||
| signal_handler_android.go | ||
| signal_handler_desktop.go | ||
| signal_handler_ios.go | ||
| signal_handler_types_android.go | ||
| signal_handler_types_desktop.go | ||
| signal_handler_types_ios.go | ||
| single_instance.go | ||
| single_instance_android.go | ||
| single_instance_darwin.go | ||
| single_instance_ios.go | ||
| single_instance_linux.go | ||
| single_instance_windows.go | ||
| system_tray_manager.go | ||
| systemtray.go | ||
| systemtray_android.go | ||
| systemtray_darwin.go | ||
| systemtray_darwin.h | ||
| systemtray_darwin.m | ||
| systemtray_ios.go | ||
| systemtray_linux.go | ||
| systemtray_windows.go | ||
| TODO.md | ||
| transport.go | ||
| transport_event_ipc.go | ||
| transport_http.go | ||
| urlvalidator.go | ||
| urlvalidator_test.go | ||
| webview_window.go | ||
| webview_window_android.go | ||
| webview_window_close_darwin.go | ||
| webview_window_darwin.go | ||
| webview_window_darwin.h | ||
| webview_window_darwin.m | ||
| webview_window_darwin_dev.go | ||
| webview_window_darwin_drag.h | ||
| webview_window_darwin_drag.m | ||
| webview_window_darwin_production.go | ||
| webview_window_ios.go | ||
| webview_window_ios.h | ||
| webview_window_ios.m | ||
| webview_window_linux.go | ||
| webview_window_linux_dev.go | ||
| webview_window_linux_production.go | ||
| webview_window_options.go | ||
| webview_window_windows.go | ||
| webview_window_windows_devtools.go | ||
| webview_window_windows_production.go | ||
| window.go | ||
| window_manager.go | ||