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
feat: add app.isHidden API for macOS #32155
Conversation
API LGTM |
It looks like CI timed out but I'm unable to re-run it. There shouldn't be any test failures. |
Should perhaps also be exposed as |
@nornagon the reason I didn't add a getter is because there is no setter (unless |
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.
Looks like newly added tests are failing
@mitchchn I don't feel strongly enough about it to block this, so API LGTM. |
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.
API LGTM
@jkleinsc hiding and unhiding is async. To reliably wait on these events in the test suite I would need to expose "hide" and "unhide" events on |
@mitchchn you can use the
|
01c707f
to
fc1c9b5
Compare
Co-authored-by: Samuel Maddock <samuel.maddock@gmail.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.
API LGTM
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.
API LGTM
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.
The documentation for this feature needs to specify that the return value is a boolean so that the typescript generator can properly label this function's return value.
Co-authored-by: John Kleinschmidt <jkleinsc@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.
The new test should use the ifdescribe
helper
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
@jkleinsc: thanks for your review feedback. Is there anything left for me to do here? It looks like CI is timing out, not failing on my test, but if that's not the case I can investigate. |
Release Notes Persisted
|
I was unable to backport this PR to "18-x-y" cleanly; |
I was unable to backport this PR to "19-x-y" cleanly; |
* feat: add app.isHidden API * Update docs/api/app.md Co-authored-by: Samuel Maddock <samuel.maddock@gmail.com> * fixed isHidden tests * Update docs/api/app.md Co-authored-by: John Kleinschmidt <jkleinsc@github.com> * Update spec-main/api-app-spec.ts Co-authored-by: John Kleinschmidt <jkleinsc@github.com> Co-authored-by: Samuel Maddock <samuel.maddock@gmail.com> Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
* feat: add app.isHidden API * Update docs/api/app.md Co-authored-by: Samuel Maddock <samuel.maddock@gmail.com> * fixed isHidden tests * Update docs/api/app.md Co-authored-by: John Kleinschmidt <jkleinsc@github.com> * Update spec-main/api-app-spec.ts Co-authored-by: John Kleinschmidt <jkleinsc@github.com> Co-authored-by: Samuel Maddock <samuel.maddock@gmail.com> Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
Description of Change
Refs #30485.
Added an API to check if the app is hidden on macOS. This is a distinct state from the app windows being hidden, and can be used to implement unique behaviour on activation. It is also useful in conjunction with
NSWindow.canHide
, which I will introduce in a follow-up MR if there are no objections.Checklist
npm test
passesRelease Notes
Notes: Added
app.isHidden()
to check if the app is hidden (e.g. with Command-H) on macOS.