From 7f8bfb6e4a8ece583403757d1052256041f6ad9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AF=97=E6=B5=93?= <844670992@qq.com> Date: Thu, 27 Mar 2025 15:58:23 +0800 Subject: [PATCH] fix(ui): improve chart text spacing and prevent unnecessary truncation (#16894) --- web/app/components/app-sidebar/basic.tsx | 12 ++++++++---- web/app/components/app/overview/appChart.tsx | 3 ++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/web/app/components/app-sidebar/basic.tsx b/web/app/components/app-sidebar/basic.tsx index 34704dbd7e..6a7d5a13c2 100644 --- a/web/app/components/app-sidebar/basic.tsx +++ b/web/app/components/app-sidebar/basic.tsx @@ -54,7 +54,7 @@ const ICON_MAP = { notion: , } -export default function AppBasic({ icon, icon_background, name, isExternal, type, hoverTip, textStyle, mode = 'expand', iconType = 'app' }: IAppBasicProps) { +export default function AppBasic({ icon, icon_background, name, isExternal, type, hoverTip, textStyle, isExtraInLine, mode = 'expand', iconType = 'app' }: IAppBasicProps) { const { t } = useTranslation() return ( @@ -70,9 +70,9 @@ export default function AppBasic({ icon, icon_background, name, isExternal, type } - {mode === 'expand' &&
+ {mode === 'expand' &&
-
+
{name}
{hoverTip @@ -88,7 +88,11 @@ export default function AppBasic({ icon, icon_background, name, isExternal, type /> }
-
{isExternal ? t('dataset.externalTag') : ''}
+ {isExtraInLine ? ( +
{type}
+ ) : ( +
{isExternal ? t('dataset.externalTag') : type}
+ )}
}
) diff --git a/web/app/components/app/overview/appChart.tsx b/web/app/components/app/overview/appChart.tsx index 7ac7f92fbc..4e74eda600 100644 --- a/web/app/components/app/overview/appChart.tsx +++ b/web/app/components/app/overview/appChart.tsx @@ -237,7 +237,7 @@ const Chart: React.FC = ({
{t('appOverview.analysis.tokenUsage.consumed')} Tokens @@ -350,6 +350,7 @@ export const TokenPerSecond: FC = ({ id, period }) => { isAvg unit={t('appOverview.analysis.tokenPS') as string} {...(noDataFlag && { yMax: 100 })} + className="min-w-0" /> }