Skip to content

Commit ee5fdc8

Browse files
fix(record-page): authored feed panels show the record's field history and offer Field Changes (#35311)
<!-- claude-projects-attribution: {"github_login":"os-bill"} --> _Requested by **Bill** · [project thread](https://claude.ai/code/project/chan_016iMXWSZDzqWRWvWzdNo8wg?thread=cmsg_016iMXWSZDzqWRWvWzdNo8wg48yiCyRmnqoUoHcQ9VbBp6)_ Fixes #33996 Clause-②: no Metadata-protocol: none ## 维护者速读 - **改了什么**:对象开了字段历史(`trackHistory`)时,作者自定义的记录页上,讨论/动态面板(`record:discussion`、`record:chatter`、`record:activity`)现在也显示「谁把哪个字段从多少改成多少」,筛选里出现「仅字段变更」;作者写的默认筛选 `changes_only` 不再被悄悄当成「全部」。 - **为什么改**:按裁决 6996126030「A 补实现」:以前只有平台自动生成的默认页读字段历史,作者一自定义记录页,这份信息在页上任何地方都看不到。 - **风险与回滚**:只改界面,不改协议。这类页面在面板出现在屏幕上时多一次审计读取(最近 50 条)和一次用户名查询;没有面板在屏、或对象没开历史时不多读。已有自定义页的面板在「全部」里会多出带前后值的变更行。回滚即 revert 本 PR。 - **先看**:① `ui/packages/app-shell/src/views/RecordDetailView.tsx` 的 `historyConsumerOnScreen`(何时发审计读取);② `ui/packages/plugin-detail/src/recordTimelineStream.ts` 的 `mergeFieldHistoryIntoFeed`(合并与配对);③ `ui/packages/plugin-detail/src/renderers/record-chatter.tsx`(默认页上不重复合并)。 - **两分钟验证**:`cd ui && pnpm exec vitest run packages/app-shell/src/views/RecordDetailView.recordOpenWaves-13010.test.tsx`,预期 21 个用例全绿,其中「an assigned page of a trackHistory object reads the audit log while its feed panel is on screen」通过。 - **需要你做的**:无,席位落地。 ## What changes - **The read** (`RecordDetailView.tsx`): on an assigned (authored) page the `sys_audit_log` read and its `sys_user` name lookup go out exactly when the page's feed is on screen (`feedConsumerOnScreen`: a `record:discussion` / `record:chatter` / `record:activity` in the tree this view renders, judged with the `?tab=` the strip writes), latched for the view's life as before, and only on a `trackHistory` object. The synthesized page keeps its own rule unchanged. `RecordFieldChangesContext` now carries the field changes on an assigned page too; `RecordFieldHistoryContext` keeps its one rule (`historyEnabled && historyEntries !== null`), so a reader whose audit read is refused is still offered no Field Changes (#30344). - **The merge** (`recordTimelineStream.ts`): `mergeFieldHistoryIntoFeed` is the stream's pairing (#30122, shared with `mergeTimelineStream` through one `pairedStream`), oldest first as a panel reads. No field changes returns the feed array itself, so a page without history draws exactly what it drew. - **The panels**: `record:activity`'s panel face and `record:chatter` / `record:discussion` merge the field changes in; on the default record page the chatter leaves them to the stream (`useDefaultRecordPage`). `unifiedTimeline: false` un-mixes them and the panel then offers no `changes_only` (a filter over nothing). The panel face draws a paired activity row's before and after values (`RecordActivityTimeline.tsx`), as the stream's row does. - **Checklist**: `records-forms.record-discussion-mentions` knownGaps[3] re-read (revision 16): the `changes_only` leg is blocked only by the missing stock carrier now. acceptance[7] is NOT flipped to driven: no stock showcase `record:discussion` panel sits on a `trackHistory` object (`showcase_project` has none), so the fixture still does not open on stock. ## Tests Run at head `a7152744`. - New pins (`recordTimelineStream-27055.test.tsx`, a top-level describe): the pure merge (order, pairing, identity when empty); for both `record:activity` and `record:discussion`: All holds the paired diff once and the unpaired change; an authored `changes_only` opens on Field Changes and holds only the field history; CONTROL no history shown (refused / no trackHistory) offers no Field Changes and the value reads as All; `unifiedTimeline: false` shows no change and offers no Field Changes; CONTROL the discussion panel on the default page leaves the changes to the stream. - App-shell (`RecordDetailView.recordOpenWaves-13010.test.tsx`): the flipped pin and three controls (no feed panel on the open tab: no read until the tab opens; no feed panel at all: never; no `trackHistory`: never), plus an authored `record:discussion` with `filterMode: 'changes_only'` driven through the real view. - Reverse pins flipped: "an assigned page of a trackHistory object never reads the audit log" (app-shell open waves) and the title half "ignores the field changes" of the stream file's off-default-page CONTROL. "same object without it → 0 audit reads" (`recordPageTiers-26678`) is the no-trackHistory control and stays. <details><summary>Readings</summary> - `vitest run packages/plugin-detail/` (whole package): Test Files 386 passed, 1 skipped (387); Tests 3492 passed, 18 skipped (3510); VERDICT command-exit 0. - `vitest run packages/app-shell/src/views/RecordDetailView` (95 files, narrowed): Test Files 95 passed (95); Tests 723 passed (723); VERDICT command-exit 0. The rest of `@object-ui/app-shell`'s suite is declared to CI (`Test UI`). - `type-check` of `@object-ui/plugin-detail` and `@object-ui/app-shell` (both `tsc --noEmit` and `tsconfig.test.json`): VERDICT command-exit 0. - Ablation 1, the read gate (`? historyEnabled && feedConsumerOnScreen` to `? false && feedConsumerOnScreen`, landed by `ablation-replace.mjs`, blob b372cba to 858c046f, restored to HEAD's blob with `git diff HEAD` empty): open-waves file 3 failed, 18 passed; red exactly the flipped pin, the tab-opens control and the authored `changes_only` case; the three never-read controls stayed green. - Ablation 2, the panel merge in `record-activity.tsx` (`mergeFieldHistoryIntoFeed(sourceItems, fieldChanges)` to `sourceItems`, blob 299caa9 to b99f09ce, restored): stream file 3 failed, 49 passed; red exactly the `record:activity` legs; the `record:discussion` legs (a separate path) stayed green. - No build or dist step: both suites resolve `@object-ui/plugin-detail` to `src` through `ui/vitest.config.mts`. </details> ## Measurements (the ruling's two "not measured") - **Request count on an authored page** (the open-waves harness, HotCRM's tabbed opportunity page shape, a `trackHistory` object, opened on its Activity tab). Before, taken from ablation 1's wave table: 1 request in 1 wave (the page payload POST, which carries the discussion and 200 activity rows). After, asserted by the flipped pin: 3 requests in 2 waves, the payload plus `GET sys_audit_log top=50` in wave 1 and the `sys_user` name lookup in wave 2 (plus one label read per lookup object when a change touched a lookup field, as on the default page). Opened on a tab without a feed panel: no extra read until that tab opens. No feed panel on the page, or no `trackHistory`: 0 extra reads. Latency against a live server: NOT MEASURED. - **What existing authored panels show differently.** In this repo the one authored feed panel is the showcase's Project Detail `record:discussion` on `showcase_project`, which has no `trackHistory`: no visible change and no extra read. `app-crm` has no authored record page with a feed panel. hotcrm, read through GitHub code search (no checkout in this container): `record:activity` / `record:chatter` / `record:discussion` appear only in `src/sales/pages/home.page.ts` and `test/metadata-references.test.ts`, so no authored record page there places a feed panel: no change found. On a page that does (a `trackHistory` object), All gains the audit rows with before and after values, an update that wrote both an activity row and an audit entry is one row with its diff, an `updated` activity row with no audit entry steps aside (the stream's rule), and the filter gains Field Changes. ## Acceptance notes - `check:platform-checklist` (run locally because the derived list names it; it is off per-PR CI) reports one problem on an item this diff does not touch: `platform-core.seed-mode-matrix` VARIANTS STALE ("SeedMode ... now has 0 members ... authored against 5"). It follows the seed-mode retirement already on main; records-forms reports clean. - A page whose only on-screen feed block is authored `unifiedTimeline: false` still pays the read while it shows nothing from it; the gate judges node types, not props. Noted, not filed. - The 50-entry audit window is the default page's: an `updated` activity row older than the newest 50 audit entries steps aside on an authored panel as it does on the stream. ## Verification - `node scripts/pm/dispatch-gates.mjs --commands` (diff-narrowed): 46 families derived, 46 run locally; 45 exit 0, `pnpm check:platform-checklist` exit 1 on the unrelated item above. `--ran` reconciliation: 46 run, 0 unrun. - `node scripts/pm/overlap-check.mjs` before each push: VERDICT clean exit 0 (last against origin/main dc53d4a, after merging main with #35288 in). - Full dogfood not owed: no `!` in the title and no `(narrowing)` arm. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01Utp6CZrgaiMgTJCnswR6jQ --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 22af9e6 commit ee5fdc8

9 files changed

Lines changed: 272 additions & 41 deletions

File tree

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
'@object-ui/app-shell': patch
3+
'@object-ui/plugin-detail': patch
4+
---
5+
6+
fix(record-page): an authored record page's feed panels show the record's field history, and offer Field Changes
7+
8+
Clause-②: no
9+
Metadata-protocol: none
10+
11+
On an authored (assigned) record page, a `record:discussion`, `record:chatter` or `record:activity` panel never showed who changed which field from what to what, never offered the Field Changes filter, and an authored `filterMode: 'changes_only'` silently opened on All Activity. The record page read the audit log only for the page it synthesizes.
12+
13+
Now, on an object with `enable.trackHistory`, the record page reads the record's field history (the newest 50 audit entries, plus one user-name lookup) while one of those panels is on screen, at open or when its tab opens; a page with no such panel on screen, or an object without `trackHistory`, reads nothing more. The panel merges the field changes into its feed the way the default page's activity stream does: an update that wrote both an activity row and an audit entry is one row, now showing its before and after values; a change with no activity row is its own row; and an `updated` activity row with no audit entry steps aside, as on the stream. Field Changes is offered, and an authored `changes_only` holds those changes, exactly when the reader's audit read answered: a reader the server refuses the audit log to is offered no Field Changes, as before. A panel authored with `unifiedTimeline: false` shows no field changes and offers no Field Changes.
14+
15+
Visible change on existing authored pages: on a `trackHistory` object, a feed panel's All Activity now includes the field changes with their before and after values, and its filter gains Field Changes. The default record page is unchanged. `@object-ui/plugin-detail` adds `mergeFieldHistoryIntoFeed` to its `recordTimelineStream` module (not re-exported from the package entry); no locale keys, props or entry exports change.

‎docs/qa/platform-checklist/areas/records-forms.json‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3255,7 +3255,7 @@
32553255
"title": "Record discussion: an @mention comment reconciles optimistically, persists to sys_comment, interleaves with activity, pings the mentioned user's bell — and the feed filter shows exactly each mode's subset without dropping author-extended activity",
32563256
"since": "v16",
32573257
"status": "active",
3258-
"revision": 15,
3258+
"revision": 16,
32593259
"priority": "P1",
32603260
"surface": "browser",
32613261
"personas": [
@@ -3277,7 +3277,7 @@
32773277
"the @mention TARGET and the bell/notification clauses need a SECOND user. A stock showcase boot is invite_only, so POST /api/v1/auth/sign-up/email answers 403 SELF_REGISTRATION_CLOSED: the admin mints the user with POST /api/v1/auth/admin/create-user, which answers mustChangePassword true, and the user calls POST /api/v1/auth/change-password and signs in again before it drives anything (steps[13]; RUNNER.md, 'A stock showcase boot refuses self-registration'). ⛔ Do not record those clauses blocked(fixture) on the 403: the refusal is the posture working, and the admin door mints the user on the same boot. The optimistic-reconcile, sys_comment and activity-interleave clauses need only the author",
32783278
"CLOSED by the qa-feeds-disabled recipe (#12118) for the two FEEDS_DISABLED clauses: before it, no showcase object declared enable.feeds:false and there was no scratch recipe for this area, so the code appeared only in `negative`. Fall back to the pinned engine/API suites named in `automated` ONLY if the recipe cannot be replayed on the boot under test — and when you do, record WHICH of the two the verdict rests on, because the pins run against their own fixtures (cmt_nofeeds / lead_walled) and not against the showcase surface this item otherwise drives.",
32793279
"acceptance[9]'s cross-organization leg runs live on its own group-posture boot (fixtures.requires[2]) through steps[13]'s walled sequence, which #26625 wrote and drove once at main 1708115e2f: the control mention in organization B notified the user, and both mentions on organization A's account (by id, by email) were withheld cannot_read_source. A run that cannot boot the posture records that leg blocked(fixture) citing RUNNER.md's walled entry. Its pin (automated.ref, packages/plugins/plugin-audit/src/mention-recipient-gate.integration.test.ts) reaches the ENGINE layer, not HTTP: a real kernel, ObjectQL engine and SQLite driver with AuditPlugin and the real core grant resolver, while plugin-security's read layer is played by one middleware composing the posture's tenant clause and an owner-only rule, and messaging is played by an emit() recorder. Under RUNNER rule 6 the pin scores the clause partial at most, naming the HTTP layer and the real plugin-security as missing; both live legs, the stock `single` one and the walled one, are driven live",
3280-
"acceptance[7]'s changes_only leg has no stock carrier: the panel offers that mode only on an object with field history (ui/packages/plugin-detail/src/RecordActivityTimeline.tsx getFilterOptions), and the stock showcase's only authored record:discussion panel sits on showcase_project (examples/app-showcase/src/ui/pages/project-detail.page.ts), which has none (QA run #33048, comment 6846028996). A fixture that put the panel on such an object would not offer it either: the panel offers changes_only from RecordFieldHistoryContext, which RecordDetailView fills from its sys_audit_log read, and that read goes out only for the page it synthesizes, never for an assigned page (ui/packages/app-shell/src/views/RecordDetailView.tsx, historyPage), while a record:discussion panel always sits on an authored, assigned page (QA run #33861). So the leg is blocked(fixture) on every stock or scratch page; the synthesized page's stream offers its own Changes chip, a different control that scores nothing here"
3280+
"acceptance[7]'s changes_only leg has no stock carrier: the panel offers that mode only on an object with field history (ui/packages/plugin-detail/src/RecordActivityTimeline.tsx getFilterOptions), and the stock showcase's only authored record:discussion panel sits on showcase_project (examples/app-showcase/src/ui/pages/project-detail.page.ts), which has none (QA run #33048, comment 6846028996). Since objectstack#33996 a fixture that puts the panel on an object with enable.trackHistory opens the leg: an assigned page reads the record's sys_audit_log while a feed panel is on screen (ui/packages/app-shell/src/views/RecordDetailView.tsx, historyConsumerOnScreen), fills RecordFieldHistoryContext from that read and hands the field changes to the panel (RecordFieldChangesContext, mergeFieldHistoryIntoFeed in ui/packages/plugin-detail/src/recordTimelineStream.ts), so changes_only is offered to a reader whose audit read answers. No stock showcase page carries such a panel, so on stock the leg stays blocked(fixture); the synthesized page's stream offers its own Changes chip, a different control that scores nothing here"
32813281
]
32823282
},
32833283
"steps": [
@@ -3489,6 +3489,12 @@
34893489
"date": "2026-11-15",
34903490
"change": "fixtures.requires[1], steps[0] and steps[5] steer off showcase_task, whose authored Task Detail page has no discussion surface and no stream (QA run #33861, ledger row 148): the record is a showcase_project (panel) or a showcase_account (stream), and the interleave is read on the panel or on showcase_field_zoo's stream. steps[13] creates the private note with its required title. knownGaps[3] says the changes_only mode is offered only where the page is synthesized, which an authored record:discussion panel never is (RecordDetailView historyPage; row 149). No clause changed. Ledger 6896511848 of the v18.5.0 sweep anchor #33761, carried by batch-A card #33963; read at base 895783a1.",
34913491
"ref": "#33990"
3492+
},
3493+
{
3494+
"revision": 16,
3495+
"date": "2026-11-19",
3496+
"change": "knownGaps[3] re-read: an assigned page now reads the record's field history while a feed panel is on screen and hands it to record:discussion / record:chatter / record:activity, so the changes_only leg is blocked only by the missing stock carrier (no showcase record:discussion panel sits on an object with enable.trackHistory), no longer by the platform. No clause changed; acceptance[7] still scores the modes offered. Read at base 01889892.",
3497+
"ref": "#33996"
34923498
}
34933499
]
34943500
},

‎ui/packages/app-shell/src/views/RecordDetailView.recordOpenWaves-13010.test.tsx‎

Lines changed: 52 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -796,16 +796,63 @@ describe('the 动态 stream reads the audit log when it is shown (objectui#13010
796796
expect(screen.getByText(/negotiation/)).toBeTruthy();
797797
});
798798

799-
// Only the synthesized page hands the view's audit rows to a block; an
800-
// assigned page's `record:history` reads its own source. So an assigned page
801-
// never shows what this read fetches.
802-
it('an assigned page of a trackHistory object never reads the audit log', async () => {
799+
// objectstack#33996 flipped this pin. It read "an assigned page of a
800+
// trackHistory object never reads the audit log": only the synthesized page
801+
// handed the audit rows to a block, so an authored feed panel's
802+
// `changes_only` held nothing and an authored `filterMode: 'changes_only'`
803+
// read as All. Now an assigned page's feed blocks draw the field changes,
804+
// so the read goes out while one is on screen, as the stream's does.
805+
it('an assigned page of a trackHistory object reads the audit log while its feed panel is on screen, and the panel shows the change', async () => {
803806
const { held } = await openHistory({ page: ACTIVITY_PAGE, search: '?tab=activity' });
804807
const table = waveTable(held);
805-
// Its activity comes with the page (objectstack#28470); the audit log is never read.
808+
// Its activity comes with the page (objectstack#28470).
806809
expect(pageStreams(held).activity, table).toBe(200);
807810
expect(held.filter(isActivityRead), table).toEqual([]);
811+
expect(held.filter(isAuditRead).map((h) => h.wave), table).toEqual([1]);
812+
expect(topOf(held.filter(isAuditRead)[0]), table).toBe(50);
813+
expect(held.filter(isAuditUserLookup).map((h) => h.wave), table).toEqual([2]);
814+
expect(screen.getByText('Grace')).toBeTruthy();
815+
expect(screen.getByText(/negotiation/)).toBeTruthy();
816+
});
817+
818+
it('CONTROL: the same page opened on a tab with no feed panel reads no audit log until the panel opens', async () => {
819+
const { held, state } = await openHistory({ page: ACTIVITY_PAGE });
820+
expect(held.filter(isAuditRead), waveTable(held)).toEqual([]);
821+
const openedWith = held.length;
822+
await openTab('Activity');
823+
await runWaves(held, state);
824+
const table = waveTable(held);
825+
const reads = held.filter(isAuditRead);
826+
expect(reads, table).toHaveLength(1);
827+
expect(reads[0].seq, table).toBeGreaterThanOrEqual(openedWith);
828+
expect(screen.getByText(/negotiation/)).toBeTruthy();
829+
});
830+
831+
it('CONTROL: an assigned page with no feed panel at all never reads the audit log', async () => {
832+
const { held } = await openHistory({ page: RECORD_PAGE, search: '?tab=related' });
833+
const table = waveTable(held);
808834
expect(held.filter(isAuditRead), table).toEqual([]);
809835
expect(held.filter(isAuditUserLookup), table).toEqual([]);
810836
});
837+
838+
it('CONTROL: the feed panel on screen over an object without trackHistory reads no audit log', async () => {
839+
const { held } = await openHistory({ page: ACTIVITY_PAGE, search: '?tab=activity', object: objectDef });
840+
const table = waveTable(held);
841+
expect(pageStreams(held).activity, table).toBe(200);
842+
expect(held.filter(isAuditRead), table).toEqual([]);
843+
});
844+
845+
it('an authored record:discussion with `filterMode: changes_only` opens on Field Changes and holds the change only', async () => {
846+
const DISCUSSION_TAB = {
847+
value: 'discussion',
848+
label: 'Discussion',
849+
children: [{ type: 'record:discussion', id: 'deal_discussion', properties: { feed: { filterMode: 'changes_only' } } }],
850+
};
851+
const { held } = await openHistory({ page: tabsPage([DETAILS_TAB, DISCUSSION_TAB]), search: '?tab=discussion' });
852+
const table = waveTable(held);
853+
expect(held.filter(isAuditRead), table).toHaveLength(1);
854+
expect(screen.getByRole('combobox').textContent, table).toContain('Field Changes');
855+
expect(screen.getByText(/negotiation/)).toBeTruthy();
856+
expect(screen.queryByText('Ping the buyer on Friday'), table).toBeNull();
857+
});
811858
});

