Skip to content

fix(popup): map edited timestamp to threaded-annotations updatedAt#757

Open
jackiejou wants to merge 1 commit into
box:masterfrom
jackiejou:fix/popup-v2-edited-indicator
Open

fix(popup): map edited timestamp to threaded-annotations updatedAt#757
jackiejou wants to merge 1 commit into
box:masterfrom
jackiejou:fix/popup-v2-edited-indicator

Conversation

@jackiejou
Copy link
Copy Markdown
Collaborator

Summary

The threaded-annotations v2 thread component shows an edited indicator on a message when its updatedAt is set to a timestamp newer than createdAt. The box-annotations adapter was not populating updatedAt, so even after the user edited an annotation in PopupV2, the thread never rendered the indicator.

This change maps Annotation.modified_at to the root message updatedAt when it differs from created_at. Replies are unaffected because the API model has no modified_at on Reply and the adapter forces canEdit: false for replies.

Implementation notes

  • Compares parsed instants (getTime()) rather than raw ISO strings, so equivalent normalizations (Z vs +00:00, fractional precision) are treated as unedited.
  • Falls back to undefined for unparseable modified_at. The consumer simply hides the indicator in that case rather than crashing the popup; the field is optional in the public type.

Test plan

  • Open an annotation in the threaded popup, edit the root message, save, and confirm the edited indicator renders
  • Reload the file with the edited annotation already on disk and confirm the indicator still renders on the root message
  • Confirm an unedited annotation does not render the indicator
  • Confirm replies do not render the indicator (they have no editable timestamp in the model)

Populate updatedAt on the root description message so PopupV2 surfaces
the edited indicator after the user edits an annotation. The thread
component reads updatedAt to decide whether to render the indicator and
expects it undefined for unedited messages.

Compare parsed instants instead of raw ISO strings so equivalent formats
(Z vs +00:00, fractional precision) are treated as unedited. Unparseable
modified_at falls back to undefined; the consumer hides the indicator
rather than crashing the popup.
@jackiejou jackiejou requested a review from a team as a code owner May 20, 2026 03:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant