Skip to content

fix(activity-feed-v2): Hide inline task actions for multi-file tasks#4717

Merged
mergify[bot] merged 1 commit into
box:masterfrom
jackiejou:fix-activity-feed-v2-multifile-task-actions
Jul 23, 2026
Merged

fix(activity-feed-v2): Hide inline task actions for multi-file tasks#4717
mergify[bot] merged 1 commit into
box:masterfrom
jackiejou:fix-activity-feed-v2-multifile-task-actions

Conversation

@jackiejou

@jackiejou jackiejou commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Activity Feed V2 rendered inline Approve / Reject / Complete buttons for tasks linked to multiple files. Acting on those buttons sends the task assignment update with a token scoped to the file currently open in Preview, which lacks permissions on the other linked files, so the request fails with an authorization error. The previous activity feed handles this by showing a View details action for multi-file tasks instead of the inline buttons.
  • transformTaskToProps now passes fileCount (from task_links.entries.length) to the TaskItem component, which already hides the inline footer actions and surfaces "View Task Details" when a task spans more than one file.
  • FeedItemRow additionally omits the onApprove / onComplete / onReject callbacks for multi-file tasks so the inline update path cannot be reached.

Test Plan

  • Added transformers tests covering fileCount derived from task_links entries and undefined when task_links is missing
  • Added FeedItemRow test asserting the action callbacks are omitted for a task linked to two files
  • Full activity-feed-v2 suite passes (353 tests) and tsc is clean
  • Manual: open a multi-file task in the V2 activity feed and verify Approve / Reject are replaced by "View Task Details" in the options menu

Summary by CodeRabbit

  • New Features

    • Task activity entries now indicate how many files are associated with a task when applicable.
  • Bug Fixes

    • Inline approve, complete, and reject actions are no longer shown for tasks linked to multiple files, preventing unsupported updates.
    • Existing navigation to view task details remains available for multi-file tasks.
  • Tests

    • Added coverage to verify file counts and multi-file task action behavior.

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Task transformation now exposes the number of linked files. FeedItemRow suppresses inline approve, complete, and reject actions for multi-file tasks, with tests covering both behaviors.

Changes

Task action gating

Layer / File(s) Summary
Expose linked-file count
src/elements/content-sidebar/activity-feed-v2/transformers.ts, src/elements/content-sidebar/activity-feed-v2/__tests__/transformers.test.ts
transformTaskToProps adds fileCount from task_links.entries.length, with coverage for present and missing links.
Suppress multi-file actions
src/elements/content-sidebar/activity-feed-v2/FeedItemRow.tsx, src/elements/content-sidebar/activity-feed-v2/__tests__/FeedItemRow.test.tsx
Multi-file tasks no longer receive inline approve, complete, or reject callbacks, while existing routing remains unchanged.

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

Possibly related PRs

Suggested labels: ready-to-merge

Suggested reviewers: kduncanhsu, jchan106, zhirongwang

Poem

I’m a rabbit with files in a row,
Watching task buttons vanish just so.
Multi-file hops, actions take flight,
Single-file tasks keep things light.
Tests thump softly—green as the night.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the change to hide inline task actions for multi-file tasks.
Description check ✅ Passed The description includes a clear summary and test plan, and it covers the PR's main behavior change.
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.

@jackiejou
jackiejou marked this pull request as ready for review July 22, 2026 20:58
@jackiejou
jackiejou requested review from a team as code owners July 22, 2026 20:58

@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__/transformers.test.ts (1)

372-392: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Add coverage for paginated task links.

The tests only cover a complete collection (next_marker: null). Add a case with one entry and a non-null marker to ensure the chosen multi-file behavior remains safe.

🤖 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__/transformers.test.ts`
around lines 372 - 392, Add a test alongside the existing transformTaskToProps
fileCount cases using a single task_links entry and a non-null next_marker, then
assert the expected safe multi-file behavior for result.fileCount. Keep the
existing complete-collection and missing-task_links coverage unchanged.
🤖 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__/transformers.test.ts`:
- Around line 372-392: Add a test alongside the existing transformTaskToProps
fileCount cases using a single task_links entry and a non-null next_marker, then
assert the expected safe multi-file behavior for result.fileCount. Keep the
existing complete-collection and missing-task_links coverage unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: cf1e3887-bb4a-41be-b776-fe931fd638f5

📥 Commits

Reviewing files that changed from the base of the PR and between e8139fd and 92205c4.

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

@mergify

mergify Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • Entered queue2026-07-23 20:39 UTC · Rule: Automatic strict merge · triggered by rule Automatic merge queue
  • Checks skipped · PR is already up-to-date
  • Merged2026-07-23 20:39 UTC · at 92205c4dc5c0295a1072c5030265ed60fd83af8f · squash

This pull request spent 12 seconds in the queue, including 1 second running CI.

Required conditions to merge

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