From f94bec0c6cc9bc05267f1197d3363234ae9639d7 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 21 Nov 2026 22:57:46 +0000 Subject: [PATCH 1/3] =?UTF-8?q?fix(plugin-detail):=20the=20overview's=20?= =?UTF-8?q?=E6=9C=80=E8=BF=91=E5=8A=A8=E6=80=81=20card=20lists=20the=20sys?= =?UTF-8?q?tem=20history=20alone=20while=20the=20comment=20panel=20holds?= =?UTF-8?q?=20the=20comments?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A slotted page's record:chatter / record:discussion stream is drawn in the card as the record:activity block its feed configures, in the peek face: no comments, no replies, no 讨论 heading, a count of the system entries, no card without system history. The 动态 tab and its label are unchanged. Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01L6bhgXV5qLuX94Bn6aqb4y --- .../36193-recent-activity-card-no-comments.md | 12 ++ .../plugin-detail/src/RecordSummaryRail.tsx | 47 ++++++-- ...SummaryRail.commentsInPanel-36193.test.tsx | 106 ++++++++++++++++++ 3 files changed, 158 insertions(+), 7 deletions(-) create mode 100644 .changeset/36193-recent-activity-card-no-comments.md create mode 100644 ui/packages/plugin-detail/src/__tests__/RecordSummaryRail.commentsInPanel-36193.test.tsx 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..63aa8839436 --- /dev/null +++ b/.changeset/36193-recent-activity-card-no-comments.md @@ -0,0 +1,12 @@ +--- +'@object-ui/plugin-detail': patch +--- + +fix(plugin-detail): the overview's 最近动态 card lists the system history alone while the comment panel holds the comments, on a slotted page with a `record:chatter` stream too + +Clause-②: no +Metadata-protocol: none + +- On a page whose `discussion` slot holds `record:chatter` or `record:discussion`, the 概览 tab's 最近动态 card drew the chatter's own panel face: a 「讨论 (N)」 heading counting comments, the 全部动态 filter, every comment and its replies, and 加载更多. While the comment panel is offered (desktop page, objectstack#36075), the card now draws that stream as the `record:activity` block its `feed` configures, in the peek face the default page's card already uses: the newest three system entries, no comment or reply, no 讨论 heading, and a count of the system entries alone. With no system history the card is not drawn, whatever the comments. +- The card keeps that count to itself: the 动态 tab still draws the chatter with its comments, so its label in the tab row is unchanged. +- Not changed: the 动态 tab, the comment panel, the default page's card (already system history only), the drawer (draws no rail), the phone (no comment panel), and an authored page. diff --git a/ui/packages/plugin-detail/src/RecordSummaryRail.tsx b/ui/packages/plugin-detail/src/RecordSummaryRail.tsx index a685fbd5ae3..d6e4c124e97 100644 --- a/ui/packages/plugin-detail/src/RecordSummaryRail.tsx +++ b/ui/packages/plugin-detail/src/RecordSummaryRail.tsx @@ -13,7 +13,7 @@ import { columnIdentity, composeParentScopeFilter, mergeFilterNodes, type FieldC import { formatCurrency } from '@object-ui/fields'; import { resolveFieldCurrency, useDisplayLocale, useLocalization, withFollowedParent } from '@object-ui/i18n'; import { SchemaRenderer, toRenderableSchema, useRecordContext } from '@object-ui/react'; -import { RecordTimelinePanelContext, type RecordTimelinePanel } from './recordTimelineStream'; +import { RecordCommentsInPanelContext, RecordTimelinePanelContext, type RecordTimelinePanel } from './recordTimelineStream'; import { resolveTitleField } from './synth/buildDefaultPageSchema'; import type { RelatedCardId } from './synth/relatedArrangement'; import { useDetailTranslation } from './useDetailTranslation'; @@ -342,19 +342,30 @@ const TimelineSummary: React.FC<{ timelineId: string; }> = ({ nodes, count, onCount, onOpen, timelineId }) => { const { t } = useDetailTranslation(); + const commentsInPanel = React.useContext(RecordCommentsInPanelContext); + const peekNodes = React.useMemo( + () => railStreamNodes(nodes, commentsInPanel).map(readOnlyStreamNode), + [nodes, commentsInPanel], + ); + // A chatter stream drawn as the system history (objectstack#36193) keeps its + // count to this card: the 动态 tab still draws that chatter, comments and + // all, so the tab row is not handed a count of the system entries alone. + const ownCount = peekNodes.some((node, index) => node !== nodes[index] && node?.type === 'record:activity' && nodes[index]?.type !== 'record:activity'); + const [cardCount, setCardCount] = React.useState(null); + const reportCount = ownCount ? setCardCount : onCount; + const shownCount = ownCount ? cardCount : count; const panel = React.useMemo( - () => ({ entries: RECORD_SUMMARY_ROWS, onCount }), - [onCount], + () => ({ entries: RECORD_SUMMARY_ROWS, onCount: reportCount }), + [reportCount], ); - const peekNodes = React.useMemo(() => nodes.map(readOnlyStreamNode), [nodes]); - const counted = nodes.some((node) => node && typeof node === 'object' && node.type === 'record:activity'); + const counted = peekNodes.some((node) => node && typeof node === 'object' && node.type === 'record:activity'); return (