Skip to content

Conversation

@kagol
Copy link
Member

@kagol kagol commented Jan 23, 2026

PR

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our Commit Message Guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Summary by CodeRabbit

  • New Features
    • Introduced configurable file size limits for uploads with support for per-file-type constraints (e.g., separate limits for files, images, and videos).

✏️ Tip: You can customize this high-level summary in your review settings.

@github-actions github-actions bot added the enhancement New feature or request label Jan 23, 2026
@kagol kagol merged commit dc80f24 into dev Jan 23, 2026
1 check passed
@coderabbitai
Copy link

coderabbitai bot commented Jan 23, 2026

Caution

Review failed

The pull request is closed.

Walkthrough

The changes introduce per-kind file size validation by adding a MaxSizeConfig type that allows file upload limits to be configured globally or per upload type, with corresponding validation logic refactored in the FileUploader class. A demo is updated to showcase the new capability.

Changes

Cohort / File(s) Summary
Core file upload size validation
packages/fluent-editor/src/modules/custom-uploader.ts
Introduces MaxSizeConfig type supporting global or per-kind size limits. Updates FileUploaderOptions.maxSize signature from number to MaxSizeConfig. Adds getMaxSize(kind) helper method with fallback logic for determining applicable max size. Refactors validateFile to compute inferredKind, determine correct accept configuration, and validate file size against computed per-kind limit.
Demo configuration
packages/docs/fluent-editor/demos/file-upload.vue
Adds maxSize configuration object to uploader options specifying per-kind limits (5 MB for files, 100 KB for images, 10 MB for videos). Adds line break element after editor container.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A new config hops into view,
Per-kind size limits, tried and true,
Files, images, videos all get their way,
Size validation saves the day! ✨

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch kagol/maxSize

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 and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants