Lazy-load GitHub picker queries

This commit is contained in:
Mohamed Boudra
2026-04-22 20:00:43 +07:00
parent 8e63274ce6
commit 368ce0339a
5 changed files with 27 additions and 4 deletions
@@ -586,10 +586,15 @@ describe("NewWorkspaceScreen picker payload", () => {
expect(pickerRow.style.transform).toBe("translateY(-216px)");
});
it("searches only GitHub PRs for the picker", async () => {
it("lazily searches only GitHub PRs when the picker opens", async () => {
renderScreen();
await flush();
expect(mockClient.searchGitHub).not.toHaveBeenCalled();
click(await findByTestId("new-workspace-ref-picker-trigger"));
await flush();
expect(mockClient.searchGitHub).toHaveBeenCalledWith({
cwd: "/repo",
query: "",