Skip to content

fix(content-uploader): localize upload error messages in modernized panel - #4739

Merged
mergify[bot] merged 6 commits into
masterfrom
localize-modernized-upload-errors
Aug 5, 2026
Merged

mergify[bot] merged 6 commits into
masterfrom
localize-modernized-upload-errors

Conversation

@dealwith

@dealwith dealwith commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

The modernized uploads panel surfaced the raw API error message, which is returned in the request locale rather than the user's Box language. Error codes now resolve against the message catalog first, falling back to the API message and then a generic failure.

Extracts the error-code-to-message mapping out of progressCellRenderer into a shared util so the legacy and modernized paths stay in sync, and adds a ModernizedUploadsManager wrapper that can read intl from context (ContentUploader renders above IntlProvider).

Summary by CodeRabbit

  • New Features

    • Added a modernized uploads manager for displaying and managing uploads.
    • Added localized upload error messages with API and generic fallbacks, including upgrade guidance.
    • Improved support for folder uploads, cancellation, retries, sharing, and opening items.
  • Bug Fixes

    • Improved handling of Safari ZIP errors and unknown or missing error codes.
    • Preserved API error messages when localized messaging is unavailable.
  • Tests

    • Expanded coverage for upload management, folder handling, localization, retries, and fallback behavior.

…anel

The modernized uploads panel surfaced the raw API error message, which is
returned in the request locale rather than the user's Box language. Error codes
now resolve against the message catalog first, falling back to the API message
and then a generic failure.

Extracts the error-code-to-message mapping out of progressCellRenderer into a
shared util so the legacy and modernized paths stay in sync, and adds a
ModernizedUploadsManager wrapper that can read intl from context (ContentUploader
renders above IntlProvider).
@dealwith
dealwith requested review from a team as code owners August 3, 2026 20:47
@dealwith dealwith self-assigned this Aug 3, 2026
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

The uploader now renders a typed ModernizedUploadsManager adapter. The adapter maps raw upload items with internationalization support. Shared utilities provide localized upload-error messages for mapped items and progress cells.

Changes

Uploader modernization

Layer / File(s) Summary
Modernized manager integration
src/elements/content-uploader/ContentUploader.tsx, src/elements/content-uploader/ModernizedUploadsManager.tsx, src/elements/content-uploader/__tests__/*
ContentUploader passes raw items to ModernizedUploadsManager. The adapter maps items and preserves manager callbacks, state, folder handling, retries, cancellation, and sharing behavior.
Localized upload-error handling
src/elements/content-uploader/utils/getUploadErrorMessage.ts, src/elements/content-uploader/utils/mapToModernizedUploadItem.ts, src/elements/content-uploader/progressCellRenderer.tsx, src/elements/content-uploader/utils/__tests__/*, src/elements/content-uploader/__tests__/ModernizedUploadsManager.test.tsx
Shared utilities resolve known error codes, Safari ZIP digest errors, localized descriptors, item names, upgrade messages, and fallback API messages. Tests cover mapping, rendering, and fallback behavior.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ContentUploader
  participant ModernizedUploadsManager
  participant mapToModernizedUploadItems
  participant UploadsManagerBP
  ContentUploader->>ModernizedUploadsManager: pass raw upload items and manager props
  ModernizedUploadsManager->>mapToModernizedUploadItems: map items with rootFolderId, ETA, and intl
  ModernizedUploadsManager->>UploadsManagerBP: render mapped items and remaining props
Loading

Possibly related PRs

Suggested reviewers: jpan-box, olehrybak

Poem

A rabbit checks each upload line,
Localized errors now align.
Raw items hop through the manager bright,
Retries and callbacks stay in sight.
The queue completes with messages right.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the primary change: localizing upload error messages in the modernized content uploader.
Description check ✅ Passed The description explains the problem, fallback behavior, shared utility, and ModernizedUploadsManager changes.
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 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch localize-modernized-upload-errors

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.

Comment thread src/elements/content-uploader/ModernizedUploadsManager.tsx Outdated
Comment thread src/elements/content-uploader/utils/__tests__/mapToModernizedUploadItem.test.ts Outdated
Comment thread src/elements/content-uploader/utils/__tests__/mapToModernizedUploadItem.test.ts Outdated
Comment thread src/elements/content-uploader/utils/__tests__/mapToModernizedUploadItem.test.ts Outdated
Comment thread src/elements/content-uploader/__tests__/ModernizedUploadsManager.test.tsx Outdated
dealwith and others added 3 commits August 4, 2026 17:42
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@dealwith
dealwith requested a review from jpan-box August 4, 2026 20:13
Co-authored-by: Cursor <cursoragent@cursor.com>
@mergify mergify Bot added the queued label Aug 5, 2026
@mergify

mergify Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • Entered queue2026-08-05 12:47 UTC · Rule: Automatic strict merge · triggered by rule Automatic merge queue
  • Checks passed · in-place
  • Merged2026-08-05 12:59 UTC · at 0ccdd837141d8e9c5c01282f3de24168cbb346a2 · squash

This pull request spent 12 minutes 16 seconds in the queue, including 11 minutes 58 seconds running CI.

Required conditions to merge
  • github-review-approved [🛡 GitHub branch protection]
  • any of [🛡 GitHub branch protection]:
    • check-success = Summary
    • check-neutral = Summary
    • check-skipped = Summary
  • any of [🛡 GitHub branch protection]:
    • check-success = lint_test_build
    • check-neutral = lint_test_build
    • check-skipped = lint_test_build
  • any of [🛡 GitHub branch protection]:
    • check-success = license/cla
    • check-neutral = license/cla
    • check-skipped = license/cla
  • any of [🛡 GitHub branch protection]:
    • check-success = lint_pull_request
    • check-neutral = lint_pull_request
    • check-skipped = lint_pull_request

@mergify
mergify Bot merged commit c265639 into master Aug 5, 2026
13 checks passed
@mergify
mergify Bot deleted the localize-modernized-upload-errors branch August 5, 2026 12:59
@mergify mergify Bot removed the queued label Aug 5, 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