Skip to content

fix(activity-feed-v2): suppress invite popover after mention selection#4703

Open
jackiejou wants to merge 1 commit into
box:masterfrom
jackiejou:fix/activity-feed-v2-mention-invite-popover
Open

fix(activity-feed-v2): suppress invite popover after mention selection#4703
jackiejou wants to merge 1 commit into
box:masterfrom
jackiejou:fix/activity-feed-v2-mention-invite-popover

Conversation

@jackiejou

@jackiejou jackiejou commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fixes a bug in the activity feed v2 comment editor where selecting a user from the @-mention dropdown caused a popover to immediately reappear showing only the selected user.
  • The popover was the invite-non-collaborator flow from @box/threaded-annotations: useMentionUserSelection calls fetchCollaboratorState from the mention context after each selection, and when the callback is absent every user resolves as a non-collaborator, opening the collaboration popover anchored to the inserted mention.
  • Mention contacts in this surface are sourced from the file collaborators API, so every selectable user is already a collaborator. ActivityFeedV2 now provides fetchCollaboratorState: async () => true in its mention context, which suppresses the invite popover.

Test Plan

  • yarn test --watchAll=false --testPathPattern="content-sidebar/activity-feed-v2/__tests__/ActivityFeedV2" (79 tests pass)
  • New unit test asserts the mention context passed to ActivityFeed.Root resolves fetchCollaboratorState to true for any user
  • Manual check: type @ in a new comment, select a user, verify the mention is inserted and no popover reopens

Summary by CodeRabbit

  • Bug Fixes

    • Updated mention behavior so users are treated as existing collaborators, preventing the invite popover from appearing.
    • Restricted mentions to file collaborators for more consistent activity feed behavior.
  • Tests

    • Added coverage to verify collaborator state and invite popover behavior.

@jackiejou
jackiejou requested review from a team as code owners July 20, 2026 23:53
@coderabbitai

coderabbitai Bot commented Jul 20, 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: 61f5cf9c-4a9a-432f-8ec4-ae01fcfb86f7

📥 Commits

Reviewing files that changed from the base of the PR and between 0236917 and 3f7c504.

📒 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 reports all mentioned users as collaborators through its mention context. Tests capture ActivityFeed.Root props and verify that the collaborator-state function resolves to true.

Changes

Collaborator Mention State

Layer / File(s) Summary
Mention context collaborator state
src/elements/content-sidebar/activity-feed-v2/ActivityFeedV2.tsx
Adds fetchCollaboratorState to the mention context, resolving to true.
Mention context test coverage
src/elements/content-sidebar/activity-feed-v2/__tests__/ActivityFeedV2.test.tsx
Captures and resets ActivityFeed.Root props, then verifies the collaborator-state function result.

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

Suggested labels: ready-to-merge

Suggested reviewers: kduncanhsu, ahorowitz123

Poem

I’m a rabbit with mentions to share,
Every collaborator’s already there.
The popover stays tucked out of sight,
While tests check the state just right.
Hop, hop—context wired bright!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: suppressing the invite popover after mention selection in activity-feed-v2.
Description check ✅ Passed The description includes a clear summary and test plan, and it satisfies the repository's minimal template requirements.
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.

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.

1 participant