From bc0ed5d52537dfff78122edc8814d385cbcb9f22 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 29 Oct 2025 01:45:57 +0000 Subject: [PATCH 1/3] Initial plan From 5bac16e7db6d689f924fa55427682bc107a13e12 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 29 Oct 2025 01:51:21 +0000 Subject: [PATCH 2/3] Fix author label parsing from GitHub URLs with author path segment Co-authored-by: lauren-ciha <64796985+lauren-ciha@users.noreply.github.com> --- GitHubExtension.Test/HelpersTests/SearchHelperTests.cs | 2 ++ GitHubExtension/Helpers/SearchHelper.cs | 6 ++++++ 2 files changed, 8 insertions(+) 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..3fb63ff 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) + { + searchBuilder.Add($"author:{pathSegments[3]}"); + } + // Add sort if present var sortParam = queryParams["sort"]; var orderParam = queryParams["order"]; From ad7eb0bc59e1dad6ca8a0eed042743e8663f8fb3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 29 Oct 2025 01:53:18 +0000 Subject: [PATCH 3/3] Add validation for author path segment to ensure it's not empty Co-authored-by: lauren-ciha <64796985+lauren-ciha@users.noreply.github.com> --- GitHubExtension/Helpers/SearchHelper.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GitHubExtension/Helpers/SearchHelper.cs b/GitHubExtension/Helpers/SearchHelper.cs index 3fb63ff..3138848 100644 --- a/GitHubExtension/Helpers/SearchHelper.cs +++ b/GitHubExtension/Helpers/SearchHelper.cs @@ -120,7 +120,7 @@ public static IEnumerable GetIsQualifiers(string searchString) } // Add author if present (4th path segment) - if (pathSegments.Length >= 4) + if (pathSegments.Length >= 4 && !string.IsNullOrWhiteSpace(pathSegments[3])) { searchBuilder.Add($"author:{pathSegments[3]}"); }