From 4a1ebd98da456271b9532b9f86b6b35417dceabc Mon Sep 17 00:00:00 2001 From: Bohdan Triapitsyn Date: Thu, 28 May 2026 01:25:55 +0300 Subject: [PATCH] style: soften draft welcome title Makes the welcome prompt lighter Keeps the project name visually emphasized --- .../ui/src/components/chat/ChatContainer.tsx | 25 ++++++++++++++++--- packages/ui/src/components/chat/ChatInput.tsx | 25 ++++++++++++++++--- 2 files changed, 42 insertions(+), 8 deletions(-) diff --git a/packages/ui/src/components/chat/ChatContainer.tsx b/packages/ui/src/components/chat/ChatContainer.tsx index 55981f38..54ee63d6 100644 --- a/packages/ui/src/components/chat/ChatContainer.tsx +++ b/packages/ui/src/components/chat/ChatContainer.tsx @@ -337,6 +337,20 @@ const getProjectDisplayLabel = (project: { label?: string; path: string }): stri return label || formatDirectoryName(project.path); }; +const renderDraftTitle = (title: string, projectLabel: string | null): React.ReactNode => { + if (!projectLabel) return title; + const projectIndex = title.indexOf(projectLabel); + if (projectIndex === -1) return title; + + return ( + <> + {title.slice(0, projectIndex)} + {projectLabel} + {title.slice(projectIndex + projectLabel.length)} + + ); +}; + type ChatContainerProps = { autoOpenDraft?: boolean; readOnly?: boolean; @@ -794,10 +808,13 @@ export const ChatContainer: React.FC = ({ autoOpenDraft = tr
{useCompactDraftLayout && !isDesktopExpandedInput ? (
-

- {draftProjectLabel - ? t('chat.emptyState.draftTitleWithProject', { project: draftProjectLabel }) - : t('chat.emptyState.draftTitle')} +

+ {renderDraftTitle( + draftProjectLabel + ? t('chat.emptyState.draftTitleWithProject', { project: draftProjectLabel }) + : t('chat.emptyState.draftTitle'), + draftProjectLabel, + )}

) : null} diff --git a/packages/ui/src/components/chat/ChatInput.tsx b/packages/ui/src/components/chat/ChatInput.tsx index a0fb4a6e..a537daa8 100644 --- a/packages/ui/src/components/chat/ChatInput.tsx +++ b/packages/ui/src/components/chat/ChatInput.tsx @@ -318,6 +318,20 @@ const getProjectDisplayLabel = (project: { label?: string; path: string }): stri return formatDirectoryName(project.path); }; +const renderDraftTitle = (title: string, projectLabel: string | null): React.ReactNode => { + if (!projectLabel) return title; + const projectIndex = title.indexOf(projectLabel); + if (projectIndex === -1) return title; + + return ( + <> + {title.slice(0, projectIndex)} + {projectLabel} + {title.slice(projectIndex + projectLabel.length)} + + ); +}; + const getProjectIconColor = (projectColor?: string | null): string | undefined => { if (!projectColor) { return undefined; @@ -3789,10 +3803,13 @@ const ChatInputComponent: React.FC = ({ onOpenSettings, scrollTo > {newSessionDraftOpen && !isDesktopExpanded && !isMobile && !isVSCode && !isMiniChatSurface ? (
-

- {draftProjectLabel - ? t('chat.emptyState.draftTitleWithProject', { project: draftProjectLabel }) - : t('chat.emptyState.draftTitle')} +

+ {renderDraftTitle( + draftProjectLabel + ? t('chat.emptyState.draftTitleWithProject', { project: draftProjectLabel }) + : t('chat.emptyState.draftTitle'), + draftProjectLabel, + )}

) : null}