🙌 OpenHands: AI-Driven Development
feat(frontend): add a tooltip to repo dropdown on home page (#10079)
Hiep Ledceff1fae4b3
diff --git a/frontend/src/components/features/home/repo-connector.tsx b/frontend/src/components/features/home/repo-connector.tsxindex 8dbbf0e4f6..b4cc97730e 100644--- a/frontend/src/components/features/home/repo-connector.tsx+++ b/frontend/src/components/features/home/repo-connector.tsx@@ -1,10 +1,12 @@import { useTranslation } from "react-i18next";+import { FaInfoCircle } from "react-icons/fa";import { ConnectToProviderMessage } from "./connect-to-provider-message";import { RepositorySelectionForm } from "./repo-selection-form";import { useConfig } from "#/hooks/query/use-config";import { RepoProviderLinks } from "./repo-provider-links";import { useUserProviders } from "#/hooks/use-user-providers";import { GitRepository } from "#/types/git";+import { TooltipButton } from "#/components/shared/buttons/tooltip-button";interface RepoConnectorProps {onRepoSelection: (repo: GitRepository | null) => void;@@ -23,7 +25,19 @@ export function RepoConnector({ onRepoSelection }: RepoConnectorProps) {data-testid="repo-connector"className="w-full flex flex-col gap-6">- <h2 className="heading">{t("HOME$CONNECT_TO_REPOSITORY")}</h2>+ <div className="flex items-center gap-2">+ <h2 className="heading">{t("HOME$CONNECT_TO_REPOSITORY")}</h2>+ <TooltipButton+ testId="repo-connector-info"+ tooltip={t("HOME$CONNECT_TO_REPOSITORY_TOOLTIP")}+ ariaLabel={t("HOME$CONNECT_TO_REPOSITORY_TOOLTIP")}+ className="text-[#9099AC] hover:text-white"+ placement="bottom"+ tooltipClassName="max-w-[348px]"+ >+ <FaInfoCircle size={16} />+ </TooltipButton>+ </div>{!providersAreSet && <ConnectToProviderMessage />}{providersAreSet && (diff --git a/frontend/src/i18n/declaration.ts b/frontend/src/i18n/declaration.tsindex 9a689156fc..22943610dc 100644--- a/frontend/src/i18n/declaration.ts+++ b/frontend/src/i18n/declaration.ts@@ -78,6 +78,7 @@ export enum I18nKey {HOME$OPENHANDS_DESCRIPTION = "HOME$OPENHANDS_DESCRIPTION",HOME$NOT_SURE_HOW_TO_START = "HOME$NOT_SURE_HOW_TO_START",HOME$CONNECT_TO_REPOSITORY = "HOME$CONNECT_TO_REPOSITORY",+ HOME$CONNECT_TO_REPOSITORY_TOOLTIP = "HOME$CONNECT_TO_REPOSITORY_TOOLTIP",HOME$LOADING = "HOME$LOADING",HOME$LOADING_REPOSITORIES = "HOME$LOADING_REPOSITORIES",HOME$FAILED_TO_LOAD_REPOSITORIES = "HOME$FAILED_TO_LOAD_REPOSITORIES",diff --git a/frontend/src/i18n/translation.json b/frontend/src/i18n/translation.jsonindex bebc6f242e..18270254d6 100644--- a/frontend/src/i18n/translation.json+++ b/frontend/src/i18n/translation.json@@ -1247,6 +1247,22 @@"de": "Mit einem Repository verbinden","uk": "Підключіть до репозиторій"},+ "HOME$CONNECT_TO_REPOSITORY_TOOLTIP": {+ "en": "You can enter a public GitHub URL if you'd like to work from a public repo instead",+ "ja": "代わりにパブリックリポジトリで作業したい場合は、パブリックGitHub URLを入力できます",+ "zh-CN": "如果您想从公共仓库工作,可以输入公共GitHub URL",+ "zh-TW": "如果您想從公共儲存庫工作,可以輸入公共GitHub URL",+ "ko-KR": "대신 공개 저장소에서 작업하고 싶다면 공개 GitHub URL을 입력할 수 있습니다",+ "no": "Du kan angi en offentlig GitHub URL hvis du vil jobbe fra et offentlig repo i stedet",+ "it": "Puoi inserire un URL GitHub pubblico se preferisci lavorare da un repository pubblico",+ "pt": "Você pode inserir um URL GitHub público se quiser trabalhar de um repositório público",+ "es": "Puede ingresar una URL de GitHub pública si desea trabajar desde un repositorio público",+ "ar": "يمكنك إدخال رابط GitHub عام إذا كنت تريد العمل من مستودع عام بدلاً من ذلك",+ "fr": "Vous pouvez saisir une URL GitHub publique si vous souhaitez travailler à partir d'un dépôt public",+ "tr": "Bunun yerine genel bir repo'dan çalışmak istiyorsanız genel bir GitHub URL'si girebilirsiniz",+ "de": "Sie können eine öffentliche GitHub-URL eingeben, wenn Sie stattdessen von einem öffentlichen Repository arbeiten möchten",+ "uk": "Ви можете ввести публічну GitHub URL, якщо хочете працювати з публічного репозиторію"+ },"HOME$LOADING": {"en": "Loading...","ja": "読み込み中...",