diff --git a/GitHubExtension.Test/HelpersTests/SearchHelperTests.cs b/GitHubExtension.Test/HelpersTests/SearchHelperTests.cs index 634396b..6e572b6 100644 --- a/GitHubExtension.Test/HelpersTests/SearchHelperTests.cs +++ b/GitHubExtension.Test/HelpersTests/SearchHelperTests.cs @@ -38,6 +38,8 @@ public void ParseSearchTypeFromSearchString_ValidInput_ReturnsExpectedType(strin [DataRow("https://github.com/microsoft/PowerToys/issues?q=is%3Aopen%20is%3Aissue%20label%3A%22Product-Command%20Palette%22%20-label%3ARun-Plugin", "repo:microsoft/PowerToys is:open is:issue label:\"Product-Command Palette\" -label:Run-Plugin")] [DataRow("https://github.com/microsoft/PowerToys/issues?q=is%3Aopen%20is%3Aissue%20label%3A%22Good%20first%20issue%22", "repo:microsoft/PowerToys is:open is:issue label:\"Good first issue\"")] [DataRow("https://github.com/search?q=repo:microsoft/terminal+repo:microsoft/PowerToys+repo:microsoft/vscode+is:open+is:issue", "repo:microsoft/terminal repo:microsoft/PowerToys repo:microsoft/vscode is:open is:issue")] + [DataRow("https://github.com/microsoft/devhome/pulls/lauren-ciha", "repo:microsoft/devhome is:pr is:open author:lauren-ciha")] + [DataRow("https://github.com/microsoft/PowerToys/issues/octocat", "repo:microsoft/PowerToys is:issue is:open author:octocat")] [TestMethod] public void ParseSearchStringFromUri_ValidInput_ReturnsExpectedSearchString(string uriString, string expected) { diff --git a/GitHubExtension/Helpers/SearchHelper.cs b/GitHubExtension/Helpers/SearchHelper.cs index 70e9405..3138848 100644 --- a/GitHubExtension/Helpers/SearchHelper.cs +++ b/GitHubExtension/Helpers/SearchHelper.cs @@ -119,6 +119,12 @@ public static IEnumerable GetIsQualifiers(string searchString) searchBuilder.Add("is:open"); } + // Add author if present (4th path segment) + if (pathSegments.Length >= 4 && !string.IsNullOrWhiteSpace(pathSegments[3])) + { + searchBuilder.Add($"author:{pathSegments[3]}"); + } + // Add sort if present var sortParam = queryParams["sort"]; var orderParam = queryParams["order"];