‎ui/packages/app-shell/src/views/RecordDetailView.tsx‎

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,8 @@ const FEED_CONSUMER_TYPES: ReadonlySet<string> = new Set([
309309
* objectui#13010 part 5 — the block that draws this view's `sys_audit_log`
310310
* read: on the synthesized page, the timeline stream (objectstack#27055), a
311311
* `record:activity` the field changes reach through `RecordFieldChangesContext`.
312+
* On an assigned page every feed block draws it (`FEED_CONSUMER_TYPES`,
313+
* objectstack#33996).
312314
*/
313315
const HISTORY_CONSUMER_TYPES: ReadonlySet<string> = new Set(['record:activity']);
314316
/** Where a page tree nests nodes: the keys `pageSchemaIntrospect` walks. */
@@ -2889,26 +2891,32 @@ export function RecordDetailView({ dataSource, objects, onEdit, objectNameOverri
28892891
return () => observer.disconnect();
28902892
}, [attachmentsFallbackEl, attachmentsFallbackShown]);
28912893

2892-
// ── The audit read waits for the timeline (objectui#13010 part 5) ───────
2894+
// ── The audit read waits for the blocks that draw it (objectui#13010 part 5) ──
28932895
//
28942896
// The `sys_audit_log` read below, and the `sys_user` name lookup behind it,
2895-
// fill only the field changes of the timeline stream the synthesized page
2896-
// composes (objectstack#27055: one stream, no History tab); an assigned page
2897-
// is rendered as authored, and its `record:history` reads its own source.
2898-
// So, like the feed above, the read goes out when the stream is on screen,
2899-
// judged by `pageShowsNodeOnOpen` on the page this view synthesizes: at open
2900-
// when the page opens on it (a laid-out page, or `?tab=timeline`), else on
2901-
// the tab switch that mounts it. Latched for the view's life for the feed's
2902-
// reason.
2897+
// fill only the record's field changes. On the synthesized page they are the
2898+
// timeline stream's (objectstack#27055: one stream, no History tab); on an
2899+
// assigned page they join its authored feed blocks, `record:discussion`,
2900+
// `record:chatter` and `record:activity` (objectstack#33996), so an authored
2901+
// `filterMode: 'changes_only'` has something to hold. So, like the feed
2902+
// above, the read goes out when such a block is on screen: on the
2903+
// synthesized page judged by `pageShowsNodeOnOpen` on the page this view
2904+
// synthesizes (a laid-out page, or `?tab=timeline`), on an assigned page
2905+
// exactly when its feed is (`feedConsumerOnScreen`, the tree this view
2906+
// renders and its `?tab=`); else on the tab switch that mounts it. Latched
2907+
// for the view's life for the feed's reason. A page with no such block on
2908+
// screen, or an object without `trackHistory`, reads nothing.
29032909
const historyPage = historyEnabled && !assignedPage && !namedPageBlocked && objectDef ? synthesizedPage : null;
29042910
// On a laid-out page the stream is the 动态 panel, so its read goes out at
29052911
// open (objectstack#26678, objectstack#27524).
29062912
const historyConsumerOnScreen = useMemo(
29072913
() =>
2908-
historyPage != null
2909-
&& ((pageLaidOut && buildDefaultPageColumns(historyPage) !== null)
2910-
|| pageShowsNodeOnOpen(historyPage, HISTORY_CONSUMER_TYPES, activeTabParam)),
2911-
[historyPage, activeTabParam, pageLaidOut],
2914+
assignedPage
2915+
? historyEnabled && feedConsumerOnScreen
2916+
: historyPage != null
2917+
&& ((pageLaidOut && buildDefaultPageColumns(historyPage) !== null)
2918+
|| pageShowsNodeOnOpen(historyPage, HISTORY_CONSUMER_TYPES, activeTabParam)),
2919+
[assignedPage, historyEnabled, feedConsumerOnScreen, historyPage, activeTabParam, pageLaidOut],
29122920
);
29132921
const [historyConsumerShown, setHistoryConsumerShown] = useState(false);
29142922
if (historyConsumerOnScreen && !historyConsumerShown) setHistoryConsumerShown(true);
@@ -4358,9 +4366,9 @@ export function RecordDetailView({ dataSource, objects, onEdit, objectNameOverri
43584366
// refused ledger read as no field change (objectstack#28737).
43594367
const fieldHistoryShown = historyEnabled && historyEntries !== null;
43604368
// objectstack#27055, Target 3 — the record's field changes, as feed items of
4361-
// the timeline stream. `null` while there are none to give (no
4362-
// `trackHistory`, an authored page, the read not made, not landed or not
4363-
// answered).
4369+
// the timeline stream, or of an authored page's feed blocks
4370+
// (objectstack#33996). `null` while there are none to give (no
4371+
// `trackHistory`, the read not made, not landed or not answered).
43644372
const timelineFieldChanges = useMemo(
43654373
() =>
43664374
historyEnabled && historyEntries
@@ -5394,8 +5402,9 @@ export function RecordDetailView({ dataSource, objects, onEdit, objectNameOverri
53945402
onMentionSuggestionsWanted={wantMentionSuggestions}
53955403
>
53965404
{/* objectstack#27055 — the field changes of the timeline stream,
5397-
for the synthesized page's `record:activity`. */}
5398-
<RecordFieldChangesContext.Provider value={assignedPage ? null : timelineFieldChanges}>
5405+
for the synthesized page's `record:activity`; on an assigned page,
5406+
for its feed blocks (objectstack#33996). */}
5407+
<RecordFieldChangesContext.Provider value={timelineFieldChanges}>
53995408
{/* objectstack#30074 — whether this record shows its field history
54005409
(objectstack#30344: to this reader, whose audit read answered):
54015410
the stream offers its 变更 chip only while it does. */}

‎ui/packages/plugin-detail/src/RecordActivityTimeline.tsx‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -710,6 +710,7 @@ export const RecordActivityTimeline: React.FC<RecordActivityTimelineProps> = ({
710710
enableReactions && onToggleReaction && canStoreReaction(item)
711711
? (emoji: string) => onToggleReaction(item.id, emoji)
712712
: undefined;
713+
const changeLines = fieldHistoryOf(item)?.fieldChanges ?? (item.type === 'field_change' ? item.fieldChanges : undefined);
713714

714715
return (
715716
<div key={item.id}>
@@ -781,10 +782,12 @@ export const RecordActivityTimeline: React.FC<RecordActivityTimelineProps> = ({
781782
</a>
782783
)}
783784

784-
{/* Field changes */}
785-
{item.type === 'field_change' && item.fieldChanges && (
785+
{/* Field changes. An activity row paired with its audit entry
786+
(objectstack#30122) shows that entry's before and after values,
787+
as the stream's row does (objectstack#33996). */}
788+
{changeLines && (
786789
<div className="space-y-1 mt-1">
787-
{item.fieldChanges.map((change, idx) => (
790+
{changeLines.map((change, idx) => (
788791
<FieldChangeItem key={idx} change={change} />
789792
))}
790793
</div>

0 commit comments

Comments
 (0)