-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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
Add Toggle Output Scroll Lock action #18768
Conversation
Hi @ArtemGovorov, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution! The agreement was validated by Microsoft and real humans are currently evaluating your PR. TTYL, MSBOT; |
Ok, so I found how to make the action So what's left now is an icon and some CSS for the |
@@ -111,6 +111,11 @@ export interface IOutputChannel { | |||
output: string; | |||
|
|||
/** | |||
* Returns the value indicating whether the channel has scroll locked. | |||
*/ | |||
hasScrollLock: 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.
I would rename this to scrollLock
, as outputChannel.hasScrollLock = false
sounds strange to me
} | ||
|
||
public run(): TPromise<any> { | ||
const activeChannel = this.outputService.getActiveChannel(); |
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.
What if there is no active output channel (output hidden) and this command is triggered from the command pallete?
You either need a null check here or even better do not register this action as a global workbench action as I do not see people assigning shortcuts to this action or triggering it via command pallete.
@ArtemGovorov PR looks good overall. Added 2 comments which you can see directly in the commits. Once @bgashler1 provides a lock icon I can just replace it |
@isidorn Thanks for reviewing it. I have fixed both comments. |
@ArtemGovorov great! Let's wait for the icon before we merge this in. There seems to be build errors as our travis build is falling, can you also please look into that? As far as I see it seems like the Label and Id are needed on the action. |
Oops, my fault. Added these properties back.
Cool, will be doing it now. |
Added the styles for the checked state. As for the icon, foe now I just copy.pasted the Clear Output icon content, so all that's left is to replace the SVG in the 2 icons files (normal and inverted) with the new icon. |
@ArtemGovorov looks great! Just one more minor thing please revert your changes to |
@isidorn Thanks, done. |
Here are a couple of different options we could go with. And attached are the assets. Since we don't have a pattern today in our UX for state representation of icons (other than badging or swapping), my proposal would be to swap the icons out as shown above when the state changes. |
Created test plan item #19138 |
Awesome, thanks! The icon looks great. So excited to see feature is being added to the next release! |
As discussed here #18589 (comment).
@isidorn I have implemented the action and added it to the panel, but it's missing the icon. I'm also not sure how to make the action button reflect if the output is locked or not. Perhaps it's possible to use the action
checked
property and style the checked button in the same CSS file where the icon will be referenced, but the issue is that the action is not channel specific (ie there's only one instance of the action per panel, not per channel).