Skip to content

Commit f12579b

Browse files
committed
style: soften draft welcome title
Makes the welcome prompt lighter Keeps the project name visually emphasized
1 parent 9f3f593 commit f12579b

2 files changed

Lines changed: 42 additions & 8 deletions

File tree

packages/ui/src/components/chat/ChatContainer.tsx

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,20 @@ const getProjectDisplayLabel = (project: { label?: string; path: string }): stri
337337
return label || formatDirectoryName(project.path);
338338
};
339339

340+
const renderDraftTitle = (title: string, projectLabel: string | null): React.ReactNode => {
341+
if (!projectLabel) return title;
342+
const projectIndex = title.indexOf(projectLabel);
343+
if (projectIndex === -1) return title;
344+
345+
return (
346+
<>
347+
{title.slice(0, projectIndex)}
348+
<span className="font-medium">{projectLabel}</span>
349+
{title.slice(projectIndex + projectLabel.length)}
350+
</>
351+
);
352+
};
353+
340354
type ChatContainerProps = {
341355
autoOpenDraft?: boolean;
342356
readOnly?: boolean;
@@ -794,10 +808,13 @@ export const ChatContainer: React.FC<ChatContainerProps> = ({ autoOpenDraft = tr
794808
<div className="relative flex h-full flex-col bg-background transform-gpu">
795809
{useCompactDraftLayout && !isDesktopExpandedInput ? (
796810
<div className="flex min-h-0 flex-1 items-center justify-center px-6 text-center">
797-
<h1 className="text-balance text-3xl font-medium tracking-tight text-foreground">
798-
{draftProjectLabel
799-
? t('chat.emptyState.draftTitleWithProject', { project: draftProjectLabel })
800-
: t('chat.emptyState.draftTitle')}
811+
<h1 className="text-balance text-3xl font-normal tracking-tight text-foreground">
812+
{renderDraftTitle(
813+
draftProjectLabel
814+
? t('chat.emptyState.draftTitleWithProject', { project: draftProjectLabel })
815+
: t('chat.emptyState.draftTitle'),
816+
draftProjectLabel,
817+
)}
801818
</h1>
802819
</div>
803820
) : null}

packages/ui/src/components/chat/ChatInput.tsx

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,20 @@ const getProjectDisplayLabel = (project: { label?: string; path: string }): stri
318318
return formatDirectoryName(project.path);
319319
};
320320

321+
const renderDraftTitle = (title: string, projectLabel: string | null): React.ReactNode => {
322+
if (!projectLabel) return title;
323+
const projectIndex = title.indexOf(projectLabel);
324+
if (projectIndex === -1) return title;
325+
326+
return (
327+
<>
328+
{title.slice(0, projectIndex)}
329+
<span className="font-medium">{projectLabel}</span>
330+
{title.slice(projectIndex + projectLabel.length)}
331+
</>
332+
);
333+
};
334+
321335
const getProjectIconColor = (projectColor?: string | null): string | undefined => {
322336
if (!projectColor) {
323337
return undefined;
@@ -3789,10 +3803,13 @@ const ChatInputComponent: React.FC<ChatInputProps> = ({ onOpenSettings, scrollTo
37893803
>
37903804
{newSessionDraftOpen && !isDesktopExpanded && !isMobile && !isVSCode && !isMiniChatSurface ? (
37913805
<div className="chat-input-column mb-7 text-center">
3792-
<h1 className="text-balance text-2xl font-medium tracking-tight text-foreground md:text-3xl">
3793-
{draftProjectLabel
3794-
? t('chat.emptyState.draftTitleWithProject', { project: draftProjectLabel })
3795-
: t('chat.emptyState.draftTitle')}
3806+
<h1 className="text-balance text-2xl font-normal tracking-tight text-foreground md:text-3xl">
3807+
{renderDraftTitle(
3808+
draftProjectLabel
3809+
? t('chat.emptyState.draftTitleWithProject', { project: draftProjectLabel })
3810+
: t('chat.emptyState.draftTitle'),
3811+
draftProjectLabel,
3812+
)}
37963813
</h1>
37973814
</div>
37983815
) : null}

0 commit comments

Comments
 (0)