Skip to content

Commit 0b76a1f

Browse files
feat(plugin-detail): the record activity timeline folds consecutive updates by one actor into one row with a count (#26055)
<!-- claude-projects-attribution: {"github_login":"os-steve"} --> _Requested by **Steve** · [project thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9WTWRsnC3MHwk95XYn23xHC)_ Fixes #25959 Clause-②: yes Metadata-protocol: none ## What The record activity timeline folds a run of consecutive update entries by one actor into one row with a count. This is the renderer half of #25787 (its server half, PR #25958, made each generic update summary name its changed fields). - **Mapper** (`ui/packages/plugin-detail/src/renderers/recordActivityFeed.ts`). `activityRowToFeedItem` now carries what it used to drop: the row's own `sys_activity.type` (`activityType`), its `metadata.kind` (`activityKind`), `actor_id` (`actorId`, `null` when the row names no user) and `changed_fields` (`changedFields`, only when the column is an array, so an unstamped `null` row is not read as "no fields"). Only `metadata.kind` is read from the metadata JSON; the recorded old/new values are never looked at. - **Fold** (`foldFeedItems`, same module, pure). A run is adjacent items of the list the reader sees (after the filter): each an `updated` row with no domain kind, by the same `actorId` AND the same display name (so two unnamed writers are never merged), each at most `FOLD_WINDOW_MS` = 10 minutes after its neighbour. Any other row ends the run. A run of one is an ordinary row. - **Render** (`RecordActivityTimeline.tsx`). The folded row shows the actor, the latest entry's time, `N updates`, and `Updated FIELDS`: the union of the changed fields, by the object's field label (from `RecordContextProvider`'s `objectSchema`, through the same translated `fieldLabel` the record sections use) and by machine name outside a record page; three names, then `N more`. A button with `aria-expanded` expands the run to its entries, each rendered exactly as an unfolded row. The panel heading still counts every entry. - **Types** (`@object-ui/types`). Four new optional `FeedItem` members (Clause-② yes). A host item without them renders as before and never folds. - **Strings.** `detail.foldedUpdates`, `detail.foldedUpdateCount` (count family), `detail.foldedMoreFields` (count family), `detail.expandFolded`, `detail.collapseFolded`, appended after `detail.viewSource` in all ten packs and mirrored in `DETAIL_DEFAULT_TRANSLATIONS`. The field list is joined with the existing `validation.formInvalidJoiner` key, not `Intl.ListFormat` (outside the package's TS lib, and measured and rejected for field lists in `form-invalid-toast-joiner.test.tsx`). - `scripts/sdui-manifest.record.json` re-recorded; root changeset `.changeset/25959-activity-fold.md` (patch, `@object-ui/types`, `@object-ui/plugin-detail`, `@object-ui/i18n`). No host plumbing: `RecordDetailView` already renders the discussion inside `RecordContextProvider` with `objectSchema={objectDef}`, so `RecordDetailView.tsx` is untouched. ## Choices for the seat - **Window: 10 minutes between neighbours**, not from the first entry, so one flow writing every few minutes stays one run. - **Adjacency after the filter.** With "Field changes" selected, two updates separated by a (hidden) comment are adjacent on screen and fold. In "All activity" the comment ends the run. - **Never fold:** everything whose `activityType` is not `updated` (created, deleted, assigned, shared, completed, comments, host items) and any row with a `metadata.kind` (a fired milestone). ## Tests Head `1c8752a0` (after merging `origin/main`): - `RecordActivityTimeline.fold-25959.test.tsx` (new, 17 tests): the mapper carries the four members; `foldFeedItems` folds a run in order, splits on actor / system-vs-person / differing unnamed writers / a gap over the window, never folds the excluded kinds, counts entries without a summary; the timeline renders the thirteen-update campaign as one row with `13 updates` and the field labels, keeps the comment visible, toggles `aria-expanded` and shows all 13 entries, falls back to machine names, truncates long lists, and reads a no-field run as `Updated record`. - Updated `recordActivityFeed.test.ts` (two exact item shapes gain `activityType` / `actorId`) and `recordActivityFeed.milestoneKind-12106.test.tsx` (the marked item also carries `activityKind`). - Reverse check: with the fold's `updated` test mutated to never match, the new file goes 9 failed / 8 passed of 17; restored by `git checkout HEAD --`, hash-verified. - Final run on `1c8752a0`, under `os-verify-lock.sh`: `vitest run packages/plugin-detail/ packages/i18n/` plus the app-shell activity and defaults-mirror tests (`RecordDetailView.activity*`, `.feed*`, `.replyCountOnRead`, `.recordOpenWaves`, `.authoredActivityThreading`, `.discussionFallbackPipeline`, `defaults-maps-mirror-en-pack`, `activityItemType`): **Test Files 403 passed, 1 skipped (404); Tests 4327 passed, 31 skipped**. The rest of app-shell is left to CI `Test Core`. - `pnpm --filter @object-ui/types --filter @object-ui/plugin-detail --filter @object-ui/i18n run type-check`: exit 0. eslint on the touched files: 0 errors. - Gates: `dispatch-gates --commands` derived 46 commands on `1c8752a0`; all 46 exit 0, and `--ran` reconciles 46 derived / 46 run / 0 NOT-MEASURED (a derived zero). `check-sdui-manifest` included. ## Acceptance notes - A milestone row that the read redaction served without its `kind` (the reader is not served a field the milestone watches) and whose declaration names no `type` arrives as a plain `updated` row and can fold. That is the redaction's documented behaviour, not a new gap. - Folding happens after `applyFeedConfig`'s page window, so a page of `limit` entries can render as fewer rows. The window still counts entries, which is what "Load more" pages over. - The fold's expand state is keyed on the run's first entry id; "Load more" bringing an older entry into the same run collapses it again. --- _Generated by [Claude Code](https://claude.ai/code/session_01PoTpJPgXim1ybDgRyat4BY)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent fc70ab3 commit 0b76a1f

21 files changed

Lines changed: 856 additions & 157 deletions

‎.changeset/25959-activity-fold.md‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
'@object-ui/types': patch
3+
'@object-ui/plugin-detail': patch
4+
'@object-ui/i18n': patch
5+
---
6+
7+
feat(plugin-detail): the record activity timeline folds consecutive updates by one actor into one row with a count
8+
9+
Clause-②: yes
10+
Metadata-protocol: none
11+
12+
- **Before.** Every `sys_activity` update was its own feed row. When a flow, a rollup or a seed updated a record repeatedly, the system's rows buried the people's comments: a demo campaign showed thirteen consecutive "System · Updated Campaign …" rows in its discussion feed.
13+
- **Now.** `RecordActivityTimeline` folds a run of adjacent `updated` entries by the same actor (`actor_id`, `null` for the system, and the same display name), each no more than 10 minutes after the one before it, into one row. The row shows the actor, the time of the latest entry, the entry count and the union of the changed fields, by their field labels where the page has the object schema and by machine name otherwise (`Updated Number Sent, Leads, Responses · 13 updates`). A toggle (`aria-expanded`) expands it to every entry.
14+
- **Rendering only.** No entry is dropped or merged in the data, and the panel heading still counts every entry. Create, delete, assign, share, comment, completed and milestone rows never fold, and any of them between two updates ends the run. An entry without a summary still folds and still counts. Field names come from `sys_activity.changed_fields`, never from the recorded values.
15+
- **`FeedItem` (`@object-ui/types`).** Four new optional members, set by `activityRowToFeedItem`: `activityType` (the row's own `sys_activity.type`), `activityKind` (`metadata.kind`, e.g. `'milestone'`), `actorId` and `changedFields`. A host item without them renders as before and never folds.
16+
- **Strings.** `detail.foldedUpdates`, `detail.foldedUpdateCount`, `detail.foldedMoreFields`, `detail.expandFolded` and `detail.collapseFolded`, in all ten packs.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"package":"ui/packages/i18n","sources":31,"sha256":"4bcb36ff124e98b8405929277c2acd9afdeb73347b814df67cf26a80727996af","manifestSha256":"1f6e1ccb925a678eaa393f9091dfc7d0285e4e3626e0a5c61a5474687debabb7"}
1+
{"package":"ui/packages/i18n","sources":31,"sha256":"a5459185e0836b6ae5f87ff81d0e75d2be96455c5f18661c47c12c8f49d81871","manifestSha256":"1f6e1ccb925a678eaa393f9091dfc7d0285e4e3626e0a5c61a5474687debabb7"}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"package":"ui/packages/plugin-detail","sources":54,"sha256":"e22491dc392ede00c47cdea1d193d7c03c9c01751e65ee851adb17f2038b7ad2","manifestSha256":"1f6e1ccb925a678eaa393f9091dfc7d0285e4e3626e0a5c61a5474687debabb7"}
1+
{"package":"ui/packages/plugin-detail","sources":54,"sha256":"3a6fffd41940e71d2402028d44c078cf9cdb7e9428120b180af072491ecfa2a9","manifestSha256":"1f6e1ccb925a678eaa393f9091dfc7d0285e4e3626e0a5c61a5474687debabb7"}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"package":"ui/packages/types","sources":81,"sha256":"d7928a68db8d76df5f05933d139f9d3d46e2fd87f74945f69c74e079f1a8eda2","manifestSha256":"1f6e1ccb925a678eaa393f9091dfc7d0285e4e3626e0a5c61a5474687debabb7"}
1+
{"package":"ui/packages/types","sources":81,"sha256":"0373b9f45d8be39821641918e2e8058b8016ad24232b39111193116732fdf00f","manifestSha256":"1f6e1ccb925a678eaa393f9091dfc7d0285e4e3626e0a5c61a5474687debabb7"}

‎ui/packages/i18n/src/locales/ar.ts‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1343,6 +1343,24 @@ const ar = {
13431343
edited: "(معدل)",
13441344
via: "عبر {{source}}",
13451345
viewSource: "عرض المصدر",
1346+
// objectstack#25959 — a run of consecutive updates folded into one feed row.
1347+
foldedUpdates: "تم تحديث {{fields}}",
1348+
foldedUpdateCount: "{{count}} تحديث",
1349+
foldedUpdateCount_zero: "{{count}} تحديث",
1350+
foldedUpdateCount_one: "{{count}} تحديث",
1351+
foldedUpdateCount_two: "تحديثان ({{count}})",
1352+
foldedUpdateCount_few: "{{count}} تحديثات",
1353+
foldedUpdateCount_many: "{{count}} تحديثًا",
1354+
foldedUpdateCount_other: "{{count}} تحديث",
1355+
foldedMoreFields: "{{count}} أخرى",
1356+
foldedMoreFields_zero: "{{count}} أخرى",
1357+
foldedMoreFields_one: "{{count}} أخرى",
1358+
foldedMoreFields_two: "{{count}} أخريان",
1359+
foldedMoreFields_few: "{{count}} أخرى",
1360+
foldedMoreFields_many: "{{count}} أخرى",
1361+
foldedMoreFields_other: "{{count}} أخرى",
1362+
expandFolded: "عرض كل تحديث",
1363+
collapseFolded: "إخفاء التحديثات",
13461364
replyCount: "{{count}} رد",
13471365
replyCount_zero: "{{count}} رد",
13481366
replyCount_one: "{{count}} رد",

‎ui/packages/i18n/src/locales/de.ts‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1205,6 +1205,16 @@ const de = {
12051205
edited: "(bearbeitet)",
12061206
via: "über {{source}}",
12071207
viewSource: "Quelle anzeigen",
1208+
// objectstack#25959 — a run of consecutive updates folded into one feed row.
1209+
foldedUpdates: "{{fields}} aktualisiert",
1210+
foldedUpdateCount: "{{count}} Aktualisierung",
1211+
foldedUpdateCount_one: "{{count}} Aktualisierung",
1212+
foldedUpdateCount_other: "{{count}} Aktualisierungen",
1213+
foldedMoreFields: "{{count}} weiteres",
1214+
foldedMoreFields_one: "{{count}} weiteres",
1215+
foldedMoreFields_other: "{{count}} weitere",
1216+
expandFolded: "Jede Aktualisierung anzeigen",
1217+
collapseFolded: "Aktualisierungen ausblenden",
12081218
replyCount: "{{count}} Antwort",
12091219
replyCount_one: "{{count}} Antwort",
12101220
replyCount_other: "{{count}} Antworten",

‎ui/packages/i18n/src/locales/en.ts‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1581,6 +1581,16 @@ const en = {
15811581
edited: '(edited)',
15821582
via: 'via {{source}}',
15831583
viewSource: 'View source',
1584+
// objectstack#25959 — a run of consecutive updates folded into one feed row.
1585+
foldedUpdates: 'Updated {{fields}}',
1586+
foldedUpdateCount: '{{count}} updates',
1587+
foldedUpdateCount_one: '{{count}} update',
1588+
foldedUpdateCount_other: '{{count}} updates',
1589+
foldedMoreFields: '{{count}} more',
1590+
foldedMoreFields_one: '{{count}} more',
1591+
foldedMoreFields_other: '{{count}} more',
1592+
expandFolded: 'Show each update',
1593+
collapseFolded: 'Hide updates',
15841594
// Replies
15851595
replyCount: '{{count}} reply',
15861596
replyCount_one: '{{count}} reply',

‎ui/packages/i18n/src/locales/es.ts‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1241,6 +1241,18 @@ const es = {
12411241
edited: "(editado)",
12421242
via: "vía {{source}}",
12431243
viewSource: "Ver origen",
1244+
// objectstack#25959 — a run of consecutive updates folded into one feed row.
1245+
foldedUpdates: "Actualizó {{fields}}",
1246+
foldedUpdateCount: "{{count}} actualización",
1247+
foldedUpdateCount_one: "{{count}} actualización",
1248+
foldedUpdateCount_many: "{{count}} de actualizaciones",
1249+
foldedUpdateCount_other: "{{count}} actualizaciones",
1250+
foldedMoreFields: "{{count}} más",
1251+
foldedMoreFields_one: "{{count}} más",
1252+
foldedMoreFields_many: "{{count}} más",
1253+
foldedMoreFields_other: "{{count}} más",
1254+
expandFolded: "Mostrar cada actualización",
1255+
collapseFolded: "Ocultar actualizaciones",
12441256
replyCount: "{{count}} respuesta",
12451257
replyCount_one: "{{count}} respuesta",
12461258
replyCount_many: "{{count}} de respuestas",

‎ui/packages/i18n/src/locales/fr.ts‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,6 +1238,18 @@ const fr = {
12381238
edited: "(modifié)",
12391239
via: "via {{source}}",
12401240
viewSource: "Voir la source",
1241+
// objectstack#25959 — a run of consecutive updates folded into one feed row.
1242+
foldedUpdates: "A mis à jour {{fields}}",
1243+
foldedUpdateCount: "{{count}} mise à jour",
1244+
foldedUpdateCount_one: "{{count}} mise à jour",
1245+
foldedUpdateCount_many: "{{count}} de mises à jour",
1246+
foldedUpdateCount_other: "{{count}} mises à jour",
1247+
foldedMoreFields: "{{count}} autre",
1248+
foldedMoreFields_one: "{{count}} autre",
1249+
foldedMoreFields_many: "{{count}} d’autres",
1250+
foldedMoreFields_other: "{{count}} autres",
1251+
expandFolded: "Afficher chaque mise à jour",
1252+
collapseFolded: "Masquer les mises à jour",
12411253
replyCount: "{{count}} réponse",
12421254
replyCount_one: "{{count}} réponse",
12431255
replyCount_many: "{{count}} de réponses",

‎ui/packages/i18n/src/locales/ja.ts‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1217,6 +1217,16 @@ const ja = {
12171217
edited: "(編集済み)",
12181218
via: "{{source}} 経由",
12191219
viewSource: "ソースを表示",
1220+
// objectstack#25959 — a run of consecutive updates folded into one feed row.
1221+
foldedUpdates: "{{fields}} を更新",
1222+
foldedUpdateCount: "{{count}} 回",
1223+
foldedUpdateCount_one: "{{count}} 回",
1224+
foldedUpdateCount_other: "{{count}} 回",
1225+
foldedMoreFields: "他 {{count}} 件",
1226+
foldedMoreFields_one: "他 {{count}} 件",
1227+
foldedMoreFields_other: "他 {{count}} 件",
1228+
expandFolded: "各更新を表示",
1229+
collapseFolded: "更新を隠す",
12201230
replyCount: "{{count}} 件の返信",
12211231
replyCount_one: "{{count}} 件の返信",
12221232
replyCount_other: "{{count}} 件の返信",

0 commit comments

Comments
 (0)