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

Resolves #57507 - Allows clicking of Modified In labels in setting editor view #60045

Merged
merged 1 commit into from
Oct 6, 2018

Conversation

w9jds
Copy link
Contributor

@w9jds w9jds commented Oct 5, 2018

Exposed target changing in the action bar, and moved the Modified In label to a link. This should properly switch between views and automatically filter the list based on category and label name.

@w9jds w9jds changed the title resolves #57507 adds modified in navigable in settings editor Resolves #57507 - Allows clicking of Modified In labels in setting editor view Oct 5, 2018
Copy link
Member

@roblourens roblourens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great! My comments:

  • Only the scope name should be underlined, like "Also modified in: __User__"
  • Instead of putting the display name in the search bar, put the setting key (files.autoSave) there. Then only that one setting will be displayed.

@w9jds
Copy link
Contributor Author

w9jds commented Oct 6, 2018

🤦‍♂️ That makes way more sense than just assuming the first item in the array

@w9jds w9jds force-pushed the modified-in-navigation branch 2 times, most recently from 645f626 to 1251cfd Compare October 6, 2018 01:37
DOM.addStandardDisposableListener(view, DOM.EventType.CLICK, (e: IMouseEvent) => {
this._onDidClickOverrideElement.fire({
targetKey: element.setting.key,
scope: element.overriddenScopeList[i]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't this always reference the last item in the list, because it will point to i in the closure scope, which is always incremented to the length of the list?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, that is a fantastic point, let me test it really quick.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, testing locally seems to indicate that when it creates the listener and anonymous function is retains the state of the scoped variable. When I manually pushed in a second option it properly used the correct index on click.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right - seems that this works with let but does not work with var. I can't drop the old school habits.

template.otherOverridesElement.textContent = `(${otherOverridesLabel}: ${element.overriddenScopeList.join(', ')})`;
} else {
template.otherOverridesElement.textContent = '';
DOM.append(template.otherOverridesElement, $('span', null, `${otherOverridesLabel}: `));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we keep the () around the text?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely! I'll add it now.

@w9jds w9jds force-pushed the modified-in-navigation branch from 1251cfd to 30fbbd7 Compare October 6, 2018 04:03
Copy link
Member

@roblourens roblourens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks!

@roblourens roblourens merged commit c09511c into microsoft:master Oct 6, 2018
@roblourens roblourens added this to the October 2018 milestone Oct 9, 2018
@w9jds w9jds deleted the modified-in-navigation branch October 6, 2019 05:23
@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.

2 participants