Repository navigation
Commit 0b76a1f
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
File tree
- .changeset
- scripts/sdui-manifest.sources
- ui/packages
- i18n/src/locales
- plugin-detail/src
- __tests__
- renderers
- __tests__
- types/src
| 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 | + | |
| 16 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1343 | 1343 | | |
1344 | 1344 | | |
1345 | 1345 | | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
1346 | 1364 | | |
1347 | 1365 | | |
1348 | 1366 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1205 | 1205 | | |
1206 | 1206 | | |
1207 | 1207 | | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
1208 | 1218 | | |
1209 | 1219 | | |
1210 | 1220 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1581 | 1581 | | |
1582 | 1582 | | |
1583 | 1583 | | |
| 1584 | + | |
| 1585 | + | |
| 1586 | + | |
| 1587 | + | |
| 1588 | + | |
| 1589 | + | |
| 1590 | + | |
| 1591 | + | |
| 1592 | + | |
| 1593 | + | |
1584 | 1594 | | |
1585 | 1595 | | |
1586 | 1596 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1241 | 1241 | | |
1242 | 1242 | | |
1243 | 1243 | | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
1244 | 1256 | | |
1245 | 1257 | | |
1246 | 1258 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1238 | 1238 | | |
1239 | 1239 | | |
1240 | 1240 | | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
1241 | 1253 | | |
1242 | 1254 | | |
1243 | 1255 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1217 | 1217 | | |
1218 | 1218 | | |
1219 | 1219 | | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
1220 | 1230 | | |
1221 | 1231 | | |
1222 | 1232 | | |
| |||
0 commit comments