-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix docs for JS return types in Window API #3247
Conversation
These functions return promises, not raw values.
WalkthroughThe recent updates bring two significant enhancements: the addition of a right-click exit feature on the dock icon for better user interaction and a substantial overhaul to the Window API documentation. The documentation now emphasizes asynchronous operations by returning Promises, aligning the API with modern JavaScript practices for improved usability and clarity. Changes
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? TipsChatThere are 3 ways to chat with CodeRabbit:
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 as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (2)
- website/src/pages/changelog.mdx (2 hunks)
- website/versioned_docs/version-v2.7.0/reference/runtime/window.mdx (7 hunks)
Additional comments: 9
website/versioned_docs/version-v2.7.0/reference/runtime/window.mdx (7)
- 35-35: The return type for
WindowIsFullscreen
is updated toPromise<boolean>
. Ensure all examples and usage guides in the documentation are updated to reflect asynchronous handling of this function.- 113-113: The return type for
WindowIsNormal
is updated toPromise<boolean>
. Similar toWindowIsFullscreen
, verify that all related documentation sections correctly demonstrate handling promises.- 127-127: The return type for
WindowGetSize
is updated toPromise<Size>
. This change requires updating any related examples to demonstrate how to work with theSize
object returned by a promise.- 154-154: The
WindowSetAlwaysOnTop
function's documentation does not reflect a change to a promise-based return type, yet it's listed in the summary. Confirm whether this function should return a promise and update the documentation accordingly.- 168-168: The return type for
WindowGetPosition
is updated toPromise<Position>
. Ensure that examples and usage guides are updated to reflect the asynchronous nature of this function.- 189-189: The return type for
WindowIsMaximised
is updated toPromise<boolean>
. Verify that all related documentation sections correctly demonstrate handling promises for this function.- 217-217: The return type for
WindowIsMinimised
is updated toPromise<boolean>
. Ensure that examples and usage guides in the documentation are updated to reflect asynchronous handling of this function.website/src/pages/changelog.mdx (2)
- 24-24: The entry for PR [v2/Mac] Handle application terminate #3157 is correctly added under the "Added" section.
- 34-34: The entry for PR Fix docs for JS return types in Window API #3247 is correctly added under the "Fixed" section.
Thanks for this! Could you possibly edit the non-versioned docs as that means we'll get to keep it as the versions are cycled. Thank you. |
And the "edit this page" button made it sound so easy... I also noticed that the return type syntax is inconsistent on that page (colon vs. no colon), but I'm not planning on doing anything about that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 1
Configuration used: CodeRabbit UI
Files selected for processing (1)
- website/docs/reference/runtime/window.mdx (7 hunks)
Additional comments: 6
website/docs/reference/runtime/window.mdx (6)
- 35-35: The documentation correctly updates
WindowIsFullscreen()
to return aPromise<boolean>
, aligning with the PR's objective to accurately reflect the asynchronous nature of these functions.- 113-113: The update to
WindowIsNormal()
to return aPromise<boolean>
is consistent with the PR's goal of clarifying the return types of functions to indicate their asynchronous behavior.- 154-154: The correction of the typo from
Boolen
toboolean
in theWindowSetAlwaysOnTop()
method improves the documentation's clarity and correctness.- 168-168: The documentation update for
WindowGetPosition()
to return aPromise<Position>
is in line with the PR's objectives, ensuring developers are aware of the asynchronous nature of this function.- 189-189: Updating
WindowIsMaximised()
to return aPromise<boolean>
correctly reflects the asynchronous behavior of the function, aligning with the PR's goal of improving documentation accuracy.- 217-217: The change to
WindowIsMinimised()
to return aPromise<boolean>
is consistent with the PR's objectives, accurately indicating the function's asynchronous return type.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (1)
- website/docs/reference/runtime/window.mdx (7 hunks)
Files skipped from review as they are similar to previous changes (1)
- website/docs/reference/runtime/window.mdx
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jangler
Description
These Window API functions return promises, not raw values. This was not documented. Also fixed a typo in the relevant document.
Type of change
How Has This Been Tested?
Test Configuration
n/a
Checklist:
website/src/pages/changelog.mdx
with details of this PRHopefully the PR number I predicted in the changelog edit turns out to be right.
Summary by CodeRabbit
New Features
Documentation