fix(activity-feed-v2): restore group results in task assignee search#4677
Conversation
Task assignee search in TaskModalV2 reused the mention path, which requests collaborators with include_groups=false, so groups never appeared and the dropped type field left the completion-rule checkbox disabled. Add a promise-based getApproverAsync (include_groups=true, respect_hidden_collabs=true) and map results through mapCollaboratorToUserContact to preserve each entry type.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
WalkthroughReplaces the synchronous debounced ChangesAsync approver collaborator lookup
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant TaskModalV2
participant ActivityFeedV2
participant ActivitySidebar
participant Collaborators API
TaskModalV2->>ActivityFeedV2: fetchApprovers(query)
ActivityFeedV2->>ActivitySidebar: getApproverAsync(query)
ActivitySidebar->>ActivitySidebar: increment approverGeneration
ActivitySidebar->>Collaborators API: debouncedFetchApproverCollaborators(query)
Collaborators API-->>ActivitySidebar: collaborators.entries
ActivitySidebar-->>ActivityFeedV2: resolve(entries) if generation matches
ActivityFeedV2-->>TaskModalV2: mapped UserContactType[]
Possibly related PRs
Suggested labels: Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 Biome (2.5.1)src/elements/content-sidebar/ActivitySidebar.jsFile contains syntax errors that prevent linting: Line 15: 'import { type x ident }' are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 50: 'import type' are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 58: 'import type' are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 73: 'import type' are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 74: 'import type' are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 75: 'import type' are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 76: 'import type' are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 77: 'import type' are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 78: ' ... [truncated 26553 characters] ... ken. Did you mean 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. Comment |
Merge Queue Status
This pull request spent 12 seconds in the queue, including 2 seconds running CI. Required conditions to merge
|
Problem
Assigning a task from the file Activity Feed / Preview sidebar (Activity Feed V2) no longer returns group results, and the "only one assignee is required" completion-rule checkbox stays disabled even with multiple assignees selected.
The HAR shows the assignee search hitting:
include_groups=falseis the mention-path default, not the approver path.Root cause
TaskModalV2 wired its assignee search (
fetchUsers) to the @mention path (getMentionAsync), which requests collaborators withincludeGroups: false, respectHiddenCollabs: false. The V1 task flow used the approver path withincludeGroups: true, respectHiddenCollabs: true, so groups were returned there.Separately, the mention adapter dropped the
typefield when mapping API entries to user contacts. TaskFormV2 derives its completion-rule checkbox state fromtype === 'group'/type === 'user', so every assignee looked liketype: undefined, leaving the checkbox permanently disabled.Fix
getApproverAsynctoActivitySidebarthat requests collaborators withincludeGroups: true, respectHiddenCollabs: true. It mirrors the existinggetMentionAsyncdebounce + generation-guard pattern (so superseded searches resolve empty and stale responses are dropped), and is cleaned up on unmount.fetchApproverscallback inActivityFeedV2that wrapsgetApproverAsyncand maps results through the existingmapCollaboratorToUserContact, which preserves each entry'stype. Both TaskModalV2 instances now use it. The @mention path is unchanged, so groups stay excluded from comment mentions.approverSelectorContacts/getApproverWithQueryprops fromActivityFeedV2Props.Testing
getApproverAsync(options passed, superseded-call resolves empty, error rejects) and for the V2 wiring (groups preserved withtype, mention path not invoked, empty/missing/rejecting cases).yarn testfor both affected suites: 247 passing.Summary by CodeRabbit
Bug Fixes
New Features