Skip to content

fix(activity-feed-v2): load full assignee list when expanding task assignees#4721

Open
zhirongwang wants to merge 2 commits into
box:masterfrom
zhirongwang:fix/activity-feed-v2-load-all-assignees
Open

fix(activity-feed-v2): load full assignee list when expanding task assignees#4721
zhirongwang wants to merge 2 commits into
box:masterfrom
zhirongwang:fix/activity-feed-v2-load-all-assignees

Conversation

@zhirongwang

@zhirongwang zhirongwang commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Tasks with more than 20 assignees only ever displayed the first page returned by the file activities endpoint: the assignee list's "Show more" button expanded the already-loaded entries but never fetched the rest, so the list appeared stuck at 20.
  • transformTaskToProps already set hasNextPage from assigned_to.next_marker, but no consumer supplied the onLoadAllAssignee callback that AssigneeList (from @box/activity-feed) needs to fetch the remaining assignees.
  • Wire onLoadAllAssignee through ActivityFeedV2FeedItemRowActivityFeed.List.Task, reusing the existing getTaskCollaborators fetch (/undoc/tasks/{id}/task_collaborators?role=ASSIGNEE&limit=1000) that the task edit modal already uses. This matches the legacy task card's expand behavior (activity-feed/task-new/Task.js).
  • Extract the assignee mapping into transformTaskAssignees so the initial transform and the load-all path share the same logic.

Test Plan

  • Unit tests added: FeedItemRow passes the original task to onTaskLoadAllAssignees and omits onLoadAllAssignee when no loader is provided; ActivityFeedV2 fetches via getTaskCollaborators and returns transformed assignees, and omits the loader when the prop is absent (all 237 tests in the three touched suites pass)
  • tsc and eslint clean
  • Verified in Storybook (Elements/ContentSidebar with live token) and in a linked webapp: clicking "Show more" on a 26-assignee task fires the task_collaborators?role=ASSIGNEE&limit=1000 request and renders all 26 assignees with loading state; "Show less" collapses back

Made with Cursor

Summary by CodeRabbit

  • New Features

    • Activity feed tasks can now load and display the complete list of assignees when additional assignees are available.
    • Assignee details, including names, avatars, permissions, statuses, and completion times, are displayed consistently.
  • Bug Fixes

    • Improved handling of tasks with incomplete or paginated assignee lists.
  • Tests

    • Added coverage for loading assignees and handling unavailable assignee-loading data.

@coderabbitai

coderabbitai Bot commented Jul 24, 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: 4d398f56-e4a6-4d05-93e4-b3230a0f2eb5

📥 Commits

Reviewing files that changed from the base of the PR and between dce056d and e174db2.

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

Walkthrough

Task assignee transformation is extracted into a reusable helper, then connected from ActivityFeedV2 through FeedItemRow to task entries. Tests verify complete-assignee loading, timestamp conversion, callback forwarding, and omission when unavailable.

Changes

Task assignee loading

Layer / File(s) Summary
Assignee transformation contract
src/elements/content-sidebar/activity-feed-v2/transformers.ts
Exports transformTaskAssignees and reuses it from transformTaskToProps to produce normalized assignee props.
Adapter callback wiring
src/elements/content-sidebar/activity-feed-v2/ActivityFeedV2.tsx, src/elements/content-sidebar/activity-feed-v2/FeedItemRow.tsx
Fetches complete collaborators through getTaskCollaborators, transforms them, and forwards the loader to task entries.
Assignee loading validation
src/elements/content-sidebar/activity-feed-v2/__tests__/*
Verifies partial-task loading flags, transformed collaborator results, callback forwarding, and callback omission.
Estimated code review effort: 3 (Moderate) ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ActivityFeedListTask
  participant FeedItemRow
  participant ActivityFeedV2
  participant getTaskCollaborators
  ActivityFeedListTask->>FeedItemRow: invoke onLoadAllAssignee(task)
  FeedItemRow->>ActivityFeedV2: invoke onTaskLoadAllAssignees(task)
  ActivityFeedV2->>getTaskCollaborators: fetch complete collaborators
  getTaskCollaborators-->>ActivityFeedV2: return collaborator entries
  ActivityFeedV2-->>ActivityFeedListTask: return transformed assignees
Loading

Possibly related PRs

Suggested labels: ready-to-merge

Suggested reviewers: jackiejou, jmcbgaston, jchan106

Poem

I’m a rabbit with assignees to load,
Hopping callbacks down the code road.
Full names appear, timestamps shine,
Transformed neatly, one by one in line.
Tests watch each hop with care—
A fluffy flow beyond compare!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly states the main change: loading the full assignee list when expanding task assignees.
Description check ✅ Passed The description includes a clear summary and test plan, with enough implementation and verification detail.
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.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


zhirongwang seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@zhirongwang zhirongwang self-assigned this Jul 24, 2026
@zhirongwang
zhirongwang marked this pull request as ready for review July 24, 2026 00:31
@zhirongwang
zhirongwang requested review from a team as code owners July 24, 2026 00:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants