+ {renderProviderSelector()}
{renderRepositorySelector()}
-
{renderBranchSelector()}
1 && !selectedProvider)
}
onClick={() =>
createConversation(
@@ -215,7 +159,7 @@ export function RepositorySelectionForm({
repository: {
name: selectedRepository?.full_name || "",
gitProvider: selectedRepository?.git_provider || "github",
- branch: selectedBranch?.name || "main",
+ branch: selectedBranch?.name || (hasNoBranches ? "" : "main"),
},
},
{
diff --git a/frontend/src/components/features/home/repository-selection/index.ts b/frontend/src/components/features/home/repository-selection/index.ts
index 9cb4aa0507..1bd1139230 100644
--- a/frontend/src/components/features/home/repository-selection/index.ts
+++ b/frontend/src/components/features/home/repository-selection/index.ts
@@ -1,6 +1,3 @@
-export { RepositoryDropdown } from "#/components/features/home/repository-selection/repository-dropdown";
-export { RepositoryLoadingState } from "#/components/features/home/repository-selection/repository-loading-state";
-export { RepositoryErrorState } from "#/components/features/home/repository-selection/repository-error-state";
export { BranchDropdown } from "#/components/features/home/repository-selection/branch-dropdown";
export { BranchLoadingState } from "#/components/features/home/repository-selection/branch-loading-state";
export { BranchErrorState } from "#/components/features/home/repository-selection/branch-error-state";
diff --git a/frontend/src/components/features/home/repository-selection/repository-dropdown.tsx b/frontend/src/components/features/home/repository-selection/repository-dropdown.tsx
deleted file mode 100644
index 785b7fadb9..0000000000
--- a/frontend/src/components/features/home/repository-selection/repository-dropdown.tsx
+++ /dev/null
@@ -1,33 +0,0 @@
-import React from "react";
-import { useTranslation } from "react-i18next";
-import { SettingsDropdownInput } from "../../settings/settings-dropdown-input";
-import { I18nKey } from "#/i18n/declaration";
-
-export interface RepositoryDropdownProps {
- items: { key: React.Key; label: string }[];
- onSelectionChange: (key: React.Key | null) => void;
- onInputChange: (value: string) => void;
- defaultFilter?: (textValue: string, inputValue: string) => boolean;
-}
-
-export function RepositoryDropdown({
- items,
- onSelectionChange,
- onInputChange,
- defaultFilter,
-}: RepositoryDropdownProps) {
- const { t } = useTranslation();
-
- return (
-
- );
-}
diff --git a/frontend/src/components/features/home/repository-selection/repository-error-state.tsx b/frontend/src/components/features/home/repository-selection/repository-error-state.tsx
deleted file mode 100644
index 52d2872c38..0000000000
--- a/frontend/src/components/features/home/repository-selection/repository-error-state.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import React from "react";
-import { useTranslation } from "react-i18next";
-
-export function RepositoryErrorState() {
- const { t } = useTranslation();
- return (
-
- {t("HOME$FAILED_TO_LOAD_REPOSITORIES")}
-
- );
-}
diff --git a/frontend/src/components/features/home/repository-selection/repository-loading-state.tsx b/frontend/src/components/features/home/repository-selection/repository-loading-state.tsx
deleted file mode 100644
index 2fee31d616..0000000000
--- a/frontend/src/components/features/home/repository-selection/repository-loading-state.tsx
+++ /dev/null
@@ -1,16 +0,0 @@
-import React from "react";
-import { useTranslation } from "react-i18next";
-import { Spinner } from "@heroui/react";
-
-export function RepositoryLoadingState() {
- const { t } = useTranslation();
- return (
-
-
- {t("HOME$LOADING_REPOSITORIES")}
-
- );
-}
diff --git a/frontend/src/components/features/microagent-management/microagent-management-sidebar.tsx b/frontend/src/components/features/microagent-management/microagent-management-sidebar.tsx
index 05b215dfcd..d93d11987b 100644
--- a/frontend/src/components/features/microagent-management/microagent-management-sidebar.tsx
+++ b/frontend/src/components/features/microagent-management/microagent-management-sidebar.tsx
@@ -5,6 +5,7 @@ import { Spinner } from "@heroui/react";
import { MicroagentManagementSidebarHeader } from "./microagent-management-sidebar-header";
import { MicroagentManagementSidebarTabs } from "./microagent-management-sidebar-tabs";
import { useUserRepositories } from "#/hooks/query/use-user-repositories";
+import { useUserProviders } from "#/hooks/use-user-providers";
import {
setPersonalRepositories,
setOrganizationRepositories,
@@ -22,15 +23,21 @@ export function MicroagentManagementSidebar({
}: MicroagentManagementSidebarProps) {
const dispatch = useDispatch();
const { t } = useTranslation();
- const { data: repositories, isLoading } = useUserRepositories();
+ const { providers } = useUserProviders();
+ const selectedProvider = providers.length > 0 ? providers[0] : null;
+ const { data: repositories, isLoading } =
+ useUserRepositories(selectedProvider);
useEffect(() => {
- if (repositories) {
+ if (repositories?.pages) {
const personalRepos: GitRepository[] = [];
const organizationRepos: GitRepository[] = [];
const otherRepos: GitRepository[] = [];
- repositories.forEach((repo: GitRepository) => {
+ // Flatten all pages to get all repositories
+ const allRepositories = repositories.pages.flatMap((page) => page.data);
+
+ allRepositories.forEach((repo: GitRepository) => {
const hasOpenHandsSuffix = repo.full_name.endsWith("/.openhands");
if (repo.owner_type === "user" && hasOpenHandsSuffix) {
diff --git a/frontend/src/components/features/settings/settings-dropdown-input.tsx b/frontend/src/components/features/settings/settings-dropdown-input.tsx
index ba6b75db1c..81dbf8f41d 100644
--- a/frontend/src/components/features/settings/settings-dropdown-input.tsx
+++ b/frontend/src/components/features/settings/settings-dropdown-input.tsx
@@ -1,5 +1,5 @@
import { Autocomplete, AutocompleteItem } from "@heroui/react";
-import { ReactNode } from "react";
+import React, { ReactNode } from "react";
import { useTranslation } from "react-i18next";
import { OptionalTag } from "./optional-tag";
import { cn } from "#/utils/utils";
@@ -44,6 +44,7 @@ export function SettingsDropdownInput({
defaultFilter,
}: SettingsDropdownInputProps) {
const { t } = useTranslation();
+
return (