Skip to content

V3 alpha feature/start window position#3885

Merged
leaanthony merged 4 commits into
v3-alphafrom
v3-alpha-feature/start-window-position
Nov 15, 2024
Merged

V3 alpha feature/start window position#3885
leaanthony merged 4 commits into
v3-alphafrom
v3-alpha-feature/start-window-position

Conversation

@leaanthony

@leaanthony leaanthony commented Nov 15, 2024

Copy link
Copy Markdown
Member

Description

This change adds a new InitialPosition option to WebviewWindowOptions to determine where the window should be initially positioned. Valid options are:

  • WindowCentered - Center on start
  • WindowXY - Place the window at the position specified by the X and Y option values

Summary by CodeRabbit

Release Notes

  • New Features

    • Introduced a new option for window positioning (InitialPosition), allowing users to specify coordinates or center the window.
    • Added menu options for creating new WebviewWindow instances: "New WebviewWindow (Centered)" and "New WebviewWindow (Position 100,100)."
  • Bug Fixes

    • Resolved issues with the AlwaysOnTop feature on macOS and a duplicate role in the edit menu for Darwin systems.
  • Improvements

    • Enhanced event handling and window positioning logic across platforms, ensuring better usability and flexibility.
  • Documentation

    • Updated changelog to reflect new features, changes, and fixes in a structured format.

@coderabbitai

coderabbitai Bot commented Nov 15, 2024

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

Walkthrough

The pull request introduces significant updates to the project, including enhancements to window management features and a structured changelog. New functionalities allow for specifying window positions through an InitialPosition option, which replaces the previous boolean flag for centering. The Taskfile has been refactored, and several platform-specific adjustments have been made to improve window behavior across macOS, Linux, and Windows. Additionally, various bug fixes and improvements have been documented, ensuring clarity and organization in the changelog.

Changes

File Path Change Summary
mkdocs-website/docs/en/changelog.md Updated changelog to include new features, changes, and fixes; structured according to "Keep a Changelog" format.
v3/examples/window/main.go Added menu items for creating new WebviewWindow instances: "Centered" and "Position 100,100".
v3/pkg/application/webview_window.go Modified Center, OnWindowEvent, and RegisterHook methods for improved window positioning and event handling.
v3/pkg/application/webview_window_darwin.go Updated windowCenter and windowSetPosition functions to enhance window centering and positioning logic.
v3/pkg/application/webview_window_linux.go Refined initial positioning logic in linuxWebviewWindow struct; replaced specific coordinate checks with InitialPosition.
v3/pkg/application/webview_window_options.go Introduced WindowStartPosition type and InitialPosition field; removed Centered field from WebviewWindowOptions.
v3/pkg/application/webview_window_windows.go Altered initialization logic for window centering; refined methods for managing window styles and behaviors.

Possibly related PRs

  • [V3 Templates] Add Sveltekit and Sveltekit TS templates #3829: The addition of SvelteKit and SvelteKit TS templates is relevant as it aligns with the main PR's updates regarding templates for SvelteKit, enhancing the documentation and usability of the project.
  • [mac] fix always on top during window creation #3841: The fix for the AlwaysOnTop functionality during window creation is related to the main PR's updates, which also address the AlwaysOnTop feature on macOS, ensuring consistency in functionality across platforms.
  • [V3/Docs] Add Events documentation #3867: The addition of events documentation enhances the overall understanding of event handling in the application, which is relevant to the main PR's updates that include improvements to the Events API and related functionalities.

🐰 In the meadow where we play,
New windows bloom, bright as day.
Centered or placed at a spot,
Our changes make the fun a lot!
With options new, we hop and cheer,
A joyful update, let’s all draw near! 🥕


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying wails with  Cloudflare Pages  Cloudflare Pages

Latest commit: 8d50a2b
Status:⚡️  Build in progress...

View logs

@wailsapp wailsapp deleted a comment from sonarqubecloud Bot Nov 15, 2024
@leaanthony leaanthony merged commit 3e00b39 into v3-alpha Nov 15, 2024
@leaanthony leaanthony deleted the v3-alpha-feature/start-window-position branch November 15, 2024 23:10
Grantmartin2002 pushed a commit to Grantmartin2002/wails that referenced this pull request Apr 29, 2026
* New InitialPosition setting

* Fix mac inverted Y issue.
Fix mac centering issue.

* Change position text in example

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant