Skip to content

fix: added missing field for multiple upload#948

Merged
egordidenko merged 4 commits intomainfrom
fix/add-missing-field-for-multiple-uplopad
Mar 20, 2026
Merged

fix: added missing field for multiple upload#948
egordidenko merged 4 commits intomainfrom
fix/add-missing-field-for-multiple-uplopad

Conversation

@egordidenko
Copy link
Copy Markdown
Contributor

@egordidenko egordidenko commented Mar 19, 2026

Description

Checklist

Summary by CodeRabbit

  • New Features
    • Upload UI now shows contextual drop text: "Drop file here" (singular) or "Drop files here" (plural) based on multiple-upload setting.
    • Button/label text updated across 30+ languages to reflect single vs. multiple file modes.
  • Tests
    • End-to-end tests updated to expect pluralized labels when multiple uploads are enabled.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 19, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 97634674-5105-4aaf-8fd3-b63af3538218

📥 Commits

Reviewing files that changed from the base of the PR and between b0a85d4 and cd08d7f.

📒 Files selected for processing (3)
  • src/blocks/DropArea/DropArea.ts
  • tests/bundles.e2e.test.tsx
  • tests/file-uploader-minimal.e2e.test.tsx
✅ Files skipped from review due to trivial changes (2)
  • tests/file-uploader-minimal.e2e.test.tsx
  • tests/bundles.e2e.test.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/blocks/DropArea/DropArea.ts

📝 Walkthrough

Walkthrough

Drop text and button label rendering were made reactive to the multiple setting: DropArea now stores a _dropTextKey and updates it based on multiple, locales received singular drop-file-here keys for many languages, FileUploaderMinimal toggles _buttonTextKey, and tests were updated to expect plural text.

Changes

Cohort / File(s) Summary
DropArea Component
src/blocks/DropArea/DropArea.ts
Removed computed _localizedText getter; added @state _dropTextKey and _isMultiple, _updateDropText() method, subscribe to multiple via subConfigValue in initCallback, and call _updateDropText() in willUpdate when text or localeId change. Rendering uses _dropTextKey.
FileUploaderMinimal Component
src/solutions/file-uploader/minimal/FileUploaderMinimal.ts
Added reactive _buttonTextKey state; in initCallback observe multiple and toggle _buttonTextKey between choose-file and choose-files; render uses this.l10n(this._buttonTextKey).
Locale Files (many languages)
src/locales/file-uploader/{ar,az,ca,cs,da,de,el,en,es,et,fi,fr,he,hy,is,it,ja,ka,kk,ko,lv,nb,nl,pl,pt,ro,ru,sk,sr,sv,tr,uk,vi,zh-TW,zh}.ts
Added a new singular translation key drop-file-here to each listed locale alongside existing drop-files-here.
Tests
tests/bundles.e2e.test.tsx, tests/file-uploader-minimal.e2e.test.tsx
Updated E2E assertions and interactions to expect plural/button text Choose files instead of Choose file.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Poem

🐇 I nibble code beneath the moonlight,
I swap a word to make the message right,
One drop or many — now both have their say,
In thirty‑plus tongues we hop away! 🎉

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is incomplete and contains only template placeholders with no actual content, missing issue link, change summary, code snippets, and unchecked checklist items. Fill in the Description section with a brief summary of changes, link to related issue if applicable, and check completed checklist items (Tests and Changelog stub appear to be addressed).
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: adding a missing field to support multiple file uploads, which aligns with the code changes across DropArea, FileUploaderMinimal, locales, and tests.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/add-missing-field-for-multiple-uplopad
📝 Coding Plan
  • Generate coding plan for human review comments

Comment @coderabbitai help to get the list of available commands and usage tips.

@egordidenko egordidenko changed the title Fix/add missing field for multiple uplopad fix: added missing field for multiple upload Mar 19, 2026
@egordidenko egordidenko requested a review from Copilot March 19, 2026 15:39
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/blocks/DropArea/DropArea.ts (1)

