🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.
TypeScript agentagent-collaborationagent-harnessloop-engineeringmcppersonal-assistantproactive-agentskillssuper-agenttask-management
🐛 fix(tool-ui): fix icon margin and text overflow in FilePathDisplay (#12331)
Innei1f1c49fc52f7
diff --git a/packages/builtin-tool-local-system/src/client/Inspector/ListLocalFiles/index.tsx b/packages/builtin-tool-local-system/src/client/Inspector/ListLocalFiles/index.tsxindex f4195915478..5349a5748c5 100644--- a/packages/builtin-tool-local-system/src/client/Inspector/ListLocalFiles/index.tsx+++ b/packages/builtin-tool-local-system/src/client/Inspector/ListLocalFiles/index.tsx@@ -2,7 +2,7 @@import type { ListLocalFileParams } from '@lobechat/electron-client-ipc';import type { BuiltinInspectorProps } from '@lobechat/types';-import { Text } from '@lobehub/ui';+import { Flexbox, Text } from '@lobehub/ui';import { cssVar, cx } from 'antd-style';import { memo } from 'react';import { useTranslation } from 'react-i18next';@@ -43,7 +43,9 @@ export const ListLocalFilesInspector = memo<return (<div className={cx(inspectorTextStyles.root, isLoading && shinyTextStyles.shinyText)}><span>{t('builtins.lobe-local-system.apiName.listLocalFiles')}: </span>- <FilePathDisplay isDirectory filePath={path} />+ <Flexbox allowShrink horizontal align={'center'} justify={'center'}>+ <FilePathDisplay isDirectory filePath={path} />+ </Flexbox>{!isLoading &&pluginState?.listResults &&(hasResults ? (diff --git a/packages/builtin-tool-local-system/src/client/components/FilePathDisplay.tsx b/packages/builtin-tool-local-system/src/client/components/FilePathDisplay.tsxindex 1ae5dc630bd..2da993b8173 100644--- a/packages/builtin-tool-local-system/src/client/components/FilePathDisplay.tsx+++ b/packages/builtin-tool-local-system/src/client/components/FilePathDisplay.tsx@@ -1,6 +1,6 @@'use client';-import { MaterialFileTypeIcon } from '@lobehub/ui';+import { MaterialFileTypeIcon, Text } from '@lobehub/ui';import { createStaticStyles, cssVar } from 'antd-style';import path from 'path-browserify-esm';import { memo, useMemo } from 'react';@@ -11,7 +11,10 @@ const styles = createStaticStyles(({ css }) => ({margin-inline-end: 4px;`,text: css`+ overflow: hidden;color: ${cssVar.colorText};+ text-overflow: ellipsis;+ white-space: nowrap;`,}));@@ -42,13 +45,23 @@ export const FilePathDisplay = memo<FilePathDisplayProps>(({ filePath, isDirecto{name && (<MaterialFileTypeIconclassName={styles.icon}+ fallbackUnknownType={false}filename={name}size={16}type={isDirectory ? 'folder' : 'file'}variant={'raw'}/>)}- {displayPath && <span className={styles.text}>{displayPath}</span>}+ {displayPath && (+ <Text+ className={styles.text}+ ellipsis={{+ tooltipWhenOverflow: true,+ }}+ >+ {displayPath}+ </Text>+ )}</>);});diff --git a/src/components/DragUploadZone/index.tsx b/src/components/DragUploadZone/index.tsxindex efb4163768b..c39e42ce081 100644--- a/src/components/DragUploadZone/index.tsx+++ b/src/components/DragUploadZone/index.tsx@@ -48,8 +48,6 @@ const styles = createStaticStyles(({ css }) => ({align-items: center;justify-content: center;- border-radius: ${cssVar.borderRadiusLG};-background: ${cssVar.colorBgMask};transition: all 0.2s ease-in-out;diff --git a/src/styles/text.ts b/src/styles/text.tsindex ee355f588e8..db81229710a 100644--- a/src/styles/text.ts+++ b/src/styles/text.ts@@ -19,12 +19,14 @@ export const oneLineEllipsis = lineEllipsis(1);export const inspectorTextStyles = createStaticStyles(({ css, cssVar }) => ({root: css`overflow: hidden;- display: -webkit-box;- -webkit-box-orient: vertical;- -webkit-line-clamp: 1;+ display: flex;+ align-items: center;++ min-width: 0;color: ${cssVar.colorTextSecondary};text-overflow: ellipsis;+ white-space: nowrap;`,}));