Repository navigation
Commit ee5fdc8
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
- .changeset
- docs/qa/platform-checklist/areas
- ui/packages
- app-shell/src/views
- plugin-detail/src
- __tests__
- renderers
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3255 | 3255 | | |
3256 | 3256 | | |
3257 | 3257 | | |
3258 | | - | |
| 3258 | + | |
3259 | 3259 | | |
3260 | 3260 | | |
3261 | 3261 | | |
| |||
3277 | 3277 | | |
3278 | 3278 | | |
3279 | 3279 | | |
3280 | | - | |
| 3280 | + | |
3281 | 3281 | | |
3282 | 3282 | | |
3283 | 3283 | | |
| |||
3489 | 3489 | | |
3490 | 3490 | | |
3491 | 3491 | | |
| 3492 | + | |
| 3493 | + | |
| 3494 | + | |
| 3495 | + | |
| 3496 | + | |
| 3497 | + | |
3492 | 3498 | | |
3493 | 3499 | | |
3494 | 3500 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
796 | 796 | | |
797 | 797 | | |
798 | 798 | | |
799 | | - | |
800 | | - | |
801 | | - | |
802 | | - | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
803 | 806 | | |
804 | 807 | | |
805 | | - | |
| 808 | + | |
806 | 809 | | |
807 | 810 | | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
808 | 834 | | |
809 | 835 | | |
810 | 836 | | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
811 | 858 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
309 | 309 | | |
310 | 310 | | |
311 | 311 | | |
| 312 | + | |
| 313 | + | |
312 | 314 | | |
313 | 315 | | |
314 | 316 | | |
| |||
2889 | 2891 | | |
2890 | 2892 | | |
2891 | 2893 | | |
2892 | | - | |
| 2894 | + | |
2893 | 2895 | | |
2894 | 2896 | | |
2895 | | - | |
2896 | | - | |
2897 | | - | |
2898 | | - | |
2899 | | - | |
2900 | | - | |
2901 | | - | |
2902 | | - | |
| 2897 | + | |
| 2898 | + | |
| 2899 | + | |
| 2900 | + | |
| 2901 | + | |
| 2902 | + | |
| 2903 | + | |
| 2904 | + | |
| 2905 | + | |
| 2906 | + | |
| 2907 | + | |
| 2908 | + | |
2903 | 2909 | | |
2904 | 2910 | | |
2905 | 2911 | | |
2906 | 2912 | | |
2907 | 2913 | | |
2908 | | - | |
2909 | | - | |
2910 | | - | |
2911 | | - | |
| 2914 | + | |
| 2915 | + | |
| 2916 | + | |
| 2917 | + | |
| 2918 | + | |
| 2919 | + | |
2912 | 2920 | | |
2913 | 2921 | | |
2914 | 2922 | | |
| |||
4358 | 4366 | | |
4359 | 4367 | | |
4360 | 4368 | | |
4361 | | - | |
4362 | | - | |
4363 | | - | |
| 4369 | + | |
| 4370 | + | |
| 4371 | + | |
4364 | 4372 | | |
4365 | 4373 | | |
4366 | 4374 | | |
| |||
5394 | 5402 | | |
5395 | 5403 | | |
5396 | 5404 | | |
5397 | | - | |
5398 | | - | |
| 5405 | + | |
| 5406 | + | |
| 5407 | + | |
5399 | 5408 | | |
5400 | 5409 | | |
5401 | 5410 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
710 | 710 | | |
711 | 711 | | |
712 | 712 | | |
| 713 | + | |
713 | 714 | | |
714 | 715 | | |
715 | 716 | | |
| |||
781 | 782 | | |
782 | 783 | | |
783 | 784 | | |
784 | | - | |
785 | | - | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
786 | 789 | | |
787 | | - | |
| 790 | + | |
788 | 791 | | |
789 | 792 | | |
790 | 793 | | |
| |||
0 commit comments