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
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function CloudGithubMissingNotice() {
<Text size="1">
{hasError
? describeGithubConnectError(error)
: "Connecting your personal GitHub is required to run cloud tasks."}
: "Connect GitHub to your PostHog account for cloud tasks."}
</Text>
</Callout.Text>
</Flex>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ export function TaskInput({
trpcReact.folders.getMostRecentlyAccessedRepository.queryOptions(),
);
const {
lastUsedLocalWorkspaceMode,
setLastUsedLocalWorkspaceMode,
lastUsedWorkspaceMode,
setLastUsedWorkspaceMode,
Expand Down Expand Up @@ -186,13 +185,8 @@ export function TaskInput({
hasGithubIntegration,
} = useUserRepositoryIntegration();

// Stay optimistic while the integration list resolves to avoid flicker.
const cloudAvailable = isLoadingRepos || hasGithubIntegration;
const [workspaceMode, setWorkspaceModeState] = useState<WorkspaceMode>(() => {
if (initialCloudRepository) return "cloud";
if (!cloudAvailable && lastUsedWorkspaceMode === "cloud") {
return lastUsedLocalWorkspaceMode;
}
return lastUsedWorkspaceMode || "local";
});

Expand All @@ -203,12 +197,6 @@ export function TaskInput({
setLastUsedLocalWorkspaceMode(mode);
}
};

useEffect(() => {
if (workspaceMode === "cloud" && !cloudAvailable) {
setWorkspaceModeState(lastUsedLocalWorkspaceMode);
}
}, [workspaceMode, cloudAvailable, lastUsedLocalWorkspaceMode]);
const {
repositories: visibleCloudRepositories,
isPending: cloudRepositoriesLoading,
Expand Down Expand Up @@ -642,7 +630,6 @@ export function TaskInput({
onChange={setWorkspaceMode}
selectedCloudEnvironmentId={selectedCloudEnvId}
onCloudEnvironmentChange={setSelectedCloudEnvId}
cloudAvailable={cloudAvailable}
size="1"
/>
{workspaceMode === "worktree" && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ interface WorkspaceModeSelectProps {
overrideModes?: WorkspaceMode[];
selectedCloudEnvironmentId?: string | null;
onCloudEnvironmentChange?: (envId: string | null) => void;
cloudAvailable?: boolean;
}

const LOCAL_MODES: {
Expand Down Expand Up @@ -68,7 +67,6 @@ export function WorkspaceModeSelect({
overrideModes,
selectedCloudEnvironmentId,
onCloudEnvironmentChange,
cloudAvailable = true,
}: WorkspaceModeSelectProps) {
const cloudModeEnabled =
useFeatureFlag("twig-cloud-mode-toggle") || import.meta.env.DEV;
Expand All @@ -82,9 +80,9 @@ export function WorkspaceModeSelect({
openSettings("cloud-environments", "create");
}, [openSettings]);

const showCloud =
cloudAvailable &&
(overrideModes ? overrideModes.includes("cloud") : cloudModeEnabled);
const showCloud = overrideModes
? overrideModes.includes("cloud")
: cloudModeEnabled;

const localModes = useMemo(
() =>
Expand Down
Loading