Skip to content

feat(activity-feed-v2): wire TaskFormV2 into TaskModalV2 with edit prefill and error handling#4667

Merged
mergify[bot] merged 3 commits into
box:masterfrom
jackiejou:feat/task-modal-v2-wire
Jul 1, 2026
Merged

feat(activity-feed-v2): wire TaskFormV2 into TaskModalV2 with edit prefill and error handling#4667
mergify[bot] merged 3 commits into
box:masterfrom
jackiejou:feat/task-modal-v2-wire

Conversation

@jackiejou

@jackiejou jackiejou commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Wires TaskFormV2 (from PR #4662) into TaskModalV2 (S-1 shell) with edit-mode prefill, footer buttons, error handling, and analytics. This is the last piece before V2 can be wired into ActivityFeedV2 in a follow-up PR.

What lands

  • Modal owns the integration: renders <TaskFormV2> inside <Modal.Body>, footer buttons inside <Modal.Footer>, error notice above the form
  • Discriminated union for edit mode: mode: 'edit' requires editingTask, editingAssignees, and editTask together. Eliminates the "consumer forgot editTask" silent fallthrough.
  • Edit-mode prefill from editingTask: description, completion rule, due date, assignees
  • Submit handler computes addedAssignees / removedAssignees for the v1 editTask payload shape; create mode calls the existing positional createTask callback
  • Inline error notice with three variants:
    • Forbidden-on-edit (403) — taskType-specific warning copy
    • Group-exceeds-limit — dedicated title + {max} placeholder using TASK_MAX_GROUP_ASSIGNEES
    • Generic — error variant
  • Axios fallback for error shape: reads error.status / error.code AND error.response?.status / error.response?.data?.code
  • Local isSubmitting sets the form's isDisabled, the submit button's loading, and disables Cancel
  • try/catch around createTask / editTask: synchronous throws route to handleError so the modal recovers
  • Invalid due_at guard: unparseable strings fall back to null rather than crashing fromDate
  • Resin telemetry: data-resin-component="taskmodalv2" on Modal.Content; Cancel/Submit buttons carry data-resin-target (reusing v1's APPROVAL_FORM_CANCEL / APPROVAL_FORM_POST constants) and data-target-id. TaskFormV2 form root carries v1's addResinInfo payload plus per-field data-target-id.

Test plan

62/62 tests pass across the task-modal-v2 module (S-1 shell + S-2 mapper + S-3 form + S-4 wiring).

Behavioral coverage on the modal:

  • Open/close via isOpen, close button, Escape, Cancel
  • All 4 (taskType × edit/create) title and submit-label permutations
  • Edit-mode prefill (assignees, message, due date, completion rule)
  • createTask called with the expected positional payload
  • editTask called with the diffed addedAssignees / removedAssignees
  • onSubmitSuccess / onSubmitError invoked appropriately
  • All 3 error notice variants (generic, 403-on-edit for general AND approval, group-exceeds with {max} interpolation)
  • Axios-shaped errors (error.response.status) correctly trigger the same notices as direct-shape errors
  • Sync throw from createTask routes through onSubmitError and re-enables Cancel
  • Invalid due_at falls back to empty date
  • Group selections flow through to createTask with type: 'group'
  • isDisabled cascades to cancel button, form fields, user-selector mock
  • Resin attrs on modal content + buttons
  • Form root carries resin diff counts that update as assignees change

Out of scope

  • Wiring TaskModalV2 into ActivityFeedV2.tsx (S-5)
  • Manual a11y + visual smoke test (S-6)

Follow-ups

  • Switch ActivityFeedV2.tsx to render TaskModalV2 (next PR)
  • Manual a11y + visual smoke test pass

Summary by CodeRabbit

  • New Features

    • Added a full create/edit task modal with mode-specific titles, buttons, and submission behavior.
    • Improved task form instrumentation to expose form state (task identity, editing mode, assignee diffs) for better tracking.
    • Added inline task error/warning notices (including forbidden and group-limit scenarios).
  • Bug Fixes

    • Improved due-date handling with safer parsing and graceful fallback.
    • Enhanced submit/cancel behavior during updates and surfaced clearer messaging on failures.
  • Style

    • Refreshed modal layout to use cleaner flex spacing and consistent sizing.

@jackiejou
jackiejou requested review from a team as code owners June 30, 2026 20:21
@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

TaskModalV2 now supports create and edit task flows with submission callbacks, error notices, and task-form wiring. TaskFormV2 adds task tracking attributes. Messages, styling, and tests were updated to match the new modal behavior.

Changes

Task modal create/edit feature

Layer / File(s) Summary
Shared task modal types and assignee mapping
src/elements/content-sidebar/activity-feed-v2/task-modal-v2/types.ts, utils/contactMapping.ts, utils/__tests__/contactMapping.test.ts
Adds widened assignee/task callback types and updates assignee/contact mapping utilities and tests to use the shared task-modal types.
Modal props and submission helpers
TaskModalV2.tsx
Adds the create/edit prop contract and helpers for modal titles, assignee conversion/diffing, and due-date parsing.
Modal submission and error rendering
TaskModalV2.tsx, TaskErrorNotice.tsx, messages.ts, TaskModalV2.scss
Implements create/edit submission flow, error notice branching, footer labels, notice messages, and modal body layout adjustments.
Form tracking attributes
TaskFormV2.tsx
Adds taskId, computes resin tracking attributes, and sets target IDs on key form controls.
Modal, form, and utility tests
__tests__/TaskModalV2.test.tsx, __tests__/TaskFormV2.test.tsx, __tests__/TaskErrorNotice.test.tsx
Covers create/edit rendering, submissions, error states, resin attributes, and assignee type updates in tests.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant TaskFormV2
  participant TaskModalV2
  participant TaskAPI

  User->>TaskFormV2: submit values
  TaskFormV2->>TaskModalV2: handle submit
  TaskModalV2->>TaskModalV2: diff assignees and parse due date
  alt create mode
    TaskModalV2->>TaskAPI: createTask(payload)
  else edit mode
    TaskModalV2->>TaskAPI: editTask(payload)
  end
  TaskAPI-->>TaskModalV2: success or error
  TaskModalV2-->>User: onSubmitSuccess/onSubmitError and notice rendering
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • box/box-ui-elements#4656: This PR continues the TaskModalV2 work by replacing the scaffolded modal with full create/edit behavior and matching tests/messages/styles.
  • box/box-ui-elements#4657: Both PRs touch the task-modal assignee typing and contact-mapping utilities, including the RuntimeAssignee to TaskAssignee/AssigneeTarget shift.

Suggested labels

ready-to-merge

Suggested reviewers

  • zhirongwang
  • ahorowitz123
  • jmcbgaston

A rabbit tapped the modal bell,
With tasky hops and tales to tell. 🐇
Create, then edit, with due dates bright,
Resin tags shimmer in the light.
Errors now hop in neat, kind lines—
A carrot-sharp PR, neatly aligned.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: wiring TaskFormV2 into TaskModalV2 with edit-mode prefill and error handling.
Description check ✅ Passed The description is detailed and covers summary, behavior changes, test plan, out of scope, and follow-ups, with no obvious gaps.
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.

@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.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/elements/content-sidebar/activity-feed-v2/task-modal-v2/TaskFormV2.tsx (1)

204-216: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Pass the target id through inputProps, not dataTargetId. DatePicker doesn’t define or forward a dataTargetId prop; only inputProps reaches the underlying <input>, so this selector will be dropped here. Use inputProps={{ 'data-target-id': 'TaskFormV2-dueDateInput' }} instead.

🤖 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/task-modal-v2/TaskFormV2.tsx`
around lines 204 - 216, The TaskFormV2 DatePicker is using a non-forwarded
dataTargetId prop, so the selector is being dropped. Update the DatePicker usage
in TaskFormV2 to pass the target marker via inputProps instead, and keep the
identifier on the underlying input using the same TaskFormV2-dueDateInput value.
This change should be made where the DatePicker is rendered so the selector
reaches the actual input element.
🧹 Nitpick comments (5)
src/elements/content-sidebar/activity-feed-v2/task-modal-v2/TaskFormV2.tsx (2)

113-131: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Duplicate assignee-diff logic with inconsistent group counting.

This independently re-implements the added/removed assignee diff that TaskModalV2's diffAssignees util already computes for the actual submit payload. Maintaining two separate implementations risks drift, and they already differ: numassigneesadded/numgroupsadded split by type, but data-resin-numassigneesremoved is removed.length (untyped), with no numgroupsremoved counterpart — removed groups get folded into the "assignees" removed count, which is inconsistent with how additions are tracked.

Consider extracting a shared diff helper (or exporting diffAssignees from wherever it's defined) and reusing it here, then deriving both add/remove counts split by type for symmetry.

♻️ Example fix for removed-count symmetry
-        const userCount = added.filter(u => u.type === 'user').length;
-        const groupCount = added.filter(u => u.type === 'group').length;
+        const userCount = added.filter(u => u.type === 'user').length;
+        const groupCount = added.filter(u => u.type === 'group').length;
+        const removedUserCount = removed.filter(a => a.target.type === 'user').length;
+        const removedGroupCount = removed.filter(a => a.target.type === 'group').length;
         const submitDate = dueDate ? toSubmitDate(dueDate, originalDueDateTime).getTime() : undefined;
         return {
             'data-resin-assigneesadded': added.map(u => u.value).join(','),
             'data-resin-assigneesremoved': removed.map(a => a.target.id).join(','),
             'data-resin-duedate': submitDate,
             'data-resin-numassigneesadded': userCount,
-            'data-resin-numassigneesremoved': removed.length,
+            'data-resin-numassigneesremoved': removedUserCount,
             'data-resin-numgroupsadded': groupCount,
+            'data-resin-numgroupsremoved': removedGroupCount,
             'data-resin-taskid': taskId,
         };
🤖 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/task-modal-v2/TaskFormV2.tsx`
around lines 113 - 131, The assignee diff logic in TaskFormV2 is duplicated and
inconsistent with TaskModalV2’s diffAssignees behavior. Reuse the shared diff
helper used for submit payloads instead of recalculating added/removed users
here, and make the Resin metrics derived from that same result. Ensure the
counts in resinTags are symmetric for both additions and removals by type,
rather than using removed.length for all removals while splitting only added
counts.

78-78: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

taskId defaults to empty string rather than being omitted.

In create mode TaskModalV2 passes taskId={editingTask?.id} which is undefined; the default '' then yields data-resin-taskid="" rather than omitting the attribute. Minor analytics noise, low impact.

Also applies to: 128-128

🤖 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/task-modal-v2/TaskFormV2.tsx`
at line 78, The TaskFormV2 default for taskId is forcing an empty string, which
causes TaskModalV2 to emit a blank data-resin-taskid attribute in create mode
instead of omitting it. Update TaskFormV2 (and the related TaskModalV2 usage) so
taskId stays undefined when not provided, and only include the resin/task ID
attribute when a real id exists.
src/elements/content-sidebar/activity-feed-v2/task-modal-v2/messages.ts (1)

114-119: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Awkward phrasing in groupExceedsLimitWarningMessage.

The default message text mixes "can not" / "cannot" and reads as a run-on sentence: "One or more groups can not receive this task as a group size cannot exceed the limit of {max} assignees per group." Consider tightening the copy for clarity and consistency.

✏️ Proposed copy fix
     groupExceedsLimitWarningMessage: {
         id: 'be.taskModalV2.groupExceedsLimitWarningMessage',
         defaultMessage:
-            'One or more groups can not receive this task as a group size cannot exceed the limit of {max} assignees per group.',
+            'One or more groups were not assigned this task because group size cannot exceed the limit of {max} assignees per group.',
         description: 'Body of the warning notice when a group assignee exceeds the per-group maximum',
     },
🤖 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/task-modal-v2/messages.ts`
around lines 114 - 119, The copy in groupExceedsLimitWarningMessage is awkward
and inconsistent (“can not” vs “cannot”) and should be tightened for clarity;
update the defaultMessage in the messages definition to a shorter, grammatically
clean warning that says the group cannot receive the task because the group size
exceeds the {max} assignees limit, while keeping the same intent and
placeholder.
src/elements/content-sidebar/activity-feed-v2/task-modal-v2/__tests__/TaskModalV2.test.tsx (2)

16-47: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Duplicated test mocks/helpers across two test files.

The UserSelectorMockProps type, the @box/user-selector jest.mock factory, and buildUserAssignee are copied verbatim from TaskFormV2.test.tsx. Consider extracting these into a shared test-utils module imported by both suites to avoid drift if one copy is updated and the other isn't.

Also applies to: 62-69

🤖 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/task-modal-v2/__tests__/TaskModalV2.test.tsx`
around lines 16 - 47, The test suite has duplicated user selector mock setup,
including the UserSelectorMockProps type and the `@box/user-selector` jest.mock
factory, which is copied from TaskFormV2.test.tsx and can drift over time.
Extract the shared mock/helpers into a common test-utils module and import them
into TaskModalV2.test.tsx and TaskFormV2.test.tsx, keeping buildUserAssignee and
the lastUserSelectorProps wiring centralized so both suites use the same
implementation.

308-312: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Magic number "250" hardcoded in assertion.

The expected text hardcodes 250 instead of referencing TASK_MAX_GROUP_ASSIGNEES, which is the value actually interpolated into the message. If the constant changes, this assertion silently goes stale rather than failing meaningfully against the same source of truth.

🤖 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/task-modal-v2/__tests__/TaskModalV2.test.tsx`
around lines 308 - 312, The warning notice test in TaskModalV2 should not
hardcode the assignee limit in the expected string. Update the assertion in the
group-exceeds-limit case to use TASK_MAX_GROUP_ASSIGNEES, matching the value
interpolated by TaskModalV2 and keeping the test aligned with the same source of
truth. Locate the failing expectation in the TaskModalV2.test.tsx suite and
replace the literal limit with the shared constant.
🤖 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.

Inline comments:
In
`@src/elements/content-sidebar/activity-feed-v2/task-modal-v2/__tests__/TaskModalV2.test.tsx`:
- Around line 218-220: The test is invoking the state-updating callback from
UserSelectorProps directly, which should be wrapped in act() to keep React
updates deterministic and avoid warnings. Update the TaskModalV2 test to import
act from react, then wrap each
lastUserSelectorProps.onSelectedUsersChange?.(...) call in act() at every listed
call site, following the same pattern used in TaskFormV2.test.tsx; use the
onSelectedUsersChange callback name to locate all occurrences.

In `@src/elements/content-sidebar/activity-feed-v2/task-modal-v2/TaskModalV2.tsx`:
- Around line 258-264: The InlineNotice in TaskModalV2 currently always uses
messages.createTaskErrorTitle, so edit-mode failures still show create-task
copy. Update the title selection in the TaskModalV2 error rendering path to
mirror the existing isEditMode body logic, using an edit-specific title when
isEditMode is true and the create title otherwise. Keep the change localized to
the inline notice that renders the task error message.
- Around line 282-294: TaskModalV2 is passing new initial* props into
TaskFormV2, but TaskFormV2 only uses them for its initial useState values, so
changing editingTask can leave stale form state attached to the new task. Update
the TaskModalV2 render of TaskFormV2 so the form resets whenever the edited task
changes, either by forcing a remount with a stable key tied to
editingTask/taskId or by ensuring TaskFormV2 syncs its internal state when those
props change. Keep the fix centered around TaskModalV2, TaskFormV2, and
editingTask so the form state always matches the currently edited task.

---

Outside diff comments:
In `@src/elements/content-sidebar/activity-feed-v2/task-modal-v2/TaskFormV2.tsx`:
- Around line 204-216: The TaskFormV2 DatePicker is using a non-forwarded
dataTargetId prop, so the selector is being dropped. Update the DatePicker usage
in TaskFormV2 to pass the target marker via inputProps instead, and keep the
identifier on the underlying input using the same TaskFormV2-dueDateInput value.
This change should be made where the DatePicker is rendered so the selector
reaches the actual input element.

---

Nitpick comments:
In
`@src/elements/content-sidebar/activity-feed-v2/task-modal-v2/__tests__/TaskModalV2.test.tsx`:
- Around line 16-47: The test suite has duplicated user selector mock setup,
including the UserSelectorMockProps type and the `@box/user-selector` jest.mock
factory, which is copied from TaskFormV2.test.tsx and can drift over time.
Extract the shared mock/helpers into a common test-utils module and import them
into TaskModalV2.test.tsx and TaskFormV2.test.tsx, keeping buildUserAssignee and
the lastUserSelectorProps wiring centralized so both suites use the same
implementation.
- Around line 308-312: The warning notice test in TaskModalV2 should not
hardcode the assignee limit in the expected string. Update the assertion in the
group-exceeds-limit case to use TASK_MAX_GROUP_ASSIGNEES, matching the value
interpolated by TaskModalV2 and keeping the test aligned with the same source of
truth. Locate the failing expectation in the TaskModalV2.test.tsx suite and
replace the literal limit with the shared constant.

In `@src/elements/content-sidebar/activity-feed-v2/task-modal-v2/messages.ts`:
- Around line 114-119: The copy in groupExceedsLimitWarningMessage is awkward
and inconsistent (“can not” vs “cannot”) and should be tightened for clarity;
update the defaultMessage in the messages definition to a shorter, grammatically
clean warning that says the group cannot receive the task because the group size
exceeds the {max} assignees limit, while keeping the same intent and
placeholder.

In `@src/elements/content-sidebar/activity-feed-v2/task-modal-v2/TaskFormV2.tsx`:
- Around line 113-131: The assignee diff logic in TaskFormV2 is duplicated and
inconsistent with TaskModalV2’s diffAssignees behavior. Reuse the shared diff
helper used for submit payloads instead of recalculating added/removed users
here, and make the Resin metrics derived from that same result. Ensure the
counts in resinTags are symmetric for both additions and removals by type,
rather than using removed.length for all removals while splitting only added
counts.
- Line 78: The TaskFormV2 default for taskId is forcing an empty string, which
causes TaskModalV2 to emit a blank data-resin-taskid attribute in create mode
instead of omitting it. Update TaskFormV2 (and the related TaskModalV2 usage) so
taskId stays undefined when not provided, and only include the resin/task ID
attribute when a real id exists.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9881b5ff-a45a-468c-8f1d-7c432ddea16d

📥 Commits

Reviewing files that changed from the base of the PR and between 191e103 and aedfa43.

⛔ Files ignored due to path filters (1)
  • i18n/en-US.properties is excluded by !i18n/**
📒 Files selected for processing (6)
  • src/elements/content-sidebar/activity-feed-v2/task-modal-v2/TaskFormV2.tsx
  • src/elements/content-sidebar/activity-feed-v2/task-modal-v2/TaskModalV2.scss
  • src/elements/content-sidebar/activity-feed-v2/task-modal-v2/TaskModalV2.tsx
  • src/elements/content-sidebar/activity-feed-v2/task-modal-v2/__tests__/TaskFormV2.test.tsx
  • src/elements/content-sidebar/activity-feed-v2/task-modal-v2/__tests__/TaskModalV2.test.tsx
  • src/elements/content-sidebar/activity-feed-v2/task-modal-v2/messages.ts

Comment thread src/elements/content-sidebar/activity-feed-v2/task-modal-v2/TaskModalV2.tsx Outdated
- Move error notice into its own component plus tests
- Add types.ts; rename RuntimeAssignee to TaskAssignee
- Key TaskFormV2 on editing task id to reset state on switch
- Wrap onSelectedUsersChange in act() in TaskModalV2 tests
- Rename createTaskErrorTitle to taskErrorTitle for clarity

@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 (2)
src/elements/content-sidebar/activity-feed-v2/task-modal-v2/__tests__/TaskModalV2.test.tsx (1)

57-64: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

buildUserAssignee duplicated across test files.

This helper is identical to the one in TaskFormV2.test.tsx (lines 57-64 there). Consider extracting a shared test-fixtures util for the task-modal-v2 test suite to avoid maintaining two copies in lockstep.

🤖 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/task-modal-v2/__tests__/TaskModalV2.test.tsx`
around lines 57 - 64, The helper buildUserAssignee is duplicated in this test
file and TaskFormV2.test.tsx, so extract the shared TaskAssignee fixture into a
common task-modal-v2 test utility and update both suites to import it. Keep the
existing shape and defaults used by buildUserAssignee, and replace the local
definition with the shared helper so the two test files stay in sync.
src/elements/content-sidebar/activity-feed-v2/task-modal-v2/TaskErrorNotice.tsx (1)

19-34: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Minor duplication between getErrorStatus and getErrorCode.

Both helpers follow the identical "check direct field, else fall back to response.<field>" shape. Could be collapsed into a single generic helper, but the duplication is small and localized.

🤖 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/task-modal-v2/TaskErrorNotice.tsx`
around lines 19 - 34, The `getErrorStatus` and `getErrorCode` helpers in
`TaskErrorNotice` duplicate the same direct-field-then-`response` fallback
logic; consider extracting that pattern into one small generic helper and reuse
it for both status and code lookups. Keep the existing behavior intact while
reducing the repeated shape in these two functions.
🤖 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/task-modal-v2/__tests__/TaskModalV2.test.tsx`:
- Around line 57-64: The helper buildUserAssignee is duplicated in this test
file and TaskFormV2.test.tsx, so extract the shared TaskAssignee fixture into a
common task-modal-v2 test utility and update both suites to import it. Keep the
existing shape and defaults used by buildUserAssignee, and replace the local
definition with the shared helper so the two test files stay in sync.

In
`@src/elements/content-sidebar/activity-feed-v2/task-modal-v2/TaskErrorNotice.tsx`:
- Around line 19-34: The `getErrorStatus` and `getErrorCode` helpers in
`TaskErrorNotice` duplicate the same direct-field-then-`response` fallback
logic; consider extracting that pattern into one small generic helper and reuse
it for both status and code lookups. Keep the existing behavior intact while
reducing the repeated shape in these two functions.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 695984a1-10fd-40ef-9f34-e2fc671eef26

📥 Commits

Reviewing files that changed from the base of the PR and between aedfa43 and ad2e1fe.

⛔ Files ignored due to path filters (1)
  • i18n/en-US.properties is excluded by !i18n/**
📒 Files selected for processing (11)
  • src/elements/content-sidebar/activity-feed-v2/task-modal-v2/TaskErrorNotice.tsx
  • src/elements/content-sidebar/activity-feed-v2/task-modal-v2/TaskFormV2.tsx
  • src/elements/content-sidebar/activity-feed-v2/task-modal-v2/TaskModalV2.scss
  • src/elements/content-sidebar/activity-feed-v2/task-modal-v2/TaskModalV2.tsx
  • src/elements/content-sidebar/activity-feed-v2/task-modal-v2/__tests__/TaskErrorNotice.test.tsx
  • src/elements/content-sidebar/activity-feed-v2/task-modal-v2/__tests__/TaskFormV2.test.tsx
  • src/elements/content-sidebar/activity-feed-v2/task-modal-v2/__tests__/TaskModalV2.test.tsx
  • src/elements/content-sidebar/activity-feed-v2/task-modal-v2/messages.ts
  • src/elements/content-sidebar/activity-feed-v2/task-modal-v2/types.ts
  • src/elements/content-sidebar/activity-feed-v2/task-modal-v2/utils/__tests__/contactMapping.test.ts
  • src/elements/content-sidebar/activity-feed-v2/task-modal-v2/utils/contactMapping.ts
✅ Files skipped from review due to trivial changes (1)
  • src/elements/content-sidebar/activity-feed-v2/task-modal-v2/utils/tests/contactMapping.test.ts
🚧 Files skipped from review as they are similar to previous changes (5)
  • src/elements/content-sidebar/activity-feed-v2/task-modal-v2/TaskModalV2.scss
  • src/elements/content-sidebar/activity-feed-v2/task-modal-v2/tests/TaskFormV2.test.tsx
  • src/elements/content-sidebar/activity-feed-v2/task-modal-v2/messages.ts
  • src/elements/content-sidebar/activity-feed-v2/task-modal-v2/TaskFormV2.tsx
  • src/elements/content-sidebar/activity-feed-v2/task-modal-v2/TaskModalV2.tsx

@mergify

mergify Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • Entered queue2026-07-01 17:06 UTC · Rule: Automatic strict merge · triggered by rule Automatic merge queue
  • Checks skipped · PR is already up-to-date
  • Merged2026-07-01 17:06 UTC · at 9610a5c0e6161551f144506b28b860dc3b823479 · squash

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

Required conditions to merge

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.

4 participants