diff --git a/.changeset/36193-recent-activity-card-no-comments.md b/.changeset/36193-recent-activity-card-no-comments.md new file mode 100644 index 00000000000..cc1d25ee047 --- /dev/null +++ b/.changeset/36193-recent-activity-card-no-comments.md @@ -0,0 +1,11 @@ +--- +'@object-ui/plugin-detail': patch +--- + +fix(plugin-detail): a slotted page's record:chatter on the 动态 tab lists the system history alone while the comment panel holds the comments + +Clause-②: no +Metadata-protocol: none + +- A page whose `discussion` slot holds `record:chatter` or `record:discussion` draws that block on the record page's 动态 tab. While the comment panel is offered beside the record, on the page or in the drawer (objectstack#36075), the block now draws the system entries alone, as the platform's own 动态 stream does there: no comment and no reply, no comment box, no Comments-only filter, a count without the comments, the 动态 heading instead of 「讨论」, and the activity empty line instead of 「暂无评论」. A refused or failed comment read is the panel's to report, not this block's. +- Not changed: the platform's own 动态 stream, the 动态 tab's label, a page an author composed whole, and the phone while it has no comment surface. diff --git a/ui/packages/plugin-detail/src/RecordChatterPanel.tsx b/ui/packages/plugin-detail/src/RecordChatterPanel.tsx index 7d78804b23a..4a00b175a02 100644 --- a/ui/packages/plugin-detail/src/RecordChatterPanel.tsx +++ b/ui/packages/plugin-detail/src/RecordChatterPanel.tsx @@ -8,7 +8,7 @@ import * as React from 'react'; import { cn, Button } from '@object-ui/components'; -import { MessageSquare, PanelRightOpen, PanelRightClose, X } from 'lucide-react'; +import { Activity, MessageSquare, PanelRightOpen, PanelRightClose, X } from 'lucide-react'; import type { RecordChatterComponentProps, FeedItem, RecordSubscription } from '@object-ui/types'; import { RecordActivityTimeline } from './RecordActivityTimeline'; import type { FeedFilterMode } from './RecordActivityTimeline'; @@ -94,6 +94,13 @@ export interface RecordChatterPanelProps { commentsFailed?: boolean; /** Read the failed feed reads again; forwarded to the timeline's Retry. */ onRetryFeed?: () => void; + /** + * The panel's heading, in place of 「讨论」, and its empty line, in place of + * 「暂无评论」. The renderer names them when the panel holds no comments + * (objectstack#36193: the comment panel holds them). + */ + titleLabel?: string; + emptyLabel?: string; className?: string; } @@ -131,6 +138,8 @@ export const RecordChatterPanel: React.FC = ({ activityFailed, commentsFailed, onRetryFeed, + titleLabel, + emptyLabel, className, }) => { const position = config?.position ?? 'right'; @@ -139,6 +148,10 @@ export const RecordChatterPanel: React.FC = ({ const defaultCollapsed = (collapseWhenEmpty && items.length === 0) || (config?.defaultCollapsed ?? false); const { t } = useDetailTranslation(); + const title = titleLabel ?? t('detail.discussion'); + // A heading named by the caller (动态, objectstack#36193) takes the stream's icon. + const TitleIcon = titleLabel ? Activity : MessageSquare; + const empty = emptyLabel ?? t('detail.noCommentsYet'); const [collapsed, setCollapsed] = React.useState(defaultCollapsed); /** * The feed's own `aria` bag (objectui#11083). The spec declares `feed` as @@ -204,8 +217,8 @@ export const RecordChatterPanel: React.FC = ({ {/* Header */}
- - {t('detail.discussion')} + + {title}
{collapsible && (