Skip to content

fix(activity-feed-v2): show comments-disabled states and bump activity-feed to 2.4.0 - #4756

Merged
mergify[bot] merged 6 commits into
box:masterfrom
abhishek1128:fix/activity-feed-v2-comments-disabled-af-bump
Aug 7, 2026
Merged

fix(activity-feed-v2): show comments-disabled states and bump activity-feed to 2.4.0#4756
mergify[bot] merged 6 commits into
box:masterfrom
abhishek1128:fix/activity-feed-v2-comments-disabled-af-bump

Conversation

@abhishek1128

@abhishek1128 abhishek1128 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • When file.permissions.can_comment is false, Activity Feed v2 passes areCommentsDisabled to @box/activity-feed and hides the local composer so the feed shows the comments-disabled empty state / footer instead of the editor.
  • Defaults to comments enabled when can_comment is unset.
  • Bumps @box/activity-feed to 2.4.0 (adds areCommentsDisabled support) and the peer versions it requires.

Description

Bumps @box/activity-feed to 2.4.0, along with the peer versions activity-feed 2.4.x requires.

Package Before After
@box/activity-feed ^2.3.12 ^2.4.0
@box/threaded-annotations ^4.5.3 ^4.8.4
@box/blueprint-web ^16.18.0 ^16.20.5
@box/blueprint-web-assets ^5.6.8 ^5.7.12
@box/collaboration-popover ^2.2.8 ^2.2.21
@box/readable-time ^2.2.8 ^2.2.21
@box/user-selector ^2.2.8 ^2.2.22

Ranges updated in both devDependencies and peerDependencies; lockfile deduplicated so each bumped package resolves to a single version.

Testing

  • Pre-push hook build and changedSince tests passed locally
  • Unit test: can_comment: false sets areCommentsDisabled and does not render the editor

Summary by CodeRabbit

  • Bug Fixes
    • Commenting in the activity feed now respects the file’s comment permissions.
    • Users without comment access see comments disabled, and the comment editor is hidden.
    • Commenting is also disabled when permission information is unavailable, preventing unintended comment attempts.
    • Existing activity feed interactions remain available when users have permission to comment.

Includes peer bumps required by activity-feed 2.4.0: blueprint-web
16.20.5, blueprint-web-assets 5.7.12, collaboration-popover 2.2.21,
readable-time 2.2.21, threaded-annotations 4.8.4, user-selector 2.2.22.
Lockfile deduplicated.
…mment is false

Wire can_comment into ActivityFeed.Root and hide the editor when comments
are disabled.
@abhishek1128
abhishek1128 requested review from a team as code owners August 6, 2026 23:29
@CLAassistant

CLAassistant commented Aug 6, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@abhishek1128 abhishek1128 added dependencies Pull requests that update a dependency file javascript Pull requests that update javascript code labels Aug 6, 2026
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 536c2af5-b3a3-4658-b67c-8ba0fb86d98b

📥 Commits

Reviewing files that changed from the base of the PR and between cfac570 and 8d1c7bc.

📒 Files selected for processing (1)
  • src/elements/content-sidebar/activity-feed-v2/ActivityFeedV2.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/elements/content-sidebar/activity-feed-v2/ActivityFeedV2.tsx

Walkthrough

ActivityFeedV2 now reads file.permissions.can_comment, passes the result to ActivityFeed.Root, and hides the comment editor when commenting is unavailable. Related @box/* development and peer dependency versions are also updated.

Changes

Activity feed comment permissions

Layer / File(s) Summary
Comment permission flow and coverage
src/elements/content-sidebar/activity-feed-v2/types.ts, src/elements/content-sidebar/activity-feed-v2/ActivityFeedV2.tsx, src/elements/content-sidebar/activity-feed-v2/__tests__/ActivityFeedV2.test.tsx
ActivityFeedV2File supports permissions.can_comment. ActivityFeed.Root receives the disabled state, and the editor renders only when commenting is allowed. Tests cover denied, missing, undefined, and enabled comment permissions.
Activity feed dependency updates
package.json
Related @box/* versions are updated in development and peer dependencies.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant File as File permissions
  participant ActivityFeedV2
  participant Root as ActivityFeed.Root
  participant Editor as Comment editor
  File->>ActivityFeedV2: Provide permissions.can_comment
  ActivityFeedV2->>Root: Set areCommentsDisabled
  ActivityFeedV2->>Editor: Render editor when canComment is true
Loading

Possibly related PRs

Suggested labels: ready-to-merge

Suggested reviewers: ahorowitz123, zhirongwang

Poem

A rabbit checks the comment gate,
can_comment sets the state.
The editor waits when access ends,
Tests confirm the rule, dear friends.
New packages hop in line,
The activity feed is fine.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the comments-disabled behavior and dependency upgrade.
Description check ✅ Passed The description clearly explains the behavior change, dependency updates, and completed testing.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@socket-security

socket-security Bot commented Aug 6, 2026

Copy link
Copy Markdown

Comment thread src/elements/content-sidebar/activity-feed-v2/ActivityFeedV2.tsx Outdated
…s unset

Treat missing file/permissions as comments disabled, and update tests to
cover those cases while explicitly enabling comments where the editor is
exercised.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/elements/content-sidebar/activity-feed-v2/__tests__/ActivityFeedV2.test.tsx (1)

222-233: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Assert the enabled root prop.

The enabled test checks editor visibility but not lastRootProps.areCommentsDisabled. Add an assertion that the prop is false; otherwise a regression could mark permitted feeds as disabled while this test still passes.

Proposed test assertion
         expect(screen.getByTestId('activity-feed-editor')).toBeVisible();
+        expect(lastRootProps.areCommentsDisabled).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__/ActivityFeedV2.test.tsx`
around lines 222 - 233, Add an assertion in the enabled ActivityFeedV2 test to
verify lastRootProps.areCommentsDisabled is false, alongside the existing
visibility assertions. Use the test’s existing root-props capture mechanism and
preserve the current rendering setup.
🤖 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__/ActivityFeedV2.test.tsx`:
- Around line 222-233: Add an assertion in the enabled ActivityFeedV2 test to
verify lastRootProps.areCommentsDisabled is false, alongside the existing
visibility assertions. Use the test’s existing root-props capture mechanism and
preserve the current rendering setup.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 05cf7909-641f-4d1f-aeec-1ab1346bcda1

📥 Commits

Reviewing files that changed from the base of the PR and between 71e0ead and 141ac0f.

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

Comment thread src/elements/content-sidebar/activity-feed-v2/ActivityFeedV2.tsx Outdated
@mergify

mergify Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • Entered queue2026-08-07 23:46 UTC · Rule: Automatic strict merge · triggered by rule Automatic merge queue
  • Checks passed · in-place
  • Merged2026-08-07 23:58 UTC · at 80d49b94001d0ccc2d9e62b4665bdb4b9324e234 · squash

This pull request spent 12 minutes 29 seconds in the queue, including 12 minutes 14 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 84b90a7 into box:master Aug 7, 2026
9 of 10 checks passed
@mergify mergify Bot removed the queued label Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file javascript Pull requests that update javascript code ready-to-merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants