Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion apps/web/src/components/ChatView.browser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
GIT_STATUS_STALE_MESSAGE: "Source control status isn't updating.",
useGitStatus: () => ({ data: null, error: null, cause: null, isPending: false }),
useGitStatuses: () => new Map(),
rebuildGitStatusSubscription: () => undefined,
refreshGitStatus: () => Promise.resolve(null),
refreshLocalGitStatus: () => Promise.resolve(null),
resetGitStatusStateForTests: () => undefined,
Expand Down Expand Up @@ -7435,7 +7436,14 @@
.element(palette.getByText("This device", { exact: true }).first())
.toBeInTheDocument();
await palette.getByText("Staging", { exact: true }).click();
await palette.getByText("Local folder", { exact: true }).click();
// The palette re-renders its list when the environment pick commits the
// Sources view. Await the committed view and an attached action before
// clicking, or the click can land on a mid-transition node that detaches
// under it on a slow runner.
await expect.element(palette.getByText("Sources", { exact: true })).toBeInTheDocument();
const localFolderAction = palette.getByText("Local folder", { exact: true });
await expect.element(localFolderAction).toBeInTheDocument();
await localFolderAction.click();

Check failure on line 7446 in apps/web/src/components/ChatView.browser.tsx

View workflow job for this annotation

GitHub Actions / Format, Lint, Typecheck, Test, Browser Test, Build

[chromium] src/components/ChatView.browser.tsx > ChatView timeline estimator parity (full app) > selects an environment before browsing when multiple environments are available

TimeoutError: locator.click: Timeout 29021ms exceeded. Call log: - waiting for locator('[data-vitest="true"]').contentFrame().getByTestId('command-palette').getByText('Local folder', { exact: true }) - locator resolved to <span class="truncate">Local folder</span> - attempting click action - waiting for element to be visible, enabled and stable - element is not stable - retrying click action - waiting for element to be visible, enabled and stable - element was detached from the DOM, retrying ❯ click src/components/ChatView.browser.tsx:7446:30

const browseInput = await waitForCommandPaletteInput(ADD_PROJECT_SUBMENU_PLACEHOLDER);
await expect.element(browseInput).toHaveValue("~/workspaces/");
Expand Down
1 change: 1 addition & 0 deletions apps/web/src/components/KeybindingsToast.browser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ vi.mock("../lib/gitStatusState", () => ({
GIT_STATUS_STALE_MESSAGE: "Source control status isn't updating.",
useGitStatus: () => ({ data: null, error: null, cause: null, isPending: false }),
useGitStatuses: () => new Map(),
rebuildGitStatusSubscription: () => undefined,
refreshGitStatus: () => Promise.resolve(null),
refreshLocalGitStatus: () => Promise.resolve(null),
resetGitStatusStateForTests: () => undefined,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ vi.mock("~/lib/gitStatusState", () => ({
isPending: false,
}),
useGitStatuses: () => new Map(),
rebuildGitStatusSubscription: () => undefined,
refreshGitStatus: gitStatusMock.refreshGitStatus,
refreshLocalGitStatus: gitStatusMock.refreshLocalGitStatus,
resetGitStatusStateForTests: () => {
Expand Down
5 changes: 5 additions & 0 deletions apps/web/src/components/source-control/SourceControlPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ import {
} from "~/lib/gitReactQuery";
import {
GIT_STATUS_STALE_MESSAGE,
rebuildGitStatusSubscription,
refreshGitStatus,
refreshLocalGitStatus,
useGitStatus,
Expand Down Expand Up @@ -2571,6 +2572,10 @@ export function SourceControlPanel({
return;
}
setIsManualRefreshPending(true);
// Refreshing repairs the data over the unary RPC; rebuilding repairs the
// push stream that stopped delivering it. Retry has to do both, or the
// panel goes stale again on the next change nobody hears about.
rebuildGitStatusSubscription({ environmentId, cwd });
void refreshGitStatus({ environmentId, cwd }, undefined, { force: true })
.then(() =>
queryClient.invalidateQueries({
Expand Down
Loading
Loading