Skip to content

feat(activity-feed): add new v2 placeholder#4460

Merged
mergify[bot] merged 4 commits into
box:masterfrom
jackiejou:activity-feed-stub
Mar 3, 2026
Merged

feat(activity-feed): add new v2 placeholder#4460
mergify[bot] merged 4 commits into
box:masterfrom
jackiejou:activity-feed-stub

Conversation

@jackiejou
Copy link
Copy Markdown
Contributor

@jackiejou jackiejou commented Mar 3, 2026

Summary

  • Add ActivityFeedV2 placeholder component in a new activity-feed-v2/ directory
  • Wire it into ActivitySidebar behind activityFeed.threadedRepliesV2.enabled feature key
  • When enabled, renders ActivityFeedV2 inside SidebarContent instead of the existing ActivityFeed
  • When disabled (default), existing behavior is completely unchanged
  • Uses a new threadedRepliesV2 key separate from existing newThreadedReplies to avoid interference

Test plan

  • Added RTL tests in ActivitySidebar.rtl.test.js covering feature gate enabled, disabled, and unset
  • Added unit test for ActivityFeedV2 component

Summary by CodeRabbit

  • New Features

    • Introduced Activity Feed V2 component, accessible via feature flag for threaded replies functionality.
  • Tests

    • Added test coverage for feature flag logic and V2 component rendering.

@jackiejou jackiejou requested review from a team as code owners March 3, 2026 01:22
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 3, 2026

Walkthrough

This pull request introduces a new ActivityFeedV2 component with feature flag support. The ActivitySidebar now conditionally renders ActivityFeedV2 based on the threadedRepliesV2 feature flag, falling back to the existing ActivityFeed when disabled. Corresponding tests verify both rendering paths.

Changes

Cohort / File(s) Summary
ActivitySidebar Integration
src/elements/content-sidebar/ActivitySidebar.js, src/elements/content-sidebar/__tests__/ActivitySidebar.rtl.test.js
Added feature flag check for threadedRepliesV2 to conditionally render ActivityFeedV2 component. Test suite includes duplication of the same feature-gate test block appearing twice in the file.
ActivityFeedV2 Module
src/elements/content-sidebar/activity-feed-v2/ActivityFeedV2.tsx, src/elements/content-sidebar/activity-feed-v2/__tests__/ActivityFeedV2.test.tsx, src/elements/content-sidebar/activity-feed-v2/index.ts
New ActivityFeedV2 placeholder component with unit test coverage. Barrel export added to enable importing from module root.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested labels

ready-to-merge

Suggested reviewers

  • jankowiakdawid
  • tjuanitas
  • bfoxx1906

Poem

🐰 A new feed component hops into view,
Feature flagged, with tests shiny and new,
ActivityFeedV2 stands ready and bright,
The sidebar now switches with conditional might! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ 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%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding a new ActivityFeedV2 placeholder component as part of the activity-feed feature.
Description check ✅ Passed The description clearly outlines the changes made and test coverage, though it uses the provided template structure which is about merge procedures rather than PR-specific details.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

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

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/elements/content-sidebar/__tests__/ActivitySidebar.rtl.test.js (1)

517-539: Add one precedence test for overlapping feed flags.

Consider adding a case where both activityFeed.newThreadedReplies.enabled and activityFeed.threadedRepliesV2.enabled are true, and assert V2 still wins. This locks intended behavior if both rollouts are active together.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/elements/content-sidebar/__tests__/ActivitySidebar.rtl.test.js` around
lines 517 - 539, Add a new test in the describe('render() - threadedRepliesV2
feature gate') suite that calls renderActivitySidebar with features set so both
activityFeed.newThreadedReplies.enabled and
activityFeed.threadedRepliesV2.enabled are true, then assert that ActivityFeedV2
is rendered (expect getByTestId('activity-feed-adapter-v2') toBeInTheDocument())
and that the legacy feed is not (expect queryByTestId('activity-feed-mock')
not.toBeInTheDocument()); place this alongside the existing tests so
renderActivitySidebar and the same test ids are reused to lock V2 precedence
when both flags overlap.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/elements/content-sidebar/ActivitySidebar.js`:
- Around line 1317-1328: The V2 feature branch renders SidebarContent without
the existing actions and full-layout class, causing loss of filter/task actions
and layout parity; update the isThreadedRepliesV2Enabled branch in
ActivitySidebar.js so the SidebarContent includes actions={this.renderActions()}
and preserves the conditional "bcs-activity--full" CSS class (same logic used in
the non-V2 branch), ensuring the V2 path mirrors the original SidebarContent
props and classes.

