feat(activity-feed-v2): display audio comment time ranges in the composer and badge - #4820
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (6)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. WalkthroughThe change adds shared time-range formatting. Media timestamp labels and comment annotation badges now display start and end timestamps when available, while preserving single-timestamp behavior and seeking to the range start. ChangesTimestamp Range Support
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to Audio comment ranges now display both selected timestamps in the active format, while existing single timestamps and badge seeking behavior remain unchanged. No concrete current-head merge risk remains. Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. A rabbit formats bounds in a row Comment |
51c5fe4 to
d2ba1aa
Compare
Format a comment that carries an end timestamp as a range on its badge, using a shared formatter so both bounds respect the active time format. Clicking the badge still seeks to the start of the range. The composer half of the range display is deferred: the composer cannot hold a range until the waveform handles are wired up, so that label change lands with the composer state it depends on. Co-authored-by: Cursor <cursoragent@cursor.com>
…eckbox Label the timestamp checkbox with both bounds once a range has been selected, falling back to the single captured time until then. The hook already owns the end timestamp and derives the formatted label, so this reuses the same range formatter the posted badge uses and needs no change at the call site. Co-authored-by: Cursor <cursoragent@cursor.com>
d2ba1aa to
8c04129
Compare
|
the hardcoded separator caught my eye just because it's... well, hardcoded, but unless there is any elegant way around that i'm fine with it as is! |
Merge Queue Status
This pull request spent 40 minutes 13 seconds in the queue, including 13 minutes 43 seconds running CI. Required conditions to merge
|
Summary
Renders a selected time range as a readable label in the two places a user sees it: the timestamp checkbox while composing, and the badge on a posted comment. This is presentation only — it consumes the end timestamp that earlier changes already parse from comment markup and hold in composer state, and turns milliseconds into a string. No persisted data changes.
Comments that carry only a single timestamp render exactly as they do today, on both surfaces.
Changes
useTimeFormat.ts— addsformatTimeRange, which formats each bound through the existingformatByTimeFormatand joins them with a separator.FeedItemRow.tsx— the Frame badge target is formatted as a range when the comment has an end timestamp. Clicking the badge still seeks to the start.useMediaTimestamp.ts— the composer label becomes a range once a range has been selected, and stays a single time until then.Notes on the approach
One formatter, two surfaces. Both consumers take an opaque display string — the composer's timestamp toggle takes
formattedTimestamp: stringand the badge's Frame variant takes atimestampstring — so a single shared formatter serves both and keeps the separator character decided in one place. This also means no change is needed in the shared annotations package.Both bounds respect the active time format. Ranges are formatted per-bound rather than by formatting the start and appending a raw end, so
standard,timecode, andframesall work, including the fps-dependent frame math.The composer label is derived in the hook, not at the call site. The hook already owns the end timestamp and produces
formattedTimestamp, so the range label falls out of the existing wiring without touchingActivityFeedV2.Accessibility is unchanged. The badge's accessible name comes from its visible label, so a range announces with the start time first. The checkbox keeps its own static
aria-label.Test plan
activity-feed-v2suite, lint, and typecheck pass.Summary by CodeRabbit
New Features
Tests