Skip to content
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

Merged
merged 7 commits into from Jan 24, 2017
Merged

Add Toggle Output Scroll Lock action #18768

merged 7 commits into from Jan 24, 2017

Conversation

ArtemGovorov
Copy link
Contributor

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).

@msftclas
Copy link

Hi @ArtemGovorov, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!
You've already signed the contribution license agreement. Thanks!

The agreement was validated by Microsoft and real humans are currently evaluating your PR.

TTYL, MSBOT;

@ArtemGovorov
Copy link
Contributor Author

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).

Ok, so I found how to make the action checked state to consider the current active channel, added the commit to support it.

So what's left now is an icon and some CSS for the action-label to display the desired checked state (like a border or a separate background).

@@ -111,6 +111,11 @@ export interface IOutputChannel {
output: string;

/**
* Returns the value indicating whether the channel has scroll locked.
*/
hasScrollLock: boolean;
Copy link
Contributor

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();
Copy link
Contributor

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.

@isidorn
Copy link
Contributor

isidorn commented Jan 19, 2017

@ArtemGovorov PR looks good overall. Added 2 comments which you can see directly in the commits.
You could play around with the css and just use a temporary fake icon. For example this one
https://github.com/Microsoft/vscode/blob/master/src/vs/workbench/parts/preferences/browser/media/collapseAll.svg#L1

Once @bgashler1 provides a lock icon I can just replace it

@ArtemGovorov
Copy link
Contributor Author

@isidorn Thanks for reviewing it. I have fixed both comments.

@isidorn isidorn added this to the January 2017 milestone Jan 19, 2017
@isidorn
Copy link
Contributor

isidorn commented Jan 19, 2017

@ArtemGovorov great! Let's wait for the icon before we merge this in.
In the meantime feel free to experiment with css and a fake icon as I mentioned above.

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.

@ArtemGovorov
Copy link
Contributor Author

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.

In the meantime feel free to experiment with css and a fake icon as I mentioned above.

Cool, will be doing it now.

@ArtemGovorov
Copy link
Contributor Author

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.

ctrb

@isidorn
Copy link
Contributor

isidorn commented Jan 20, 2017

@ArtemGovorov looks great! Just one more minor thing please revert your changes to output.contribution.ts since our hygiene is failing since you introduced an unused import. In the end you should not have any changes in this file - thanks

@ArtemGovorov
Copy link
Contributor Author

@isidorn Thanks, done.

@bgashler1
Copy link
Contributor

bgashler1 commented Jan 23, 2017

Here are a couple of different options we could go with.
scroll-lock-icons

And attached are the assets.
881665_Brad_VSCodeOutputWindowScrollLock_TwoIdeas.zip

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.

@isidorn isidorn merged commit 9c9a615 into microsoft:master Jan 24, 2017
@isidorn isidorn mentioned this pull request Jan 24, 2017
2 tasks
@isidorn
Copy link
Contributor

isidorn commented Jan 24, 2017

Created test plan item #19138
Took the first icon. Will not swtich between icons but will draw a blue border when the action is active as we do in the find widget. I find that less confusing for the user.
Choose the first icon because we never render the scroll in the manner that the second icon is showin, and the first one is more general

@ArtemGovorov
Copy link
Contributor Author

Awesome, thanks! The icon looks great. So excited to see feature is being added to the next release!

@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants