Skip to content

🙌 OpenHands: AI-Driven Development

feat(home): reframe splash copy around day-to-day engineering work (#17545)

Denis Ermakove9c04d4580f5
diff --git a/.github/pr-assets/issue-16505-01-before-desktop.png b/.github/pr-assets/issue-16505-01-before-desktop.png
new file mode 100644
index 0000000000..9f7234f583
Binary files /dev/null and b/.github/pr-assets/issue-16505-01-before-desktop.png differ
diff --git a/.github/pr-assets/issue-16505-02-after-desktop.png b/.github/pr-assets/issue-16505-02-after-desktop.png
new file mode 100644
index 0000000000..c8749422f8
Binary files /dev/null and b/.github/pr-assets/issue-16505-02-after-desktop.png differ
diff --git a/.github/pr-assets/issue-16505-03-before-mobile.png b/.github/pr-assets/issue-16505-03-before-mobile.png
new file mode 100644
index 0000000000..6afe9c7feb
Binary files /dev/null and b/.github/pr-assets/issue-16505-03-before-mobile.png differ
diff --git a/.github/pr-assets/issue-16505-04-after-mobile.png b/.github/pr-assets/issue-16505-04-after-mobile.png
new file mode 100644
index 0000000000..1ee6a53d8d
Binary files /dev/null and b/.github/pr-assets/issue-16505-04-after-mobile.png differ
diff --git a/__tests__/components/features/chat/components/chat-input-field.test.tsx b/__tests__/components/features/chat/components/chat-input-field.test.tsx
index 2d93981591..14a2b293c2 100644
--- a/__tests__/components/features/chat/components/chat-input-field.test.tsx
+++ b/__tests__/components/features/chat/components/chat-input-field.test.tsx
@@ -4,12 +4,19 @@ import { describe, expect, it, vi } from "vitest";
import { renderWithProviders } from "test-utils";
import { ChatInputField } from "#/components/features/chat/components/chat-input-field";
-function Harness({ disabled }: { disabled: boolean }) {
+function Harness({
+ disabled,
+ placeholder,
+}: {
+ disabled: boolean;
+ placeholder?: string;
+}) {
const ref = React.useRef<HTMLDivElement | null>(null);
return (
<ChatInputField
chatInputRef={ref}
disabled={disabled}
+ placeholder={placeholder}
onInput={vi.fn()}
onPaste={vi.fn()}
onKeyDown={vi.fn()}
@@ -39,3 +46,29 @@ describe("ChatInputField auto-focus", () => {
expect(screen.getByTestId("chat-input")).not.toBe(document.activeElement);
});
});
+
+function describeEngineeringTask() {
+ return "Describe an engineering task…";
+}
+
+describe("ChatInputField placeholder", () => {
+ it("falls back to the default build prompt when no placeholder is given", () => {
+ renderWithProviders(<Harness disabled={false} />);
+
+ expect(screen.getByTestId("chat-input")).toHaveAttribute(
+ "data-placeholder",
+ "SUGGESTIONS$WHAT_TO_BUILD",
+ );
+ });
+
+ it("uses the caller-supplied placeholder when provided", () => {
+ renderWithProviders(
+ <Harness disabled={false} placeholder={describeEngineeringTask()} />,
+ );
+
+ expect(screen.getByTestId("chat-input")).toHaveAttribute(
+ "data-placeholder",
+ describeEngineeringTask(),
+ );
+ });
+});
diff --git a/__tests__/components/features/home/home-chat-launcher.test.tsx b/__tests__/components/features/home/home-chat-launcher.test.tsx
index e58245b353..5c713d8341 100644
--- a/__tests__/components/features/home/home-chat-launcher.test.tsx
+++ b/__tests__/components/features/home/home-chat-launcher.test.tsx
@@ -91,13 +91,16 @@ vi.mock("#/components/features/chat/custom-chat-input", () => ({
CustomChatInput: ({
onSubmit,
disabled,
+ placeholder,
}: {
onSubmit: (msg: string) => void;
disabled?: boolean;
+ placeholder?: string;
}) => (
<button
type="button"
data-testid="stub-chat-submit"
+ data-placeholder={placeholder}
disabled={disabled}
onClick={() => onSubmit("hello world")}
>
@@ -351,6 +354,15 @@ describe("HomeChatLauncher", () => {
window.localStorage.removeItem(LAST_LOCAL_WORKSPACE_MODE_STORAGE_KEY);
});
+ it("asks for an engineering task in the launcher input placeholder", async () => {
+ renderLauncher();
+
+ expect(screen.getByTestId("stub-chat-submit")).toHaveAttribute(
+ "data-placeholder",
+ "HOME$DESCRIBE_ENGINEERING_TASK",
+ );
+ });
+
it("creates a conversation with just the typed query and navigates when no workspace is selected", async () => {
const createSpy = vi
.spyOn(AgentServerConversationService, "createConversation")
diff --git a/__tests__/components/features/home/home-header-title.test.tsx b/__tests__/components/features/home/home-header-title.test.tsx
new file mode 100644
index 0000000000..9c54ee04c7
--- /dev/null
+++ b/__tests__/components/features/home/home-header-title.test.tsx
@@ -0,0 +1,15 @@
+import { screen } from "@testing-library/react";
+import { describe, expect, it } from "vitest";
+import { renderWithProviders } from "test-utils";
+import { HomeHeaderTitle } from "#/components/features/home/home-header/home-header-title";
+
+describe("HomeHeaderTitle", () => {
+ it("frames the splash copy around engineering work, not greenfield building", () => {
+ renderWithProviders(<HomeHeaderTitle />);
+
+ expect(screen.getByText("HOME$WHAT_TO_WORK_ON")).toBeInTheDocument();
+ expect(screen.getByTestId("home-header-subtitle")).toHaveTextContent(
+ "HOME$ENGINEERING_TASKS_SUBHEADER",
+ );
+ });
+});
diff --git a/src/components/features/chat/components/chat-input-container.tsx b/src/components/features/chat/components/chat-input-container.tsx
index c6a5f7e2b8..ba7b01872c 100644
--- a/src/components/features/chat/components/chat-input-container.tsx
+++ b/src/components/features/chat/components/chat-input-container.tsx
@@ -16,6 +16,7 @@ interface ChatInputContainerProps {
hasStartedConversation?: boolean;
isNewConversationPending?: boolean;
showButton: boolean;
+ placeholder?: string;
buttonClassName: string;
chatInputRef: React.RefObject<HTMLDivElement | null>;
handleFileIconClick: (isDisabled: boolean) => void;
@@ -42,6 +43,7 @@ export function ChatInputContainer({
hasStartedConversation,
isNewConversationPending = false,
showButton,
+ placeholder,
buttonClassName,
chatInputRef,
handleFileIconClick,
@@ -93,6 +95,7 @@ export function ChatInputContainer({
<ChatInputRow
chatInputRef={chatInputRef}
isNewConversationPending={isNewConversationPending}
+ placeholder={placeholder}
onInput={onInput}
onPaste={onPaste}
onKeyDown={onKeyDown}
diff --git a/src/components/features/chat/components/chat-input-field.tsx b/src/components/features/chat/components/chat-input-field.tsx
index c4274344b5..fecf06d1b0 100644
--- a/src/components/features/chat/components/chat-input-field.tsx
+++ b/src/components/features/chat/components/chat-input-field.tsx
@@ -8,6 +8,12 @@ import { cn } from "#/utils/utils";
interface ChatInputFieldProps {
chatInputRef: React.RefObject<HTMLDivElement | null>;
disabled?: boolean;
+ /**
+ * Overrides the default "what to build" placeholder. Surfaces that launch a
+ * new conversation (the home splash) ask for an engineering task instead.
+ * Plan mode still wins so the plan hint is never hidden.
+ */
+ placeholder?: string;
onInput: () => void;
onPaste: (e: React.ClipboardEvent) => void;
onKeyDown: (e: React.KeyboardEvent) => void;
@@ -18,6 +24,7 @@ interface ChatInputFieldProps {
export function ChatInputField({
chatInputRef,
disabled = false,
+ placeholder,
onInput,
onPaste,
onKeyDown,
@@ -59,7 +66,7 @@ export function ChatInputField({
data-placeholder={
isPlanMode
? t(I18nKey.COMMON$LET_S_WORK_ON_A_PLAN)
- : t(I18nKey.SUGGESTIONS$WHAT_TO_BUILD)
+ : (placeholder ?? t(I18nKey.SUGGESTIONS$WHAT_TO_BUILD))
}
data-testid="chat-input"
onInput={onInput}
diff --git a/src/components/features/chat/components/chat-input-row.tsx b/src/components/features/chat/components/chat-input-row.tsx
index c96d5cb1f8..d14f250e41 100644
--- a/src/components/features/chat/components/chat-input-row.tsx
+++ b/src/components/features/chat/components/chat-input-row.tsx
@@ -4,6 +4,7 @@ import { ChatInputField } from "./chat-input-field";
interface ChatInputRowProps {
chatInputRef: React.RefObject<HTMLDivElement | null>;
isNewConversationPending?: boolean;
+ placeholder?: string;
onInput: () => void;
onPaste: (e: React.ClipboardEvent) => void;
onKeyDown: (e: React.KeyboardEvent) => void;
@@ -14,6 +15,7 @@ interface ChatInputRowProps {
export function ChatInputRow({
chatInputRef,
isNewConversationPending = false,
+ placeholder,
onInput,
onPaste,
onKeyDown,
@@ -26,6 +28,7 @@ export function ChatInputRow({
<ChatInputField
chatInputRef={chatInputRef}
disabled={isNewConversationPending}
+ placeholder={placeholder}
onInput={onInput}
onPaste={onPaste}
onKeyDown={onKeyDown}
diff --git a/src/components/features/chat/custom-chat-input.tsx b/src/components/features/chat/custom-chat-input.tsx
index ae879522a8..ab50f17b05 100644
--- a/src/components/features/chat/custom-chat-input.tsx
+++ b/src/components/features/chat/custom-chat-input.tsx
@@ -16,6 +16,8 @@ export interface CustomChatInputProps {
isNewConversationPending?: boolean;
hasStartedConversation?: boolean;
showButton?: boolean;
+ /** Overrides the input's default placeholder text. */
+ placeholder?: string;
onSubmit: (message: string) => void;
onFocus?: () => void;
onBlur?: () => void;
@@ -32,6 +34,7 @@ export function CustomChatInput({
isNewConversationPending = false,
hasStartedConversation,
showButton = true,
+ placeholder,
onSubmit,
onFocus,
onBlur,
@@ -191,6 +194,7 @@ export function CustomChatInput({
hasStartedConversation={hasStartedConversation}
isNewConversationPending={isNewConversationPending}
showButton={showButton}
+ placeholder={placeholder}
buttonClassName={buttonClassName}
chatInputRef={chatInputRef}
handleFileIconClick={handleFileIconClick}
diff --git a/src/components/features/home/home-chat-launcher.tsx b/src/components/features/home/home-chat-launcher.tsx
index 3be6692720..00a9a97e7a 100644
--- a/src/components/features/home/home-chat-launcher.tsx
+++ b/src/components/features/home/home-chat-launcher.tsx
@@ -241,6 +241,7 @@ export function HomeChatLauncher() {
<CustomChatInput
onSubmit={handleSubmitWithModelGuard}
onFilesPaste={handleUpload}
+ placeholder={t(I18nKey.HOME$DESCRIBE_ENGINEERING_TASK)}
disabled={isCreating || llmBlocked}
/>
</div>
diff --git a/src/components/features/home/home-header/home-header-title.tsx b/src/components/features/home/home-header/home-header-title.tsx
index 54686a948e..6ff674c468 100644
--- a/src/components/features/home/home-header/home-header-title.tsx
+++ b/src/components/features/home/home-header/home-header-title.tsx
@@ -6,10 +6,16 @@ export function HomeHeaderTitle() {
const { t } = useTranslation("openhands");
return (
- <div className="flex w-full items-center justify-center py-2">
+ <div className="flex w-full flex-col items-center gap-2 py-2">
<Typography.H1 className="w-full text-center leading-normal">
- {t(I18nKey.HOME$LETS_START_BUILDING)}
+ {t(I18nKey.HOME$WHAT_TO_WORK_ON)}
</Typography.H1>
+ <p
+ data-testid="home-header-subtitle"
+ className="text-center text-[var(--oh-text-tertiary)]"
+ >
+ {t(I18nKey.HOME$ENGINEERING_TASKS_SUBHEADER)}
+ </p>
</div>
);
}
diff --git a/src/i18n/translation.json b/src/i18n/translation.json
index 1f44609bb5..be19e4add2 100644
--- a/src/i18n/translation.json
+++ b/src/i18n/translation.json
@@ -1546,22 +1546,56 @@
"uk": "Невірний JSON",
"ca": "JSON no vàlid"
},
- "HOME$LETS_START_BUILDING": {
- "en": "Let's Start Building!",
- "ja": "開発を始めましょう!",
- "zh-CN": "让我们开始开发!",
- "zh-TW": "讓我們開始開發!",
- "ko-KR": "개발을 시작합시다!",
- "no": "La oss begynne å bygge!",
- "it": "Iniziamo a costruire!",
- "pt": "Vamos começar a construir!",
- "es": "¡Comencemos a construir!",
- "ar": "لنبدأ البناء!",
- "fr": "Commençons à construire !",
- "tr": "Hadi İnşa Etmeye Başlayalım!",
- "de": "Lass uns anfangen zu bauen!",
- "uk": "Почнімо будувати!",
- "ca": "Comencem a construir!"
+ "HOME$WHAT_TO_WORK_ON": {
+ "en": "What do you want to work on?",
+ "ja": "何に取り組みますか?",
+ "zh-CN": "你想处理什么工作?",
+ "zh-TW": "你想處理什麼工作?",
+ "ko-KR": "무엇을 작업하고 싶으신가요?",
+ "no": "Hva vil du jobbe med?",
+ "it": "Su cosa vuoi lavorare?",
+ "pt": "No que você quer trabalhar?",
+ "es": "¿En qué quieres trabajar?",
+ "ar": "على ماذا تريد أن تعمل؟",
+ "fr": "Sur quoi voulez-vous travailler ?",
+ "tr": "Ne üzerinde çalışmak istiyorsun?",
+ "de": "Woran möchten Sie arbeiten?",
+ "uk": "Над чим ви хочете працювати?",
+ "ca": "En què vols treballar?"
+ },
+ "HOME$ENGINEERING_TASKS_SUBHEADER": {
+ "en": "Investigate, implement, debug, test, review, or automate work across your codebase.",
+ "ja": "コードベース全体で、調査、実装、デバッグ、テスト、レビュー、作業の自動化ができます。",
+ "zh-CN": "在你的代码库中调查、实现、调试、测试、审查或自动化工作。",
+ "zh-TW": "在你的程式碼庫中調查、實作、除錯、測試、審查或自動化工作。",
+ "ko-KR": "코드베이스 전반에서 조사, 구현, 디버깅, 테스트, 검토 또는 작업 자동화를 수행하세요.",
+ "no": "Undersøk, implementer, feilsøk, test, gjennomgå eller automatiser arbeid på tvers av kodebasen din.",
+ "it": "Analizza, implementa, esegui il debug, testa, revisiona o automatizza il lavoro nella tua codebase.",
+ "pt": "Investigue, implemente, depure, teste, revise ou automatize o trabalho em sua base de código.",
+ "es": "Investiga, implementa, depura, prueba, revisa o automatiza el trabajo en tu base de código.",
+ "ar": "استكشف أو نفّذ أو صحّح الأخطاء أو اختبر أو راجع أو قم بأتمتة العمل في قاعدة التعليمات البرمجية الخاصة بك.",
+ "fr": "Analysez, implémentez, déboguez, testez, révisez ou automatisez le travail dans votre base de code.",
+ "tr": "Kod tabanınızda araştırma, geliştirme, hata ayıklama, test ve inceleme yapın ya da işleri otomatikleştirin.",
+ "de": "Untersuchen, implementieren, debuggen, testen, überprüfen oder automatisieren Sie Arbeit in Ihrer Codebasis.",
+ "uk": "Досліджуйте, реалізуйте, налагоджуйте, тестуйте, переглядайте або автоматизуйте роботу у вашій кодовій базі.",
+ "ca": "Investiga, implementa, depura, prova, revisa o automatitza el treball al teu codi base."
+ },
+ "HOME$DESCRIBE_ENGINEERING_TASK": {
+ "en": "Describe an engineering task…",
+ "ja": "エンジニアリングタスクを入力してください…",
+ "zh-CN": "描述一个工程任务…",
+ "zh-TW": "描述一個工程任務…",
+ "ko-KR": "엔지니어링 작업을 설명하세요…",
+ "no": "Beskriv en ingeniøroppgave …",
+ "it": "Descrivi un'attività di ingegneria…",
+ "pt": "Descreva uma tarefa de engenharia…",
+ "es": "Describe una tarea de ingeniería…",
+ "ar": "اوصف مهمة هندسية…",
+ "fr": "Décrivez une tâche d'ingénierie…",
+ "tr": "Bir mühendislik görevi tanımlayın…",
+ "de": "Beschreiben Sie eine Engineering-Aufgabe…",
+ "uk": "Опишіть інженерне завдання…",
+ "ca": "Descriu una tasca d'enginyeria…"
},
"HOME$OPENHANDS_DESCRIPTION": {
"en": "OpenHands makes it easy to build and maintain software using AI-driven development.",