---

Nitpick comments:
In `@src/elements/content-sidebar/__tests__/ActivitySidebar.rtl.test.js`:
- Around line 517-539: Add a new test in the describe('render() -
threadedRepliesV2 feature gate') suite that calls renderActivitySidebar with
features set so both activityFeed.newThreadedReplies.enabled and
activityFeed.threadedRepliesV2.enabled are true, then assert that ActivityFeedV2
is rendered (expect getByTestId('activity-feed-adapter-v2') toBeInTheDocument())
and that the legacy feed is not (expect queryByTestId('activity-feed-mock')
not.toBeInTheDocument()); place this alongside the existing tests so
renderActivitySidebar and the same test ids are reused to lock V2 precedence
when both flags overlap.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c816fe9 and 7852f24.

📒 Files selected for processing (5)
  • src/elements/content-sidebar/ActivitySidebar.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/__tests__/ActivityFeedV2.test.tsx
  • src/elements/content-sidebar/activity-feed-v2/index.ts

Comment thread src/elements/content-sidebar/ActivitySidebar.js
@jackiejou jackiejou force-pushed the activity-feed-stub branch from 7852f24 to 0d6ef56 Compare March 3, 2026 01:39
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
src/elements/content-sidebar/ActivitySidebar.js (1)

1317-1328: ⚠️ Potential issue | 🟠 Major

V2 branch regresses SidebarContent chrome parity (actions + full layout class).

Line 1319 renders SidebarContent without actions={this.renderActions()}, and Line 1320 drops the conditional bcs-activity--full class. That changes behavior/UI when the V2 flag is enabled.

Proposed parity fix
         if (isThreadedRepliesV2Enabled) {
             return (
                 <SidebarContent
-                    className="bcs-activity"
+                    actions={this.renderActions()}
+                    className={classNames('bcs-activity', { 'bcs-activity--full': hasReplies })}
                     elementId={elementId}
                     sidebarView={SIDEBAR_VIEW_ACTIVITY}
                     title={this.renderTitle()}
                 >
                     <ActivityFeedV2 />
                 </SidebarContent>
             );
         }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/elements/content-sidebar/ActivitySidebar.js` around lines 1317 - 1328,
The V2 branch omits the existing SidebarContent chrome: when
isThreadedRepliesV2Enabled returns true, render SidebarContent with the same
props as the V1 branch—include actions={this.renderActions()} and preserve the
conditional full-layout className (e.g., include "bcs-activity--full" when
appropriate) so the V2 path around SidebarContent (wrapping ActivityFeedV2)
matches the original chrome and layout used for SIDEBAR_VIEW_ACTIVITY,
elementId, and title={this.renderTitle()}.
🧹 Nitpick comments (1)
src/elements/content-sidebar/__tests__/ActivitySidebar.rtl.test.js (1)

517-540: Nice gate-path coverage; add one parity assertion for SidebarContent props.

These tests correctly verify feed switching. Recommend adding a V2-enabled assertion for sidebar chrome parity (actions present and bcs-activity--full when hasReplies is true) to prevent regressions like the current one.

Suggested test addition
+        test('should preserve SidebarContent chrome when threadedRepliesV2 is enabled', () => {
+            renderActivitySidebar({
+                hasReplies: true,
+                features: { activityFeed: { threadedRepliesV2: { enabled: true } } },
+            });
+
+            expect(screen.getByTestId('sidebar-content-mock')).toHaveClass('bcs-activity--full');
+            expect(screen.getByTestId('sidebar-actions')).not.toBeEmptyDOMElement();
+        });
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/elements/content-sidebar/__tests__/ActivitySidebar.rtl.test.js` around
lines 517 - 540, Add a V2-enabled parity assertion to the existing
threadedRepliesV2 tests by updating the test that enables threadedRepliesV2 in
the describe block: after calling renderActivitySidebar({ features: {
activityFeed: { threadedRepliesV2: { enabled: true } } } }), assert that the
sidebar chrome props match the non-V2 behavior — verify that the actions element
is present (using the same test-id/class used for actions) and that the sidebar
container has the bcs-activity--full class when hasReplies is true; use the
existing renderActivitySidebar helper and query utilities (screen.getByTestId /
getByClassName equivalent) so the new assertions sit right after the existing
ActivityFeedV2 presence checks.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@src/elements/content-sidebar/ActivitySidebar.js`:
- Around line 1317-1328: The V2 branch omits the existing SidebarContent chrome:
when isThreadedRepliesV2Enabled returns true, render SidebarContent with the
same props as the V1 branch—include actions={this.renderActions()} and preserve
the conditional full-layout className (e.g., include "bcs-activity--full" when
appropriate) so the V2 path around SidebarContent (wrapping ActivityFeedV2)
matches the original chrome and layout used for SIDEBAR_VIEW_ACTIVITY,
elementId, and title={this.renderTitle()}.

---

Nitpick comments:
In `@src/elements/content-sidebar/__tests__/ActivitySidebar.rtl.test.js`:
- Around line 517-540: Add a V2-enabled parity assertion to the existing
threadedRepliesV2 tests by updating the test that enables threadedRepliesV2 in
the describe block: after calling renderActivitySidebar({ features: {
activityFeed: { threadedRepliesV2: { enabled: true } } } }), assert that the
sidebar chrome props match the non-V2 behavior — verify that the actions element
is present (using the same test-id/class used for actions) and that the sidebar
container has the bcs-activity--full class when hasReplies is true; use the
existing renderActivitySidebar helper and query utilities (screen.getByTestId /
getByClassName equivalent) so the new assertions sit right after the existing
ActivityFeedV2 presence checks.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7852f24 and 0d6ef56.

📒 Files selected for processing (5)
  • src/elements/content-sidebar/ActivitySidebar.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/__tests__/ActivityFeedV2.test.tsx
  • src/elements/content-sidebar/activity-feed-v2/index.js
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/elements/content-sidebar/activity-feed-v2/ActivityFeedV2.tsx
  • src/elements/content-sidebar/activity-feed-v2/tests/ActivityFeedV2.test.tsx

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
src/elements/content-sidebar/ActivitySidebar.js (1)

1318-1327: ⚠️ Potential issue | 🟠 Major

Preserve SidebarContent parity in the V2 flag path.

Line 1320 omits actions={this.renderActions()}, and Line 1321 hardcodes bcs-activity without the existing bcs-activity--full condition. When activityFeed.threadedRepliesV2.enabled is on, this drops filter/task actions and breaks layout parity.

💡 Suggested parity fix
         if (isThreadedRepliesV2Enabled) {
             return (
                 <SidebarContent
-                    className="bcs-activity"
+                    actions={this.renderActions()}
+                    className={classNames('bcs-activity', { 'bcs-activity--full': hasReplies })}
                     elementId={elementId}
                     sidebarView={SIDEBAR_VIEW_ACTIVITY}
                     title={this.renderTitle()}
                 >
                     <ActivityFeedV2 />
                 </SidebarContent>
             );
         }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/elements/content-sidebar/ActivitySidebar.js` around lines 1318 - 1327,
The V2 flag branch for isThreadedRepliesV2Enabled is missing the actions prop
and the full-width class; update the SidebarContent JSX inside that branch to
pass actions={this.renderActions()} and compute className the same way as the
non-V2 branch (preserving "bcs-activity" and conditionally adding
"bcs-activity--full" when appropriate) so ActivityFeedV2 renders with the same
actions and layout parity; look for SidebarContent, isThreadedRepliesV2Enabled,
and this.renderActions() to apply the change.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@src/elements/content-sidebar/ActivitySidebar.js`:
- Around line 1318-1327: The V2 flag branch for isThreadedRepliesV2Enabled is
missing the actions prop and the full-width class; update the SidebarContent JSX
inside that branch to pass actions={this.renderActions()} and compute className
the same way as the non-V2 branch (preserving "bcs-activity" and conditionally
adding "bcs-activity--full" when appropriate) so ActivityFeedV2 renders with the
same actions and layout parity; look for SidebarContent,
isThreadedRepliesV2Enabled, and this.renderActions() to apply the change.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 77aa1bd and f71a088.

📒 Files selected for processing (2)
  • src/elements/content-sidebar/ActivitySidebar.js
  • src/elements/content-sidebar/activity-feed-v2/ActivityFeedV2.tsx

Copy link
Copy Markdown
Contributor

@kduncanhsu kduncanhsu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mergify mergify Bot added the queued label Mar 3, 2026
@mergify mergify Bot merged commit 573a423 into box:master Mar 3, 2026
8 of 9 checks passed
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Mar 3, 2026

Merge Queue Status

Rule: Automatic strict merge


  • Entered queue2026-03-03 22:18 UTC
  • Checks passed · in-place
  • Merged2026-03-03 22:18 UTC · at f71a08813d55c48e936f504c42e0665950e8c513

This pull request spent 5 seconds in the queue, with no time running CI.

Required conditions to merge

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