models/lib/boardTimeline.js's reconstructBoardStateAt(currentCards,
activities, asOfTimestamp) computes what each card's title, description,
listId, swimlaneId, labelIds, members, assignees, dueAt and archived flag
would have been at a given moment, by taking the card's CURRENT state and
undoing every activity after that moment in reverse-chronological order.
It reads the board's existing Activities log as the source of truth rather
than storing separate snapshots, and is pure/read-only: no Mongo/Meteor
access, no mutation of its inputs, and no Activity is ever written or
deleted.
Covers createCard, a-changedTitle, a-changedDescription, a-dueAt, moveCard,
archivedCard/restoredCard, joinMember/unjoinMember, joinAssignee/
unjoinAssignee and addedLabel/removedLabel - every activityType that
currently records enough old/new detail to be reversed. moveCardBoard,
setCustomField/unsetCustomField and deleteCard are known but not reversed;
cross-board moves are surfaced via unreversedActivityTypes rather than
silently left unhandled.
This is Step 1 of the "Board View / Timeline" feature only: the read-only
reconstruction function and its tests. The Timeline board-view UI, the
per-card restore action and the selective per-member change removal
described in the same request are not implemented in this commit - see the
CHANGELOG entry for what is and is not delivered.
tests/boardTimeline.test.cjs pins each activityType's undo transform, a
multi-step history reconstructed at several points, that the function
never mutates its inputs, and a negative test scanning the module's source
for any Activities removal call.
Thanks to xet7 !