fix: added missing field for multiple upload#948
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✅ Files skipped from review due to trivial changes (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughDrop text and button label rendering were made reactive to the Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
📝 Coding Plan
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/blocks/DropArea/DropArea.ts (1)
55-56: Consider renaming_dropTextKeyto_dropTextfor clarity.The variable stores the localized text string (result of
l10n()call), not the locale key. This differs fromFileUploaderMinimal._buttonTextKeywhich actually stores the key and callsl10n()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
📒 Files selected for processing (37)
src/blocks/DropArea/DropArea.tssrc/locales/file-uploader/ar.tssrc/locales/file-uploader/az.tssrc/locales/file-uploader/ca.tssrc/locales/file-uploader/cs.tssrc/locales/file-uploader/da.tssrc/locales/file-uploader/de.tssrc/locales/file-uploader/el.tssrc/locales/file-uploader/en.tssrc/locales/file-uploader/es.tssrc/locales/file-uploader/et.tssrc/locales/file-uploader/fi.tssrc/locales/file-uploader/fr.tssrc/locales/file-uploader/he.tssrc/locales/file-uploader/hy.tssrc/locales/file-uploader/is.tssrc/locales/file-uploader/it.tssrc/locales/file-uploader/ja.tssrc/locales/file-uploader/ka.tssrc/locales/file-uploader/kk.tssrc/locales/file-uploader/ko.tssrc/locales/file-uploader/lv.tssrc/locales/file-uploader/nb.tssrc/locales/file-uploader/nl.tssrc/locales/file-uploader/pl.tssrc/locales/file-uploader/pt.tssrc/locales/file-uploader/ro.tssrc/locales/file-uploader/ru.tssrc/locales/file-uploader/sk.tssrc/locales/file-uploader/sr.tssrc/locales/file-uploader/sv.tssrc/locales/file-uploader/tr.tssrc/locales/file-uploader/uk.tssrc/locales/file-uploader/vi.tssrc/locales/file-uploader/zh-TW.tssrc/locales/file-uploader/zh.tssrc/solutions/file-uploader/minimal/FileUploaderMinimal.ts
There was a problem hiding this comment.
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-areato use singular/plural “Drop file(s) here” messaging based oncfg.multiple(and add the missingdrop-file-herelocale key). - Add
drop-file-heretranslations 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.
Description
Checklist
Summary by CodeRabbit