Skip to content

fix: Unblock cloud branch picker during slow remote load#2269

Merged
charlesvien merged 2 commits into
mainfrom
05-20-unblock_cloud_branch_picker_during_slow_remote_load
May 21, 2026
Merged

fix: Unblock cloud branch picker during slow remote load#2269
charlesvien merged 2 commits into
mainfrom
05-20-unblock_cloud_branch_picker_during_slow_remote_load

Conversation

@charlesvien
Copy link
Copy Markdown
Member

@charlesvien charlesvien commented May 20, 2026

Problem

Cloud branch picker was disabled while the slow GitHub remote was loading, blocking users from typing a known branch name and forcing them to wait on a request that often takes seconds.

Closes #1984

Changes

  1. Stop disabling the picker while cloud branches are still loading
  2. Add "Use 'input' as branch name" action as the auto-highlighted first item so it is keyboard-reachable during the slow fetch
  3. Debounce branch search at 300ms instead of useDeferredValue to coalesce keystrokes into one request
  4. Skip debounce on empty search so closing the picker clears stale results immediately
  5. Refactor Combobox item rendering to handle the new sentinel action

How did you test this?

Manually

Publish to changelog?

no

@charlesvien charlesvien changed the title Unblock cloud branch picker during slow remote load fix: Unblock cloud branch picker during slow remote load May 20, 2026
@charlesvien charlesvien changed the base branch from fix/at-mention-directory-titles to graphite-base/2269 May 20, 2026 22:54
@charlesvien charlesvien force-pushed the graphite-base/2269 branch from 4dbc9e1 to 99460f7 Compare May 20, 2026 22:54
@charlesvien charlesvien force-pushed the 05-20-unblock_cloud_branch_picker_during_slow_remote_load branch from 0596858 to 49afa1d Compare May 20, 2026 22:54
@charlesvien charlesvien changed the base branch from graphite-base/2269 to 05-20-command-center-clicking-file-ref-does-nothing May 20, 2026 22:54
@charlesvien charlesvien force-pushed the 05-20-command-center-clicking-file-ref-does-nothing branch from 99460f7 to b5ecbfb Compare May 21, 2026 00:07
@charlesvien charlesvien force-pushed the 05-20-unblock_cloud_branch_picker_during_slow_remote_load branch from 49afa1d to 286cab6 Compare May 21, 2026 00:07
@charlesvien charlesvien force-pushed the 05-20-unblock_cloud_branch_picker_during_slow_remote_load branch from 286cab6 to a9452b8 Compare May 21, 2026 00:43
@charlesvien charlesvien force-pushed the 05-20-command-center-clicking-file-ref-does-nothing branch from b5ecbfb to 8298610 Compare May 21, 2026 00:43
@charlesvien charlesvien force-pushed the 05-20-unblock_cloud_branch_picker_during_slow_remote_load branch from a9452b8 to 22da025 Compare May 21, 2026 00:52
@charlesvien charlesvien marked this pull request as ready for review May 21, 2026 01:16
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 21, 2026

Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
apps/code/src/renderer/features/git-interaction/components/BranchSelector.test.tsx:61-103
Tests 2 and 3 test the same `showUseInputBranchAction` visibility condition with different `cloudSearchQuery` values (one that matches an existing branch, one that doesn't). Per the team's preference for parameterised tests, these could be merged into a single `it.each` case.

```suggestion
  it.each([
    { cloudSearchQuery: "brand-new-branch", expectVisible: true },
    { cloudSearchQuery: "main", expectVisible: false },
  ])(
    "shows the typed-name action only when input does not match an existing branch ($cloudSearchQuery)",
    async ({ cloudSearchQuery, expectVisible }) => {
      const user = userEvent.setup();
      renderInTheme(
        <BranchSelector
          repoPath="owner/repo"
          currentBranch={null}
          workspaceMode="cloud"
          cloudBranches={["main", "feature-a"]}
          cloudBranchesLoading={false}
          cloudSearchQuery={cloudSearchQuery}
          onBranchSelect={vi.fn()}
          onCloudSearchChange={vi.fn()}
        />,
      );

      await user.click(screen.getByRole("combobox", { name: "Branch" }));

      if (expectVisible) {
        expect(
          await screen.findByText(`Use "${cloudSearchQuery}" as branch name`),
        ).toBeInTheDocument();
      } else {
        expect(
          screen.queryByText(new RegExp(`Use "${cloudSearchQuery}" as branch name`)),
        ).not.toBeInTheDocument();
      }
    },
  );
```

Reviews (1): Last reviewed commit: "address branch picker review feedback" | Re-trigger Greptile

@charlesvien charlesvien force-pushed the 05-20-unblock_cloud_branch_picker_during_slow_remote_load branch from e5384e1 to 942f2bf Compare May 21, 2026 02:10
@charlesvien charlesvien force-pushed the 05-20-command-center-clicking-file-ref-does-nothing branch from 64a785b to 41013d4 Compare May 21, 2026 02:10
@charlesvien charlesvien force-pushed the 05-20-unblock_cloud_branch_picker_during_slow_remote_load branch from 942f2bf to 2011089 Compare May 21, 2026 03:44
@charlesvien charlesvien force-pushed the 05-20-command-center-clicking-file-ref-does-nothing branch from 41013d4 to 50e7887 Compare May 21, 2026 03:44
@graphite-app graphite-app Bot changed the base branch from 05-20-command-center-clicking-file-ref-does-nothing to graphite-base/2269 May 21, 2026 18:12
@charlesvien charlesvien force-pushed the graphite-base/2269 branch from 50e7887 to 93652e1 Compare May 21, 2026 18:37
@charlesvien charlesvien force-pushed the 05-20-unblock_cloud_branch_picker_during_slow_remote_load branch from 2011089 to ba3d833 Compare May 21, 2026 18:37
@graphite-app graphite-app Bot changed the base branch from graphite-base/2269 to main May 21, 2026 18:37
@graphite-app
Copy link
Copy Markdown

graphite-app Bot commented May 21, 2026

Merge activity

  • May 21, 6:37 PM UTC: Graphite rebased this pull request, because this pull request is set to merge when ready.
  • May 21, 7:05 PM UTC: Graphite couldn't merge this PR because it failed for an unknown reason (GitHub is reporting that this PR is not mergeable, despite passing required status checks defined by your branch protection rules. Please check your rulesets for additional blocking criteria. Graphite Merge Queue does not currently support rulesets. Please contact Graphite support for further assistance.).

@charlesvien charlesvien merged commit a456524 into main May 21, 2026
11 of 16 checks passed
@charlesvien charlesvien deleted the 05-20-unblock_cloud_branch_picker_during_slow_remote_load branch May 21, 2026 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Branch selector for cloud tasks is slow to load and doesn't accept custom input

2 participants