Skip to content

Conversation

@ndianabasi
Copy link

@ndianabasi ndianabasi commented Dec 22, 2025

Description

This PR updates the docs page for keyboard shortcuts and corrects the type of the callback parameter for KeyBinding.Add.

Fixes # (issue)

Type of change

Please select the option that is relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration using wails doctor.

  • Windows
  • macOS
  • Linux

If you checked Linux, please specify the distro and version.

Test Configuration

Please paste the output of wails doctor. If you are unable to run this command, please describe your environment in as much detail as possible.

Checklist:

  • I have updated website/src/pages/changelog.mdx with details of this PR
  • My code follows the general coding style of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Summary by CodeRabbit

  • Documentation
    • Updated keyboard shortcuts documentation with corrected callback parameter types in code examples, ensuring developers have accurate and consistent patterns for implementing keyboard bindings across their applications. This improves clarity in API usage and provides better guidance for best practices.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 22, 2025

Walkthrough

Documentation updates to keyboard shortcuts examples replace callback parameter types from *application.WebviewWindow to application.Window across multiple code snippets and function signatures. Changelog entry documents this documentation correction.

Changes

Cohort / File(s) Summary
Keyboard shortcuts documentation
docs/src/content/docs/features/keyboard/shortcuts.mdx
Updated callback parameter types in KeyBinding.Add examples and function signatures (openFile, showKeyboardShortcuts, exitEditModeHandler) from *application.WebviewWindow to application.Window across basic, platform-specific, dynamic, and complete example sections.
Changelog
v3/UNRELEASED_CHANGELOG.md
Added changelog entry documenting the keyboard shortcuts documentation fix and parameter type correction.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

Suggested labels

Documentation, v3-alpha, size:M, lgtm

Suggested reviewers

  • leaanthony

Poem

🐰 With keys and callbacks, the docs now align,
From WebviewWindow to Window so fine,
Each shortcut example now brightly does shine,
A hop toward clarity, revision divine! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: updating the window type parameter from WebviewWindow to Window across the documentation examples.
Description check ✅ Passed The description covers the main purpose and is mostly complete, but lacks a specific issue reference in the 'Fixes' line and provides no test configuration details despite the section being present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9174be7 and d74bfda.

📒 Files selected for processing (2)
  • docs/src/content/docs/features/keyboard/shortcuts.mdx
  • v3/UNRELEASED_CHANGELOG.md
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: nixpare
Repo: wailsapp/wails PR: 3763
File: v3/pkg/application/application_options.go:93-93
Timestamp: 2024-10-08T22:11:37.054Z
Learning: The `KeyBindings` property of `application.Option` uses the `application.Window` type, while `application.WebviewWindowOptions` still accepts `*application.WebviewWindow`, and this is intentional.
Learnt from: nixpare
Repo: wailsapp/wails PR: 3763
File: v3/examples/keybindings/main.go:16-17
Timestamp: 2024-09-20T23:34:29.841Z
Learning: In the codebase, `application.Options.KeyBindings` uses the `application.Window` type, whereas `application.WebviewWindowOptions.KeyBindings` uses `*application.WebviewWindow`. This is intentional and acceptable.
Learnt from: leaanthony
Repo: wailsapp/wails PR: 4783
File: v3/pkg/events/events.go:72-100
Timestamp: 2025-12-13T19:52:13.812Z
Learning: In Wails v3, the linux:WindowLoadChanged event was intentionally removed as a breaking change and replaced with four granular WebKit2 load events: linux:WindowLoadStarted, linux:WindowLoadRedirected, linux:WindowLoadCommitted, and linux:WindowLoadFinished. Users should migrate to linux:WindowLoadFinished for detecting when the WebView has finished loading.
📚 Learning: 2024-09-20T23:34:29.841Z
Learnt from: nixpare
Repo: wailsapp/wails PR: 3763
File: v3/examples/keybindings/main.go:16-17
Timestamp: 2024-09-20T23:34:29.841Z
Learning: In the codebase, `application.Options.KeyBindings` uses the `application.Window` type, whereas `application.WebviewWindowOptions.KeyBindings` uses `*application.WebviewWindow`. This is intentional and acceptable.

Applied to files:

  • docs/src/content/docs/features/keyboard/shortcuts.mdx
📚 Learning: 2024-10-08T22:11:37.054Z
Learnt from: nixpare
Repo: wailsapp/wails PR: 3763
File: v3/pkg/application/application_options.go:93-93
Timestamp: 2024-10-08T22:11:37.054Z
Learning: The `KeyBindings` property of `application.Option` uses the `application.Window` type, while `application.WebviewWindowOptions` still accepts `*application.WebviewWindow`, and this is intentional.

Applied to files:

  • docs/src/content/docs/features/keyboard/shortcuts.mdx
🔇 Additional comments (4)
docs/src/content/docs/features/keyboard/shortcuts.mdx (3)

142-349: Consistent type correction in advanced examples.

All advanced usage examples and best practices sections correctly use application.Window for both inline callbacks and named function parameters. The change to exitEditModeHandler at line 345 properly updates the named function signature as well.


370-430: Complete example properly updated.

The complete example demonstrates correct usage with all callbacks and helper functions (openFile, showKeyboardShortcuts) using application.Window. This provides users with accurate, working code that matches the actual API.


32-78: Documentation examples are accurate.

The key binding callback parameter type is correctly documented as application.Window, which aligns with the actual API signature where KeyBindingManager.Add expects callback func(window Window). All examples in this section consistently use the correct callback signature.

v3/UNRELEASED_CHANGELOG.md (1)

27-27: Changelog entry accurately describes the documentation fix.

The entry correctly categorizes this as a documentation correction under the "Fixed" section and clearly describes both aspects of the change: updating the docs page and correcting the callback parameter type.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants