Skip to content

feat(activity-feed): open the version a timestamped comment was made on and seek to it - #4918

Merged
mergify[bot] merged 3 commits into
box:masterfrom
abhishek1128:feat/versioned-timestamped-comments
Oct 23, 2026
Merged

mergify[bot] merged 3 commits into
box:masterfrom
abhishek1128:feat/versioned-timestamped-comments

Conversation

@abhishek1128

@abhishek1128 abhishek1128 commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Clicking the timestamp on a comment made on a previous version of an audio or video file now opens that version and starts playback at the comment's timestamp. Before, it seeked within whichever version was on screen.

Timestamped comments already record their version in the markup (#[timestamp:ms,endTimestamp:ms,versionId:id]). This PR reads that version id and uses it in the activity feed and in preview.

Changes

Opening a comment's version

  • extractTimestampMarkup returns the comment's versionId, and the transformer exposes it as annotationTimestampVersionId.
  • When the comment's version isn't the one being previewed, ActivityFeedV2 calls a new onCommentVersionSelect prop.
  • ActivitySidebar routes to that version the same way it opens an annotation from another version: through the annotations path, or through internalSidebarNavigationHandler when the router is disabled. It then passes the timestamp up.
  • ContentPreview sets startAt for the next load, so the version opens at the timestamp.
  • If the version isn't in the feed, the click seeks within the version on screen.

Clearing startAt

  • ContentPreview now clears startAt after one load, and whenever the file changes, so a later load (including the annotation path) doesn't reuse an old seek.

Markers per version

  • Waveform and scrubber markers only show comments and annotations from the version on screen. Items without a recorded version show on every version.
  • The marker wiring moved out of ActivityFeedV2 into a useCommentMarkerViewer hook. The hook re-attaches when Preview replaces the viewer for another version, and detaches from destroyed viewers.

Side-by-side compare

  • The compared (right) pane gets its own markers through a new getComparedPreview prop. It's passed only while comparing.
  • Clicking a comment from the compared pane's version seeks that pane.

Previous version on screen

  • The timestamp toggle in the comment editor is hidden, because new timestamps are recorded against the current version.
  • A timestamp picked before switching versions is dropped.
  • Plain comments are still allowed.

Known limitations

  • The feed can merge consecutive uploads into one version item. A comment on a version in the middle of a merged run falls back to seeking the version on screen.
  • In compare mode, a comment from a version open in neither pane switches the compared version but doesn't seek.

Testing

  • Unit tests cover:
    • timestamp parsing
    • routing with and without the router
    • clearing startAt after one load and when the file changes
    • skipping startAt while comparing
    • filtering markers by version
    • re-attaching to a new viewer and detaching from a destroyed one
    • the compared pane
    • matching merged version items
    • hiding the toggle and dropping a stale timestamp
  • Manually tested on video and audio:
    • opening older versions from their comments
    • going back to the current version
    • side-by-side compare
    • the toggle on previous versions

Summary by CodeRabbit

  • New Features
    • Selecting a comment timestamp can open the corresponding file version at that point, or seek within the version already being viewed—including in comparison mode.
    • Comment markers are shown on the matching preview, and timestamp controls are unavailable when previewing an earlier version.
  • Bug Fixes
    • Timestamp selections are cleared when switching file versions, preventing stale timestamps from being added to comments.

abhishek1128 and others added 2 commits October 22, 2026 13:36
…on and seek to it

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@abhishek1128
abhishek1128 requested review from a team as code owners October 22, 2026 21:31
@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6f5b7316-1351-4a69-bfd2-df6a06cd235b
📥 Commits

Reviewing files that changed from the base of the PR and between a0ac01f and 80d5265.

📒 Files selected for processing: 16
  • src/elements/content-preview/ContentPreview.js
  • src/elements/content-preview/__tests__/ContentPreview.test.js
  • src/elements/content-sidebar/ActivitySidebar.js
  • src/elements/content-sidebar/ContentSidebar.js
  • src/elements/content-sidebar/Sidebar.js
  • src/elements/content-sidebar/SidebarPanels.js
  • src/elements/content-sidebar/__tests__/ActivitySidebar.rtl.test.js
  • src/elements/content-sidebar/activity-feed-v2/ActivityFeedV2.tsx
  • src/elements/content-sidebar/activity-feed-v2/FeedItemRow.tsx
  • src/elements/content-sidebar/activity-feed-v2/__tests__/ActivityFeedV2.test.tsx
  • src/elements/content-sidebar/activity-feed-v2/__tests__/FeedItemRow.test.tsx
  • src/elements/content-sidebar/activity-feed-v2/__tests__/timestampMarkup.test.ts
  • src/elements/content-sidebar/activity-feed-v2/timestampMarkup.ts
  • src/elements/content-sidebar/activity-feed-v2/transformers.ts
  • src/elements/content-sidebar/activity-feed-v2/types.ts
  • src/elements/content-sidebar/activity-feed-v2/useCommentMarkerViewer.ts

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

Walkthrough

Comment timestamps now retain their file-version IDs. The activity feed routes timestamp selection and markers to the matching preview pane or file version. Sidebar navigation passes version selections to ContentPreview, which applies the timestamp as a playback position when comparison is inactive.

Changes

Version-aware comment timestamps

Layer / File(s) Summary
Preserve timestamp version metadata
src/elements/content-sidebar/activity-feed-v2/timestampMarkup.ts, src/elements/content-sidebar/activity-feed-v2/transformers.ts, src/elements/content-sidebar/activity-feed-v2/types.ts, src/elements/content-sidebar/activity-feed-v2/__tests__/timestampMarkup.test.ts
Timestamp parsing and comment transformation preserve the timestamp’s file-version ID. Types describe version-aware timestamp selection and preview access.
Route timestamp selection and markers
src/elements/content-sidebar/activity-feed-v2/ActivityFeedV2.tsx, src/elements/content-sidebar/activity-feed-v2/FeedItemRow.tsx, src/elements/content-sidebar/activity-feed-v2/useCommentMarkerViewer.ts, src/elements/content-sidebar/activity-feed-v2/__tests__/*
Timestamp selection seeks the matching preview pane or requests another version when that version appears in the feed. Comment markers are filtered by pane version. Timestamp controls and posted comment metadata account for previous-version previews.
Connect feed selection to version navigation
src/elements/content-sidebar/ContentSidebar.js, src/elements/content-sidebar/Sidebar.js, src/elements/content-sidebar/SidebarPanels.js, src/elements/content-sidebar/ActivitySidebar.js, src/elements/content-sidebar/__tests__/ActivitySidebar.rtl.test.js
Sidebar components pass the compared-preview getter and version-selection callback to the activity feed. The activity sidebar navigates to the selected comment and calls the callback.
Apply version selection to preview
src/elements/content-preview/ContentPreview.js, src/elements/content-preview/__tests__/ContentPreview.test.js
ContentPreview provides the compared-pane preview getter and converts selected comment timestamps from milliseconds to seconds. It clears pending start positions after loading and when the file changes.

Priority: ➖ Normal

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant FeedItemRow
  participant ActivityFeedV2
  participant ComparedPreview
  participant ActivitySidebar
  participant ContentPreview
  FeedItemRow->>ActivityFeedV2: Select comment timestamp and file version
  ActivityFeedV2->>ComparedPreview: Seek when the timestamp version matches the compared pane
  ActivityFeedV2->>ActivitySidebar: Request another version when it is represented in the feed
  ActivitySidebar->>ContentPreview: Pass the selected version and timestamp
Loading

Suggested reviewers: kduncanhsu, zhirongwang, jmcbgaston

Merge Risk: ⚪ Minimal · up to 80d52

Clicking a timestamped comment now opens the version it was made on and seeks to the timestamp. The review found no concrete defect that would block merging.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 16 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly describes the main change: opening the version associated with a timestamped comment and seeking to its timestamp.
Description check Passed The description is complete and relevant. It explains the behavior, implementation changes, limitations, and test coverage. The repository template contains guidance only and does not require addition…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description is complete and relevant. It explains the behavior, implementation changes, limitations, and test coverage. The repository template contains guidance only and does not require additional sections.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

🔧 ast-grep (0.45.3)
src/elements/content-preview/__tests__/ContentPreview.test.js

ast-grep timed out on this file

🔧 Biome (2.5.15)
src/elements/content-preview/ContentPreview.js

File contains syntax errors that prevent linting: Line 904: Illegal return statement outside of a function; Line 37: 'import { type x ident }' are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 68: 'import type' are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 69: 'import type' are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 70: 'import type' are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 71: 'import type' are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 72: 'import type' are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 73: 'import type' are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 74: 'import type' are a TypeScript only feature. Convert your f

... [truncated 19228 characters] ...

)but instead found:; Line 1886: Expected a JSX attribute but instead found ')'.; Line 1884: Illegal return statement outside of a function; Line 1886: Unexpected token. Did you mean {'}'}or}?; Line 1886: Unexpected token. Did you mean {'>'}or>?; Line 2006: Expected a statement but instead found '}'.; Line 2009: 'export type' declarations are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 2027: Type annotations are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 2029: Expected an expression but instead found '?'.; Line 2029: expected :but instead found;`; Line 2030: Expected an expression but instead found '?'.; Line 907: Illegal return statement outside of a function

src/elements/content-sidebar/ActivitySidebar.js

File contains syntax errors that prevent linting: Line 1211: Unexpected token. Did you mean {'>'} or &gt;?; Line 423: Type annotations are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 423: Type annotations are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 423: Type annotations are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 423: return type annotation are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 444: Type annotations are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 444: return type annotation are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 462: Type annotations are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 462: return type annotation are

... [truncated 27672 characters] ...

feature. Convert your file to a TypeScript file or remove the syntax.; Line 399: Type annotations are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 399: Type annotations are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 399: expected , but instead found ?; Line 399: expected , but instead found Function; Line 399: Type annotations are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 399: expected , but instead found ?; Line 399: expected , but instead found Function; Line 399: return type annotation are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 1393: expected } but instead found ;

src/elements/content-sidebar/ContentSidebar.js

File contains syntax errors that prevent linting: Line 179: Type annotations are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 39: 'import type' are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 40: 'import type' are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 41: 'import type' are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 42: 'import type' are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 43: 'import type' are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 44: 'import type' are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 45: 'import type' are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 46: 'import t

... [truncated 4077 characters] ...

cript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 351: type annotation are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 369: return type annotation are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 421: type annotation are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 422: type annotation are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 433: expected ) but instead found :; Line 433: Unexpected token. Did you mean {'}'} or &rbrace;?; Line 222: return type annotation are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.

  • 2 others

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

A rabbit taps a timestamp bright,
And hops to frames in seconds’ flight.
The markers find their version’s place,
Two preview panes keep time apace.
The burrow hums; the comments play,
Then carrots celebrate the day!

Comment @coderabbitai help to get the list of available commands.

@mergify

mergify Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-10-23 18:14 UTC · Rule: Automatic strict merge · triggered by rule Automatic merge queue
  • ✅ Checks skipped · PR is already up-to-date
  • ✅ Merged — 2026-10-23 22:29 UTC · at 5e5c07c783305bcb9014d1004d5d1885ba618e6a · squash

This pull request spent 4 hours 14 minutes 56 seconds in the queue, including 2 seconds running CI.

Required conditions to merge
  • github-review-approved [🛡 GitHub branch protection]
  • any of [🛡 GitHub branch protection]:
    • check-success = Summary
    • check-neutral = Summary
    • check-skipped = Summary
  • any of [🛡 GitHub branch protection]:
    • check-success = lint_test_build
    • check-neutral = lint_test_build
    • check-skipped = lint_test_build
  • any of [🛡 GitHub branch protection]:
    • check-success = license/cla
    • check-neutral = license/cla
    • check-skipped = license/cla
  • any of [🛡 GitHub branch protection]:
    • check-success = lint_pull_request
    • check-neutral = lint_pull_request
    • check-skipped = lint_pull_request

@mergify
mergify Bot merged commit 5e5c07c into box:master Oct 23, 2026
10 of 11 checks passed
@mergify mergify Bot removed the queued label Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants