Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Conversation

shana
Copy link
Contributor

@shana shana commented Jan 12, 2016

Fixes #106

This needs:

shana and others added 11 commits January 7, 2016 15:35
Quick stub of the VS file apis required for a potential "Get Link"
feature - gets the current file name and line number to build a github
url of it for sharing.
Tests are failing on the buildbot and it looks like it's because one
test is clobbering data for another test. The only thing these tests
share is the global ServiceProvider set, so put these test classes in
the same collection so xunit doesn't parallelize them.
@shana shana self-assigned this Jan 13, 2016
@shana shana added the feature label Jan 13, 2016
@shana shana changed the title Feature: Link from code to GitHub via context menus [WIP] Feature: Link from code to GitHub via context menus Jan 13, 2016
@shana
Copy link
Contributor Author

shana commented Feb 8, 2016

This is how it looks like currently.

@donokuda @haacked Should we keep these context menu entries like this (considering we have potentially more context menus to add), or should we have a GitHub context menu entry with these as submenus?

copylink

@shana shana changed the title [WIP] Feature: Link from code to GitHub via context menus Feature: Link from code to GitHub via context menus Feb 8, 2016
@shana shana assigned haacked and unassigned shana Feb 8, 2016
@shana
Copy link
Contributor Author

shana commented Feb 8, 2016

@haacked This is ready for 👀. A few things in here are part of PR #220 so might want to deal with that one first.

@haacked
Copy link
Contributor

haacked commented Feb 8, 2016

People gonna be upset if we add too much to the context menu. If there isn't already a grouping that makes sense, we should group our commands in a top level "GitHub" menu.

@donokuda
Copy link
Contributor

donokuda commented Feb 8, 2016

People gonna be upset if we add too much to the context menu. If there isn't already a grouping that makes sense, we should group our commands in a top level "GitHub" menu.

👍 I can see us having to do this anyway as we integrate more features (such as creating a gist.)

public static string CurrentSha(this ISimpleRepositoryModel repository)
{
var repo = GitService.GitServiceHelper.GetRepo(repository.LocalPath);
return repo.Commits.FirstOrDefault()?.Sha;
Copy link
Contributor

Choose a reason for hiding this comment

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

Could repo be null here? Should this be repo?.Commits.FirstOrDefault()?.Sha?

@shana
Copy link
Contributor Author

shana commented Feb 9, 2016

I've moved things to a submenu and cleaned up. The icons look like crap though, even though they're xaml icons. Feels like the xaml versions of the octicons that we have have strokes that are too wide?
screen shot 2016-02-09 at 2 04 53 pm
screen shot 2016-02-09 at 2 05 09 pm

@haacked
Copy link
Contributor

haacked commented Feb 9, 2016

I think we need an :octocat: icon for the top level GitHub menu item. What do you think @donokuda and @shana?

@shana
Copy link
Contributor Author

shana commented Feb 9, 2016

@haacked Would love to, but unfortunately it seems VS does not support icons on menu entries that lead to submenus 😢

@haacked
Copy link
Contributor

haacked commented Feb 9, 2016

@haacked Would love to, but unfortunately it seems VS does not support icons on menu entries that lead to submenus

😢 /cc @acangialosi feature request!

@haacked
Copy link
Contributor

haacked commented Feb 9, 2016

@shana I just have the one question about the private class that's exported.

@shana
Copy link
Contributor Author

shana commented Feb 10, 2016

@haacked I've gone and 🔨 all the things you mentioned. I still need to fix the icons so they look half decent, so don't merge this quite yet.

@haacked
Copy link
Contributor

haacked commented Feb 10, 2016

Slowly takes finger off the big green button

@shana
Copy link
Contributor Author

shana commented Feb 10, 2016

@niik
Copy link
Member

niik commented Feb 10, 2016

@shana A+

Any xaml file that includes a SharedDictionaryManager resource
dictionary with the uri "Theme.xaml" will get a themed dictionary
included instead that tracks the VS theme and gets switched at runtime
whenever the VS theme changes.
@shana
Copy link
Contributor Author

shana commented Feb 19, 2016

@haacked

Fixed the icon sizes. Also fixed the colors to match the colors of other context menus in VS. In the process, added a little extra code to support theming, so now we have three separate theme xaml files that define colors for the three themes VS comes with - Dark, Light and Blue.

Any xaml file that includes a SharedDictionaryManager resource dictionary with the uri "Theme.xaml" will get a themed dictionary included instead that tracks the VS theme and gets switched at runtime whenever the VS theme changes. If VS is running an unknown theme, the code detects whether it's a dark or light theme (based on brightness) and loads our dark or light theme file to match.

Test run

green for dark theme, blue for blue theme, red for light theme
runtime-theme-change

Dark

screen shot 2016-02-19 at 11 09 46 pm

Light

screen shot 2016-02-19 at 11 11 18 pm

Blue

screen shot 2016-02-19 at 11 11 04 pm

@donokuda
Copy link
Contributor

Any xaml file that includes a SharedDictionaryManager resource dictionary with the uri "Theme.xaml" will get a themed dictionary included instead that tracks the VS theme and gets switched at runtime whenever the VS theme changes. If VS is running an unknown theme, the code detects whether it's a dark or light theme (based on brightness) and loads our dark or light theme file to match.

tumblr_nozh54mtna1s31h01o1_400

green for dark theme, blue for blue theme, red for light theme

Are these colors just for demonstrating how theming works?

@shana
Copy link
Contributor Author

shana commented Feb 19, 2016

Are these colors just for demonstrating how theming works?

@donokuda Yeah, I couldn't actually tell the difference. I'm actually using the same color for those icons on all three themes, and VS is apparently inverting the color on the dark theme when rendering the icons (got me so confused initially when I set it to white and it showed up black and vice-versa...), so I set them to RGB to make sure it was working (and recorded proof for future self)

@donokuda
Copy link
Contributor

👍 That's what I thought. Love this!

@shana shana assigned haacked and unassigned shana Feb 20, 2016
@shana shana mentioned this pull request Feb 22, 2016
1 task
@haacked
Copy link
Contributor

haacked commented Feb 22, 2016

This feature feels like magic!

haacked added a commit that referenced this pull request Feb 22, 2016
Feature: Link from code to GitHub via context menus
@haacked haacked merged commit cadea92 into master Feb 22, 2016
@haacked haacked deleted the feature/link-to-vs branch February 22, 2016 19:34
@shana shana mentioned this pull request Feb 23, 2016
1 task
@Atcold
Copy link

Atcold commented Jul 16, 2020

How does one activate this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Link from VS to Github in Browser
5 participants