55-56: Consider renaming _dropTextKey to _dropText for clarity.

The variable stores the localized text string (result of l10n() call), not the locale key. This differs from FileUploaderMinimal._buttonTextKey which actually stores the key and calls l10n() at render time. The inconsistent naming and approach could cause confusion for future maintainers.

Also applies to: 285-285

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/blocks/DropArea/DropArea.ts` around lines 55 - 56, Rename the state
property _dropTextKey to _dropText and update its usage in the DropArea class so
it stores the localized string (result of l10n(...)) instead of a key; ensure
any references to _dropTextKey (including the occurrence near the render logic
around the current _dropTextKey usage and the other occurrence marked at ~line
285) are updated to _dropText and that the component no longer attempts to call
l10n at render time for this value, keeping FileUploaderMinimal._buttonTextKey
behavior unchanged to avoid confusion between the two patterns.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/blocks/DropArea/DropArea.ts`:
- Around line 143-150: The drop text update logic is only run in the 'multiple'
subscription so changing the component's text property later doesn't update
_dropTextKey; extract that logic into a new private method named _updateDropText
that reads this.text and falls back to this.cfg.multiple to set
this._dropTextKey (using this.l10n as before), replace the inline logic inside
the this.subConfigValue('multiple', ...) callback with a call to
_updateDropText, and call _updateDropText from a willUpdate lifecycle handler so
dynamic changes to the text property update the displayed drop text.

---

Nitpick comments:
In `@src/blocks/DropArea/DropArea.ts`:
- Around line 55-56: Rename the state property _dropTextKey to _dropText and
update its usage in the DropArea class so it stores the localized string (result
of l10n(...)) instead of a key; ensure any references to _dropTextKey (including
the occurrence near the render logic around the current _dropTextKey usage and
the other occurrence marked at ~line 285) are updated to _dropText and that the
component no longer attempts to call l10n at render time for this value, keeping
FileUploaderMinimal._buttonTextKey behavior unchanged to avoid confusion between
the two patterns.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 603a6746-ac52-4add-9cec-97f1294a8edb

📥 Commits

Reviewing files that changed from the base of the PR and between f2467fb and b0a85d4.

📒 Files selected for processing (37)
  • src/blocks/DropArea/DropArea.ts
  • src/locales/file-uploader/ar.ts
  • src/locales/file-uploader/az.ts
  • src/locales/file-uploader/ca.ts
  • src/locales/file-uploader/cs.ts
  • src/locales/file-uploader/da.ts
  • src/locales/file-uploader/de.ts
  • src/locales/file-uploader/el.ts
  • src/locales/file-uploader/en.ts
  • src/locales/file-uploader/es.ts
  • src/locales/file-uploader/et.ts
  • src/locales/file-uploader/fi.ts
  • src/locales/file-uploader/fr.ts
  • src/locales/file-uploader/he.ts
  • src/locales/file-uploader/hy.ts
  • src/locales/file-uploader/is.ts
  • src/locales/file-uploader/it.ts
  • src/locales/file-uploader/ja.ts
  • src/locales/file-uploader/ka.ts
  • src/locales/file-uploader/kk.ts
  • src/locales/file-uploader/ko.ts
  • src/locales/file-uploader/lv.ts
  • src/locales/file-uploader/nb.ts
  • src/locales/file-uploader/nl.ts
  • src/locales/file-uploader/pl.ts
  • src/locales/file-uploader/pt.ts
  • src/locales/file-uploader/ro.ts
  • src/locales/file-uploader/ru.ts
  • src/locales/file-uploader/sk.ts
  • src/locales/file-uploader/sr.ts
  • src/locales/file-uploader/sv.ts
  • src/locales/file-uploader/tr.ts
  • src/locales/file-uploader/uk.ts
  • src/locales/file-uploader/vi.ts
  • src/locales/file-uploader/zh-TW.ts
  • src/locales/file-uploader/zh.ts
  • src/solutions/file-uploader/minimal/FileUploaderMinimal.ts

