fix(activity-feed-v2): improve deeplink scroll/highlight and bump activity-feed to 3.0.0 - #4765
Conversation
WalkthroughActivity-feed dependencies were updated. Deep-link helpers now resolve reply IDs to parent feed rows. Scrolling uses start alignment, and matched rows highlight for two seconds with timer resets on active-entry changes. ChangesActivity Feed Deep-Link Handling
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant ActiveEntry
participant ActivityFeedV2
participant resolveFeedItemIdForEntry
participant FeedItemRow
ActiveEntry->>ActivityFeedV2: set activeFeedEntryId
ActivityFeedV2->>resolveFeedItemIdForEntry: resolve root feed-row ID
resolveFeedItemIdForEntry-->>ActivityFeedV2: return matching row ID
ActivityFeedV2->>FeedItemRow: scrollTo({ block: 'start' })
ActiveEntry->>FeedItemRow: update active entry
FeedItemRow->>FeedItemRow: hold highlight for 2 seconds
Possibly related PRs
Suggested labels: Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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. Comment |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/elements/content-sidebar/activity-feed-v2/__tests__/FeedItemRow.test.tsx (1)
252-271: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winTest the timer reset before the original deadline.
Line 259 expires the first timer before
activeFeedEntryIdchanges. The test cannot detect a stale timer that clears the new highlight at the original deadline. Advance part of the hold duration beforererender, then assert that the highlight remains active after the original deadline and clears only after the restarted deadline.
src/elements/content-sidebar/activity-feed-v2/__tests__/FeedItemRow.test.tsx#L252-L271: change the comment-thread test to rerender before the first two-second timer expires.src/elements/content-sidebar/activity-feed-v2/__tests__/FeedItemRow.test.tsx#L540-L561: apply the same timing sequence to the annotation-thread test.Proposed test timing
- act(() => { - jest.advanceTimersByTime(2000); - }); - expect(lastThreadedAnnotationProps.isHighlighted).toBe(false); + act(() => { + jest.advanceTimersByTime(1000); + }); rerender(<FeedItemRow {...defaultProps} activeFeedEntryId="reply-1" item={mockComment} />); expect(lastThreadedAnnotationProps.isHighlighted).toBe(true); act(() => { - jest.advanceTimersByTime(2000); + jest.advanceTimersByTime(1000); }); + expect(lastThreadedAnnotationProps.isHighlighted).toBe(true); + act(() => { + jest.advanceTimersByTime(1000); + }); expect(lastThreadedAnnotationProps.isHighlighted).toBe(false);🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/elements/content-sidebar/activity-feed-v2/__tests__/FeedItemRow.test.tsx` around lines 252 - 271, The tests at src/elements/content-sidebar/activity-feed-v2/__tests__/FeedItemRow.test.tsx#L252-L271 and `#L540-L561` must rerender before the initial two-second timer expires. In both the comment-thread and annotation-thread tests, advance only part of the hold duration, change activeFeedEntryId, verify the highlight remains active past the original deadline, then advance through the restarted deadline and verify it clears.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In
`@src/elements/content-sidebar/activity-feed-v2/__tests__/FeedItemRow.test.tsx`:
- Around line 252-271: The tests at
src/elements/content-sidebar/activity-feed-v2/__tests__/FeedItemRow.test.tsx#L252-L271
and `#L540-L561` must rerender before the initial two-second timer expires. In
both the comment-thread and annotation-thread tests, advance only part of the
hold duration, change activeFeedEntryId, verify the highlight remains active
past the original deadline, then advance through the restarted deadline and
verify it clears.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 587196ea-d656-443a-9ac2-acfc2cf42f33
⛔ Files ignored due to path filters (1)
yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (7)
package.jsonsrc/elements/content-sidebar/activity-feed-v2/ActivityFeedV2.tsxsrc/elements/content-sidebar/activity-feed-v2/FeedItemRow.tsxsrc/elements/content-sidebar/activity-feed-v2/__tests__/ActivityFeedV2.test.tsxsrc/elements/content-sidebar/activity-feed-v2/__tests__/FeedItemRow.test.tsxsrc/elements/content-sidebar/activity-feed-v2/__tests__/helpers.test.tssrc/elements/content-sidebar/activity-feed-v2/helpers.ts
…t fade Resolve reply deeplinks to the parent thread card, scroll with block start for fade-mask clearance, and time out the highlight so it can fade while activeFeedEntryId stays set.
9677964 to
e1a20ac
Compare
Merge Queue Status
This pull request spent 13 seconds in the queue, including 3 seconds running CI. Required conditions to merge
|
Summary
block: 'start'(aligned with activity-feed fade-mask clearance). Thread card in view is enough, no reply expand /scrollToMessage.activeFeedEntryIdstays set; same-thread id changes restart the hold.@box/activity-feedto 3.0.0 and@box/threaded-annotationsto 4.8.7.Description
Bumps
@box/activity-feedto 3.0.0 (scroll alignment / pin-to-bottom) and@box/threaded-annotationsto 4.8.7 (highlight fade), then wires Activity Feed v2 deeplink behavior to that API.@box/activity-feed^2.4.0^3.0.0@box/threaded-annotations^4.8.4^4.8.7Ranges updated in both
devDependenciesandpeerDependencies; lockfile updated so each bumped package resolves to a single version.Other AF/TA peer mins (e.g.
user-selector@^3) are unchanged in this PR — AF/TA only need the headless selector APIs already present on^2.2.22.Testing
Summary by CodeRabbit
Bug Fixes
Tests