From e8ba8e996f2ff7261a44ce41da831eeb7494bc24 Mon Sep 17 00:00:00 2001 From: Bohdan Triapitsyn Date: Wed, 2 Sep 2026 12:19:55 +0300 Subject: [PATCH] fix: show full desktop instance label in header --- packages/ui/src/components/layout/Header.tsx | 29 ++------------------ 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/packages/ui/src/components/layout/Header.tsx b/packages/ui/src/components/layout/Header.tsx index 41bc1dfa..e89c2ec1 100644 --- a/packages/ui/src/components/layout/Header.tsx +++ b/packages/ui/src/components/layout/Header.tsx @@ -124,7 +124,6 @@ const HeaderIconActionButton = React.memo(function HeaderIconActionButton({ type DesktopServicesMenuProps = { isDesktopApp: boolean; currentInstanceLabel: string; - compactCurrentInstanceLabel: string; currentInstanceIsLocal: boolean; isDesktopServicesOpen: boolean; setIsDesktopServicesOpen: React.Dispatch>; @@ -139,7 +138,6 @@ type DesktopServicesMenuProps = { const DesktopServicesMenu = React.memo(function DesktopServicesMenu({ isDesktopApp, currentInstanceLabel, - compactCurrentInstanceLabel, currentInstanceIsLocal, isDesktopServicesOpen, setIsDesktopServicesOpen, @@ -171,12 +169,12 @@ const DesktopServicesMenu = React.memo(function DesktopServicesMenu({ : t('header.services.open')} className={cn( DESKTOP_HEADER_ICON_BUTTON_CLASS, - isDesktopApp ? 'w-auto max-w-[14rem] justify-start gap-1.5 px-2.5' : 'h-8 w-8' + isDesktopApp ? 'w-auto max-w-[20rem] justify-start gap-1.5 px-2.5' : 'h-8 w-8' )} > {isDesktopApp ? ( - {compactCurrentInstanceLabel} + {currentInstanceLabel} ) : null} @@ -251,27 +249,6 @@ const isSameContextUsage = ( && (a.lastMessageId ?? '') === (b.lastMessageId ?? ''); }; -const formatCompactHeaderLabel = (value: string): string => { - const trimmed = value.trim(); - if (!trimmed) { - return ''; - } - - const words = trimmed.split(/\s+/).filter(Boolean); - if (words.length >= 2) { - const first = words[0]; - const second = words[1].slice(0, 3); - const shortTwoWord = `${first} ${second}`.trim(); - if (words.length > 2 || shortTwoWord.length < trimmed.length) { - return `${shortTwoWord}...`; - } - return shortTwoWord; - } - - return trimmed.length > 12 ? `${trimmed.slice(0, 9).trimEnd()}...` : trimmed; -}; - - const normalize = (value: string): string => { if (!value) return ''; const replaced = value.replace(/\\/g, '/'); @@ -447,7 +424,6 @@ export const Header: React.FC = () => { const [remoteUpdateInfo, setRemoteUpdateInfo] = React.useState(null); const [remoteUpdateChecking, setRemoteUpdateChecking] = React.useState(false); const [remoteUpdateError, setRemoteUpdateError] = React.useState(null); - const compactCurrentInstanceLabel = React.useMemo(() => formatCompactHeaderLabel(currentInstanceLabel), [currentInstanceLabel]); const isVSCode = React.useMemo(() => isVSCodeRuntime(), []); // While the work-status panel is on screen it already reports the project, // the branch and the context fill — three paces away in the same window. @@ -1293,7 +1269,6 @@ export const Header: React.FC = () => {