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

Commit 88d02e7

Browse files
authored
Merge pull request #2480 from github/feature/toolwindow-to-repository
Add navigation from GitHub tool window to repository
2 parents 0176faf + 55fa71b commit 88d02e7

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

src/GitHub.App/ViewModels/GitHubPane/GitHubPaneViewModel.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,14 @@ public GitHubPaneViewModel(
160160
},
161161
currentPage.Select(x => x is IOpenInBrowser));
162162

163+
BrowseRepository = ReactiveCommand.Create(
164+
() =>
165+
{
166+
var url = LocalRepository.CloneUrl.ToRepositoryUrl();
167+
if (url != null) browser.OpenUrl(url);
168+
},
169+
currentPage.Select(x => x is IOpenInBrowser));
170+
163171
help = ReactiveCommand.Create(() => { });
164172
help.Subscribe(_ =>
165173
{
@@ -531,5 +539,7 @@ static Regex CreateRoute(string route)
531539
var routeFormat = "^" + new Regex("(:([a-z]+))\\b").Replace(route, @"(?<$2>[\w_.\-=]+)") + "$";
532540
return new Regex(routeFormat, RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase);
533541
}
542+
543+
public ReactiveCommand<Unit, Unit> BrowseRepository { get; }
534544
}
535545
}

src/GitHub.VisualStudio.UI/Views/GitHubPane/GitHubPaneView.xaml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,8 @@
5757
<Separator Margin="5,-2,5,0"
5858
Foreground="{DynamicResource GitHubPaneTitleBrush}"
5959
Style="{StaticResource TitleVerticalSeparator}" />
60-
<TextBlock Margin="0,-5,0,0"
61-
VerticalAlignment="Center"
62-
Foreground="{DynamicResource GitHubVsGrayText}"
63-
Text="{Binding LocalRepository.Name}" />
64-
</StackPanel>
60+
<ghfvs:GitHubActionLink Margin="0,-2.5,0,0" Command="{Binding BrowseRepository}" Content="{Binding LocalRepository.Name}" />
61+
</StackPanel>
6562

6663
<Separator Margin="0,0,0,2"
6764
DockPanel.Dock="Top"

0 commit comments

Comments
 (0)