wails icon indicating copy to clipboard operation
wails copied to clipboard

`window.ToggleFrameless() api`

Open atterpac opened this issue 8 months ago β€’ 2 comments

Implements the window.ToggleFrameless() api internally it just uses the window.setFrameless toggling it as the opposite of the current value so Developer does not need to card about the current state to swap it

Changes:

  • Runtime will need to be updated on dev machines as I reorganized the message processor values to keep the ToggleXXX in the same range
  • Regenerated new events
  • Updated messageprocessor_window.go
  • Updated runtime window.ts
  • Updated API example in `v3/examples/

Summary by CodeRabbit

  • New Features

    • Added the ability to toggle the window between frameless and normal states via a new API method and UI button in the frameless window example.
  • Documentation

    • Updated the changelog to include the new window toggling feature.
  • Style

    • Improved code readability with consistent multi-line formatting in several function signatures and calls.

atterpac avatar May 29 '25 15:05 atterpac

Walkthrough

A new ToggleFrameless() API method has been introduced, allowing windows to toggle between frameless and normal states. This addition required updates across the runtime, event types, changelog, and example assets. Associated event IDs, constants, and exported interfaces were updated, and a new event type and handler were added to support this feature.

Changes

Files/Paths Change Summary
v3/internal/runtime/desktop/@wailsio/runtime/src/window.ts, .../event_types.ts Added ToggleFrameless() method to Window class and new event type constant.
v3/pkg/application/window.go, .../webview_window.go, .../messageprocessor_window.go Added ToggleFrameless method to Window interface, implementation, and message processor logic.
v3/pkg/events/events.go, .../events.txt, .../events_darwin.h, .../events_linux.h Added new event ID and constant for WindowToggleFrameless; incremented related event IDs.
v3/internal/assetserver/bundledassets/runtime.js Refactored and reordered runtime code; added ToggleFrameless() to exported Window class.
v3/examples/frameless/assets/index.html Added UI button and JS handler to trigger window.wails.Window.ToggleFrameless().
docs/src/content/docs/changelog.mdx Documented new ToggleFrameless() API in the changelog.
v3/internal/runtime/desktop/@wailsio/runtime/package.json Bumped package version from 3.0.0-alpha.67 to 3.0.0-alpha.68.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant UI (HTML/JS)
    participant Runtime JS (window.ts)
    participant Go Backend (window.go/webview_window.go)
    participant OS Window

    User->>UI (HTML/JS): Click "Toggle Frameless" button
    UI (HTML/JS)->>Runtime JS: window.wails.Window.ToggleFrameless()
    Runtime JS->>Go Backend: Invoke ToggleFrameless method
    Go Backend->>OS Window: Toggle frameless state
    OS Window-->>Go Backend: Frameless state toggled
    Go Backend-->>Runtime JS: Success/acknowledgement
    Runtime JS-->>UI (HTML/JS): (Optional) Update UI or state

Suggested labels

Enhancement, cli, Windows, MacOS, Linux, size:XL

Poem

A rabbit hopped up to the screen,
Saw windows shift from seen to unseenβ€”
With frameless toggles, click and gleam,
The borders vanish, so pristine!
Code and carrots, side by side,
In alpha sixty-eight we ride.
πŸ‡βœ¨


πŸ“œ Recent review details

Configuration used: .coderabbit.yaml Review profile: CHILL Plan: Pro

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 9925803d211ae83d8a3a8197077fb8dd25e35090 and c86530df75a1d6b4de91fd39d8c0b15b45703386.

πŸ“’ Files selected for processing (3)
  • docs/src/content/docs/changelog.mdx (1 hunks)
  • v3/pkg/application/webview_window.go (5 hunks)
  • v3/pkg/events/events.go (5 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • docs/src/content/docs/changelog.mdx
  • v3/pkg/application/webview_window.go
  • v3/pkg/events/events.go
✨ Finishing Touches
  • [ ] πŸ“ Generate Docstrings

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
πŸͺ§ 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this 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.

coderabbitai[bot] avatar May 29 '25 15:05 coderabbitai[bot]

Quality Gate Failed Quality Gate failed

Failed conditions
3.4% Duplication on New Code (required ≀ 3%)

See analysis details on SonarQube Cloud

sonarqubecloud[bot] avatar Jul 15 '25 08:07 sonarqubecloud[bot]