Skip to content
TypeScript

fix(web): truncate project names only when needed (#17208)

Daniel Gurney871c7b77576e
diff --git a/apps/web/src/components/chat/DraftHeroHeadline.tsx b/apps/web/src/components/chat/DraftHeroHeadline.tsx
index e04da17416a..d3198b237c4 100644
--- a/apps/web/src/components/chat/DraftHeroHeadline.tsx
+++ b/apps/web/src/components/chat/DraftHeroHeadline.tsx
@@ -253,7 +253,8 @@ export function DraftHeroHeadline({
<ComboboxTrigger
render={<InlineButton tone="picker" />}
data-draft-project-trigger=""
- className="pointer-events-auto max-w-64 align-baseline"
+ // Leaves room for the trailing "?" so a truncated name keeps it on its line.
+ className="pointer-events-auto max-w-[calc(100%-1em)] align-baseline"
/>
}
>
@@ -354,7 +355,9 @@ export function DraftHeroHeadline({
{isScratchDraft ? (
<>What should we work on?</>
) : hasResolvedProject ? (
- <>What should we build in {projectSelector}?</>
+ <>
+ What should we build in <span className="whitespace-nowrap">{projectSelector}?</span>
+ </>
) : canChooseProject ? (
<>{projectSelector} to start</>
) : (