Skip to content

fix(activity-feed-v2): empty state when feed has only version rows#4622

Merged
mergify[bot] merged 1 commit into
box:masterfrom
jackiejou:feat/activity-feed-v2-empty-state-version-only
Jun 11, 2026
Merged

fix(activity-feed-v2): empty state when feed has only version rows#4622
mergify[bot] merged 1 commit into
box:masterfrom
jackiejou:feat/activity-feed-v2-empty-state-version-only

Conversation

@jackiejou

@jackiejou jackiejou commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • The /file_activities endpoint always returns at least one version row per upload, so a freshly uploaded file with no comments, tasks, or annotations rendered a single version row instead of the activity-feed empty state.
  • In ActivityFeedV2, when the filtered feed contains only version items, return [] so the shared @box/activity-feed ActivityFeed.List renders its existing EmptyState.
  • Skip the suppression when the filter step has already dropped items, so an empty filtered result does not get re-labeled as "No comments yet" when the user could recover the items by toggling a filter.

Test plan

  • yarn test --watchAll=false --testPathPattern="activity-feed-v2/__tests__/ActivityFeedV2" -> 58/58 passing
  • New test: version-only feed renders empty list (no version row).
  • New test: when a resolved comment is filtered out, the version row is still kept (so a filter-induced empty result does not collapse into the same empty state).
  • Manually verify on a freshly uploaded file with no comments: empty state appears.
  • Manually verify on a file with comments + a version row: both render normally.
  • Manually verify with Show resolved off and only resolved comments + a version row: version row still renders so the user can toggle the filter back on.

Summary by CodeRabbit

Release Notes

  • Bug Fixes
    • Fixed activity feed filtering behavior to display an empty state when certain filter combinations result in version-only content, rather than showing version entries.

…on rows

The /file_activities endpoint returns at least one version row per upload,
so a fresh file with no comments, tasks, or annotations rendered a single
version row instead of the empty state. Suppress version-only feeds so the
shared activity-feed empty state encourages comments. Filter-active cases
are skipped so a "no results" view does not collapse into "no comments yet".
@jackiejou jackiejou requested review from a team as code owners June 10, 2026 22:29
@coderabbitai

coderabbitai Bot commented Jun 10, 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

Run ID: 5858a7e5-743c-4290-ba59-03db98dd8aa8

📥 Commits

Reviewing files that changed from the base of the PR and between 1d49793 and b0a559b.

📒 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

Walkthrough

ActivityFeedV2 now suppresses version-only feeds: when no items are filtered out and the remaining feed contains exclusively version items, the component returns an empty list instead of rendering them, enabling the empty state. Test coverage expands to verify version items render with other feed types, are suppressed in version-only cases, and persist when other items are filtered out.

Changes

Version-only feed suppression

Layer / File(s) Summary
Version-only feed suppression implementation
src/elements/content-sidebar/activity-feed-v2/ActivityFeedV2.tsx
Filtering logic assigns filtered results to a filtered variable, then returns an empty array when no items were dropped by filters and all remaining items are of type version.
Test coverage for suppression behavior
src/elements/content-sidebar/activity-feed-v2/__tests__/ActivityFeedV2.test.tsx
Three targeted tests verify: version items render alongside other feed types, version-only feeds are suppressed for empty state rendering, and version rows remain when other items are filtered out.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • box/box-ui-elements#4533: Introduces initial version item filtering logic that this PR extends with version-only suppression behavior.

Suggested labels

ready-to-merge

Suggested reviewers

  • ahorowitz123
  • kduncanhsu
  • JChan106

Poem

🐰 A version feed hops alone, shy and unseen,
Hidden away when it's the only bean!
But shared with friends, it boldly stays,
A gentle dance through filter days. 🌿✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically summarizes the main change: suppressing version-only feeds to show the empty state.
Description check ✅ Passed The description includes a comprehensive summary, explains the rationale, lists test coverage with pass status, and identifies remaining manual verification steps.
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.

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

✨ 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 and usage tips.

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

mergify Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • Entered queue2026-06-11 03:52 UTC · Rule: Automatic strict merge
  • Checks skipped · PR is already up-to-date
  • Merged2026-06-11 03:52 UTC · at b0a559bf0ece06d08545f389b336ad02450c6a69 · squash

This pull request spent 16 seconds in the queue, including 3 seconds running CI.

Required conditions to merge

@mergify mergify Bot merged commit d4605b9 into box:master Jun 11, 2026
10 of 11 checks passed
@mergify mergify Bot removed the queued label Jun 11, 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