Skip to content

feat(activity-feed-v2): scaffold accessible task modal v2 shell#4656

Merged
mergify[bot] merged 1 commit into
box:masterfrom
jackiejou:feat/task-modal-v2-shell
Jun 26, 2026
Merged

feat(activity-feed-v2): scaffold accessible task modal v2 shell#4656
mergify[bot] merged 1 commit into
box:masterfrom
jackiejou:feat/task-modal-v2-shell

Conversation

@jackiejou

@jackiejou jackiejou commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Scaffolds a new V2 task-creation/edit modal under src/elements/content-sidebar/task-modal-v2/. This is the first PR in a multi-PR effort to migrate the task modal off PillSelectorDropdown (which has known keyboard-focus and accessible-name gaps) and onto @box/blueprint-web Modal + @box/user-selector.

Scope of this PR is intentionally narrow: it ships only the modal shell and its tests. The shell renders a placeholder body. Form content, the user-selector swap, and the ActivityFeedV2 integration land in follow-up PRs so each change stays small and reviewable.

Changes

  • New folder src/elements/content-sidebar/task-modal-v2/:
    • TaskModalV2.tsx — functional component, built on @box/blueprint-web Modal (Modal.Content + Modal.Header + Modal.Body + Modal.Close).
    • messages.ts — V2-local i18n message keys.
    • index.ts — default export plus exported TaskModalV2Props type.
    • TaskModalV2.scss — minimal layout hook; Blueprint Modal owns chrome.
    • __tests__/TaskModalV2.test.tsx — RTL coverage of the shell.
  • V1 (TaskModal.js, activity-feed/task-form/, AddTaskButton.js, ActivitySidebar.js) is not touched. No call sites consume TaskModalV2 yet.

Design notes

  • Pure Blueprint Modal. The shell uses Radix's controlled open/onOpenChange API (via Blueprint's Modal wrapper) — no appElement plumbing, no react-modal wrapper. Existing dialogs in the repo (CreateFolderDialog, RenameDialog, etc.) wrap Blueprint chrome inside react-modal; this component skips that layer because Blueprint Modal is fully self-contained.
  • Class name is bcs-NewTaskModal rather than bcs-TaskModalV2 because stylelint's selector-class-pattern regex disallows digits. Matches the precedent set by bcs-NewActivityFeed.
  • V2 owns its strings. The message file lives next to the component (be.taskModalV2.*) rather than threading through the existing v1 keys in ../messages.js.

Test plan

  • yarn test --testPathPattern="task-modal-v2" — 8/8 pass
  • npx eslint --max-warnings=0 src/elements/content-sidebar/task-modal-v2/ — clean
  • npx stylelint "src/elements/content-sidebar/task-modal-v2/**/*.scss" — clean
  • npx tsc --noEmit — clean
  • Manual smoke test in Storybook (wired temporarily into a local ContentSidebar story to verify the modal opens, closes via Escape and close-button, and renders the right localized title for all (taskType, editMode) permutations; the temporary wiring is NOT part of this PR)

Follow-ups

  • Contact-shape mapper utility (UserMini | GroupMini <-> UserContactType <-> TaskCollabAssignee).
  • TaskFormV2 built on UserSelectorContainer and Blueprint form primitives (TextArea, Checkbox, DatePicker, Button).
  • Wire TaskFormV2 into TaskModalV2 including edit-mode prefill and submit handling.
  • Switch ActivityFeedV2.tsx to render TaskModalV2.
  • Manual a11y and visual smoke test pass.

Summary by CodeRabbit

  • New Features
    • Added a new task modal for creating and editing tasks, with title text that adapts to task type and edit mode.
    • Included localized UI text for the modal close control and improved modal accessibility.
  • Bug Fixes
    • Modal now reliably closes via the close button or the Escape key, and only renders when intended.
  • Tests
    • Added Jest/React Testing Library coverage for visibility, dynamic headings, and close interactions.
  • Style
    • Updated modal layout spacing to better structure modal content vertically.

@jackiejou jackiejou requested review from a team as code owners June 26, 2026 19:15
@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@jackiejou, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 3 minutes and 24 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d4e5775a-f5aa-406f-9353-4ffe7519721d

📥 Commits

Reviewing files that changed from the base of the PR and between 14326ca and 956db62.