Comment thread src/blocks/DropArea/DropArea.ts
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the file uploader UI copy to correctly reflect single vs. multiple upload mode, including adding a missing singular “drop” localization key across supported locales.

Changes:

  • Make the minimal uploader’s primary button label switch between “Choose file” and “Choose files” based on cfg.multiple.
  • Update uc-drop-area to use singular/plural “Drop file(s) here” messaging based on cfg.multiple (and add the missing drop-file-here locale key).
  • Add drop-file-here translations across all file-uploader locales.

Reviewed changes

Copilot reviewed 37 out of 37 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/solutions/file-uploader/minimal/FileUploaderMinimal.ts Dynamically chooses the button l10n key based on multiple.
src/blocks/DropArea/DropArea.ts Switches drop-area text between singular/plural variants.
src/locales/file-uploader/ar.ts Adds drop-file-here translation.
src/locales/file-uploader/az.ts Adds drop-file-here translation.
src/locales/file-uploader/ca.ts Adds drop-file-here translation.
src/locales/file-uploader/cs.ts Adds drop-file-here translation.
src/locales/file-uploader/da.ts Adds drop-file-here translation.
src/locales/file-uploader/de.ts Adds drop-file-here translation.
src/locales/file-uploader/el.ts Adds drop-file-here translation.
src/locales/file-uploader/en.ts Adds drop-file-here translation.
src/locales/file-uploader/es.ts Adds drop-file-here translation.
src/locales/file-uploader/et.ts Adds drop-file-here translation.
src/locales/file-uploader/fi.ts Adds drop-file-here translation.
src/locales/file-uploader/fr.ts Adds drop-file-here translation.
src/locales/file-uploader/he.ts Adds drop-file-here translation.
src/locales/file-uploader/hy.ts Adds drop-file-here translation.
src/locales/file-uploader/is.ts Adds drop-file-here translation.
src/locales/file-uploader/it.ts Adds drop-file-here translation.
src/locales/file-uploader/ja.ts Adds drop-file-here translation.
src/locales/file-uploader/ka.ts Adds drop-file-here translation.
src/locales/file-uploader/kk.ts Adds drop-file-here translation.
src/locales/file-uploader/ko.ts Adds drop-file-here translation.
src/locales/file-uploader/lv.ts Adds drop-file-here translation.
src/locales/file-uploader/nb.ts Adds drop-file-here translation.
src/locales/file-uploader/nl.ts Adds drop-file-here translation.
src/locales/file-uploader/pl.ts Adds drop-file-here translation.
src/locales/file-uploader/pt.ts Adds drop-file-here translation.
src/locales/file-uploader/ro.ts Adds drop-file-here translation.
src/locales/file-uploader/ru.ts Adds drop-file-here translation.
src/locales/file-uploader/sk.ts Adds drop-file-here translation.
src/locales/file-uploader/sr.ts Adds drop-file-here translation.
src/locales/file-uploader/sv.ts Adds drop-file-here translation.
src/locales/file-uploader/tr.ts Adds drop-file-here translation.
src/locales/file-uploader/uk.ts Adds drop-file-here translation.
src/locales/file-uploader/vi.ts Adds drop-file-here translation.
src/locales/file-uploader/zh.ts Adds drop-file-here translation.
src/locales/file-uploader/zh-TW.ts Adds drop-file-here translation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/solutions/file-uploader/minimal/FileUploaderMinimal.ts
Comment thread src/blocks/DropArea/DropArea.ts Outdated
Comment thread src/blocks/DropArea/DropArea.ts
@egordidenko egordidenko requested a review from loookashow March 19, 2026 17:14
@egordidenko egordidenko merged commit 37ba6c8 into main Mar 20, 2026
7 of 8 checks passed
@egordidenko egordidenko deleted the fix/add-missing-field-for-multiple-uplopad branch March 20, 2026 13:10
@coderabbitai coderabbitai Bot mentioned this pull request May 6, 2026
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants