Skip to content

🤯 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.

💄 style(portal): keep acceptance panel titles on one line (#21482)

LiJian73f65b1fdc7e
diff --git a/src/features/Portal/Acceptance/Title.tsx b/src/features/Portal/Acceptance/Title.tsx
index 5a09259b39f..10cd05cd9f8 100644
--- a/src/features/Portal/Acceptance/Title.tsx
+++ b/src/features/Portal/Acceptance/Title.tsx
@@ -1,3 +1,4 @@
+import { Text } from '@lobehub/ui';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
@@ -10,7 +11,13 @@ const Title = memo(() => {
const acceptanceId = useChatStore(chatPortalSelectors.acceptancePortalId);
const { data } = useAcceptanceBundle(acceptanceId ?? null);
- return data?.subject.title || t('acceptance.titleFallback');
+ // One line in the panel header: a long title ends in an ellipsis instead of
+ // pushing the header to two lines, and shows in full on hover.
+ return (
+ <Text ellipsis={{ tooltipWhenOverflow: true }} style={{ minWidth: 0 }}>
+ {data?.subject.title || t('acceptance.titleFallback')}
+ </Text>
+ );
});
export default Title;
diff --git a/src/features/Portal/AcceptanceCheck/Title.tsx b/src/features/Portal/AcceptanceCheck/Title.tsx
index 81af76e0938..81523061359 100644
--- a/src/features/Portal/AcceptanceCheck/Title.tsx
+++ b/src/features/Portal/AcceptanceCheck/Title.tsx
@@ -1,3 +1,4 @@
+import { Text } from '@lobehub/ui';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
@@ -16,13 +17,20 @@ const Title = memo(() => {
const { data } = useAcceptanceBundle(portal?.acceptanceId ?? null);
const check = data?.checks.find((item) => item.id === portal?.checkId);
- if (!check) return t('taskDetail.acceptance.detailTitle');
+ let title: string = t('taskDetail.acceptance.detailTitle');
+ if (check) {
+ const name = checkDisplayTitle(
+ check.title,
+ t('acceptance.checks.holisticTitle', { ns: 'verify' }),
+ );
+ title = check.seq ? `C${check.seq} · ${name}` : name;
+ }
- const title = checkDisplayTitle(
- check.title,
- t('acceptance.checks.holisticTitle', { ns: 'verify' }),
+ return (
+ <Text ellipsis={{ tooltipWhenOverflow: true }} style={{ minWidth: 0 }}>
+ {title}
+ </Text>
);
- return check.seq ? `C${check.seq} · ${title}` : title;
});
Title.displayName = 'AcceptanceCheckPortalTitle';
diff --git a/src/features/Portal/VerifyReport/Title.tsx b/src/features/Portal/VerifyReport/Title.tsx
index 15b8e7d2d9a..ac5c4bd9d48 100644
--- a/src/features/Portal/VerifyReport/Title.tsx
+++ b/src/features/Portal/VerifyReport/Title.tsx
@@ -1,3 +1,4 @@
+import { Text } from '@lobehub/ui';
import { memo } from 'react';
import { useVerifyReportBundle } from '@/features/Acceptance/hooks';
@@ -8,7 +9,11 @@ const Title = memo(() => {
const runId = useChatStore(chatPortalSelectors.verifyReportRunId);
const { data } = useVerifyReportBundle(runId ?? null);
- return data?.run.title || 'Verify report';
+ return (
+ <Text ellipsis={{ tooltipWhenOverflow: true }} style={{ minWidth: 0 }}>
+ {data?.run.title || 'Verify report'}
+ </Text>
+ );
});
export default Title;