⛔ Files ignored due to path filters (1)
  • i18n/en-US.properties is excluded by !i18n/**
📒 Files selected for processing (5)
  • 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__/TaskModalV2.test.tsx
  • src/elements/content-sidebar/activity-feed-v2/task-modal-v2/index.ts
  • src/elements/content-sidebar/activity-feed-v2/task-modal-v2/messages.ts

Walkthrough

Adds TaskModalV2 with localized create/edit titles, a close action, new modal styling, a barrel export, and tests covering visibility, title selection, and closing behavior.

Changes

Task modal v2

Layer / File(s) Summary
Messages and exports
src/elements/content-sidebar/activity-feed-v2/task-modal-v2/messages.ts, src/elements/content-sidebar/activity-feed-v2/task-modal-v2/index.ts
Adds modal title and close-label messages, and re-exports TaskModalV2 plus TaskModalV2Props.
Modal props and rendering
src/elements/content-sidebar/activity-feed-v2/task-modal-v2/TaskModalV2.tsx, src/elements/content-sidebar/activity-feed-v2/task-modal-v2/TaskModalV2.scss
Defines the modal props, selects the title from task type and edit mode, renders the Blueprint Modal, handles close events, and adds the column flex layout class.
Component tests
src/elements/content-sidebar/activity-feed-v2/task-modal-v2/__tests__/TaskModalV2.test.tsx
Verifies closed and open rendering, title selection, and closing via the button and Escape key.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • ahorowitz123
  • kduncanhsu
  • tjuanitas

Poem

(_/)
( •_•) A modal hopped in, tidy and bright,
/ >🍃 With titles that change just right.
Close and Escape, soft as a drum,
My bunny approves: “Task modal v2, here I come!”

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is thorough, but it does not follow the repository template's merge-queue instruction block. Include the template's ready-to-merge guidance block, or update the repo template if a project summary is intended instead.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the new accessible TaskModalV2 shell.
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.

🧹 Nitpick comments (2)
src/elements/content-sidebar/task-modal-v2/__tests__/TaskModalV2.test.tsx (2)

29-43: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Source expected labels from messages.ts instead of hard-coded English.

These tests currently fail on copy-only localization updates even when the title-selection and close-button behavior are still correct. Pull the expected strings from the co-located message descriptors so the suite stays focused on behavior.

Suggested direction
+import messages from '../messages';
+
 test.each([
-    [TASK_TYPE_APPROVAL, TASK_EDIT_MODE_CREATE, 'Create Approval Task'],
-    [TASK_TYPE_APPROVAL, TASK_EDIT_MODE_EDIT, 'Modify Approval Task'],
-    [TASK_TYPE_GENERAL, TASK_EDIT_MODE_CREATE, 'Create General Task'],
-    [TASK_TYPE_GENERAL, TASK_EDIT_MODE_EDIT, 'Modify General Task'],
+    [TASK_TYPE_APPROVAL, TASK_EDIT_MODE_CREATE, messages.createApprovalTaskTitle.defaultMessage],
+    [TASK_TYPE_APPROVAL, TASK_EDIT_MODE_EDIT, messages.editApprovalTaskTitle.defaultMessage],
+    [TASK_TYPE_GENERAL, TASK_EDIT_MODE_CREATE, messages.createGeneralTaskTitle.defaultMessage],
+    [TASK_TYPE_GENERAL, TASK_EDIT_MODE_EDIT, messages.editGeneralTaskTitle.defaultMessage],
 ])('renders the correct title for taskType=%s editMode=%s', (taskType, editMode, expectedTitle) => {
🤖 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/task-modal-v2/__tests__/TaskModalV2.test.tsx`
around lines 29 - 43, The TaskModalV2 tests are asserting hard-coded English
titles and should instead use the localized labels from the co-located message
descriptors in messages.ts. Update the expectations in TaskModalV2.test.tsx to
read the expected heading text from the same message definitions used by the
component, so the tests continue to verify title selection and close-button
behavior without breaking on copy-only localization changes.

23-27: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Avoid pinning the shell test to placeholder body copy.

This assertion will need to be rewritten in the very next PR that adds the real form, without increasing confidence in the modal shell itself. Prefer checking stable shell behavior here and let the follow-up PR add form-specific assertions.

🤖 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/task-modal-v2/__tests__/TaskModalV2.test.tsx`
around lines 23 - 27, The test in TaskModalV2.test.tsx is asserting placeholder
body copy that will disappear once the real form is added. Update the shell test
around renderModal() and task-modal-v2 to verify stable modal shell behavior
instead, such as visibility/open state or structural elements, and remove the
dependency on the “Form goes here” text. Keep form-specific assertions for the
follow-up test added with the real form.
🤖 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/task-modal-v2/__tests__/TaskModalV2.test.tsx`:
- Around line 29-43: The TaskModalV2 tests are asserting hard-coded English
titles and should instead use the localized labels from the co-located message
descriptors in messages.ts. Update the expectations in TaskModalV2.test.tsx to
read the expected heading text from the same message definitions used by the
component, so the tests continue to verify title selection and close-button
behavior without breaking on copy-only localization changes.
- Around line 23-27: The test in TaskModalV2.test.tsx is asserting placeholder
body copy that will disappear once the real form is added. Update the shell test
around renderModal() and task-modal-v2 to verify stable modal shell behavior
instead, such as visibility/open state or structural elements, and remove the
dependency on the “Form goes here” text. Keep form-specific assertions for the
follow-up test added with the real form.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0a6134df-1a48-4824-8a73-6d35d41fb491

📥 Commits

Reviewing files that changed from the base of the PR and between 51720a1 and 8c38f56.

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

@jackiejou jackiejou force-pushed the feat/task-modal-v2-shell branch 2 times, most recently from 14326ca to b35a841 Compare June 26, 2026 19:58
@jackiejou jackiejou force-pushed the feat/task-modal-v2-shell branch from b35a841 to 956db62 Compare June 26, 2026 20:11
@mergify

mergify Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Queued — the merge queue status continues in this comment ↓.

@mergify mergify Bot added the queued label Jun 26, 2026
@mergify

mergify Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • Entered queue2026-06-26 21:24 UTC · Rule: Automatic strict merge · triggered by rule Automatic merge queue
  • Checks skipped · PR is already up-to-date
  • Merged2026-06-26 21:24 UTC · at 956db62e2c62fc224bc4137af79e1d3d82217386 · squash

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

Required conditions to merge

@mergify mergify Bot merged commit 56a423e into box:master Jun 26, 2026
9 of 10 checks passed
@mergify mergify Bot removed the queued label Jun 26, 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.

4 participants