-
Notifications
You must be signed in to change notification settings - Fork 851
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
[MM-62205] Dynamically toggle widget window visibility when popout opens/closes #3253
Conversation
Nice solve @streamer45. I like this as a solution and I think it will solve the biggest part of the issue. I've triggered a build to test and play with a bit and I'll report back. |
Thanks @matthewbirtch . I think both are unrelated to this PR. For 1, I am honestly surprised this wasn't reported before but I'll have a look asap. Created https://mattermost.atlassian.net/browse/MM-62241 For 2, from what I remember, that's always been the case since the widget is effectively its own window. Excluding it may require us to do some pattern matching on the window title because (as far as I know) there isn't a great way to uniquely identify that specific window from the sources returned by the desktop capturing engine. I'll see what can be done. Created https://mattermost.atlassian.net/browse/MM-62242 |
Hmm, interesting. I tried to replicate both of these things on hub with desktop v5.10.1 and didn't get the same result. |
On Linux (both 5.9 and 5.10), I can definitely see the widget being among the windows available to share. But yeah, I can't reproduce the sharing from popout issue outside of |
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.
Nice little QoL fix :)
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.
Thank you for tackling this so quickly - this addresses my concerns with the widget 👍
Approving, but just have a minor non-blocking suggestion about the name of a function.
@@ -233,16 +233,31 @@ export class CallsWidgetWindow { | |||
ev.preventDefault(); | |||
}; | |||
|
|||
private toggleWidgetVisibility = (flag: boolean) => { |
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.
suggestion: I initially found the visibility
terminology here confusing, and thought the purpose of this function was to hide/show the widget. Could we use a name more specific to what we're toggling? e.g. it seems the purpose here is to toggle if the widget should be shown on all workspaces on top of other windows.
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.
@davidkrauser Thanks. You know what they say about naming things :p
For fun, I asked Copilot for a better function name, but its response was far from convincing (it is still using the word visibility). Do you happen to have a suggestion in mind?
Maybe we could use something like priority since we are essentially mutating the level of the window.
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.
You know what they say about naming things
I know, right? 😅
I like priority - maybe something like setWindowHighPriority(bool)
?
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.
Priority could be confusing too... Maybe setWindowHighZIndex
because we're kind of talking about window z-indexes?
(apologies for the bikeshedding)
Ok, let me know if you want to look in to this as part of this PR or not. Happy to help test |
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.
Approving as the issues I identified don't appear to be a part of this PR. Thanks @streamer45!
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!
@@ -233,16 +233,31 @@ export class CallsWidgetWindow { | |||
ev.preventDefault(); | |||
}; | |||
|
|||
private toggleWidgetVisibility = (flag: boolean) => { |
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.
Priority could be confusing too... Maybe setWindowHighZIndex
because we're kind of talking about window z-indexes?
(apologies for the bikeshedding)
@@ -233,16 +233,31 @@ export class CallsWidgetWindow { | |||
ev.preventDefault(); | |||
}; | |||
|
|||
private toggleWidgetVisibility = (flag: boolean) => { |
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.
Another: flag
has little meaning... Anything else would be better, imo. highIndex
highVisibility
etc.?
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.
@cpoile Interestingly, I copied that arg name straight from the Electron API for one of those methods :) I'll see what I can do.
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.
Awesome! :)
Summary
PR adds some logic to dynamically change the global Calls widget visibility when the popout window is open. This is to address the inconvenience of having this window always on top even when focusing on the popout.
Hiding the widget completely is also possible, but I still feel it's a more impactful change in behavior. My hope is that the proposed changes are enough to address the reported issue. That said, let me know if you feel strongly about this.
The previous conversation for extra context is at https://hub.mattermost.com/private-core/pl/wbf4jd67g7fnpmon8fafwnxmuy
Video
widget_visibility.mp4
Ticket Link
https://mattermost.atlassian.net/browse/MM-62205
Release Note