From 11d0c85381d73e7b308a78d706fc8514f24b8380 Mon Sep 17 00:00:00 2001 From: Jamie Cansdale Date: Sun, 15 Mar 2020 18:20:23 +0000 Subject: [PATCH 1/3] Add navigation from GitHub tool window to repository --- .../ViewModels/GitHubPane/GitHubPaneViewModel.cs | 10 ++++++++++ .../Views/GitHubPane/GitHubPaneView.xaml | 7 ++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/GitHub.App/ViewModels/GitHubPane/GitHubPaneViewModel.cs b/src/GitHub.App/ViewModels/GitHubPane/GitHubPaneViewModel.cs index f161ed36c2..fa65012187 100644 --- a/src/GitHub.App/ViewModels/GitHubPane/GitHubPaneViewModel.cs +++ b/src/GitHub.App/ViewModels/GitHubPane/GitHubPaneViewModel.cs @@ -160,6 +160,14 @@ public GitHubPaneViewModel( }, currentPage.Select(x => x is IOpenInBrowser)); + BrowseRepository = ReactiveCommand.Create( + () => + { + var url = LocalRepository.CloneUrl.ToRepositoryUrl(); + if (url != null) browser.OpenUrl(url); + }, + currentPage.Select(x => x is IOpenInBrowser)); + help = ReactiveCommand.Create(() => { }); help.Subscribe(_ => { @@ -531,5 +539,7 @@ static Regex CreateRoute(string route) var routeFormat = "^" + new Regex("(:([a-z]+))\\b").Replace(route, @"(?<$2>[\w_.\-=]+)") + "$"; return new Regex(routeFormat, RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase); } + + public ReactiveCommand BrowseRepository { get; } } } diff --git a/src/GitHub.VisualStudio.UI/Views/GitHubPane/GitHubPaneView.xaml b/src/GitHub.VisualStudio.UI/Views/GitHubPane/GitHubPaneView.xaml index f6c832966f..65e9d4086f 100644 --- a/src/GitHub.VisualStudio.UI/Views/GitHubPane/GitHubPaneView.xaml +++ b/src/GitHub.VisualStudio.UI/Views/GitHubPane/GitHubPaneView.xaml @@ -57,11 +57,8 @@ - - + + Date: Sun, 15 Mar 2020 18:47:38 +0000 Subject: [PATCH 2/3] Tweak the position of the repository link --- src/GitHub.VisualStudio.UI/Views/GitHubPane/GitHubPaneView.xaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GitHub.VisualStudio.UI/Views/GitHubPane/GitHubPaneView.xaml b/src/GitHub.VisualStudio.UI/Views/GitHubPane/GitHubPaneView.xaml index 65e9d4086f..7af9d15b7f 100644 --- a/src/GitHub.VisualStudio.UI/Views/GitHubPane/GitHubPaneView.xaml +++ b/src/GitHub.VisualStudio.UI/Views/GitHubPane/GitHubPaneView.xaml @@ -57,7 +57,7 @@ - + Date: Mon, 16 Mar 2020 18:12:52 +0000 Subject: [PATCH 3/3] Move link up slightly --- src/GitHub.VisualStudio.UI/Views/GitHubPane/GitHubPaneView.xaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GitHub.VisualStudio.UI/Views/GitHubPane/GitHubPaneView.xaml b/src/GitHub.VisualStudio.UI/Views/GitHubPane/GitHubPaneView.xaml index 7af9d15b7f..83a25537bd 100644 --- a/src/GitHub.VisualStudio.UI/Views/GitHubPane/GitHubPaneView.xaml +++ b/src/GitHub.VisualStudio.UI/Views/GitHubPane/GitHubPaneView.xaml @@ -57,7 +57,7 @@ - +