diff --git a/apps/web/src/components/pure/quick-search-modal/Footer.tsx b/apps/web/src/components/pure/quick-search-modal/Footer.tsx index 9a3e75b4e6..fdfd1fe2d2 100644 --- a/apps/web/src/components/pure/quick-search-modal/Footer.tsx +++ b/apps/web/src/components/pure/quick-search-modal/Footer.tsx @@ -27,6 +27,11 @@ export const Footer: React.FC = ({ const { createPage } = useBlockSuiteWorkspaceHelper(blockSuiteWorkspace); const { t } = useTranslation(); const { jumpToPage } = useRouterHelper(router); + const MAX_QUERY_SHOW_LENGTH = 20; + const normalizedQuery = + query.length > MAX_QUERY_SHOW_LENGTH + ? query.slice(0, MAX_QUERY_SHOW_LENGTH) + '...' + : query; return ( = ({ {query ? ( - {t('New Keyword Page', { query: query })} + {t('New Keyword Page', { query: normalizedQuery })} ) : ( {t('New Page')} )} diff --git a/apps/web/src/components/pure/quick-search-modal/style.ts b/apps/web/src/components/pure/quick-search-modal/style.ts index 4440b05cf1..dfbdd7041e 100644 --- a/apps/web/src/components/pure/quick-search-modal/style.ts +++ b/apps/web/src/components/pure/quick-search-modal/style.ts @@ -1,4 +1,4 @@ -import { displayFlex, styled } from '@affine/component'; +import { displayFlex, styled, textEllipsis } from '@affine/component'; export const StyledContent = styled('div')(({ theme }) => { return { @@ -150,6 +150,9 @@ export const StyledListItem = styled('button')(({ theme }) => { borderRadius: '5px', transition: 'background .15s, color .15s', ...displayFlex('flex-start', 'center'), + span: { + ...textEllipsis(1), + }, '>svg': { fontSize: '20px', marginRight: '12px',