Repository navigation
An upload's size and type popups open - #243
Merged
Merged
Conversation
## What
`Upload` refuses a drop that holds a file larger than its `maxSize`, and
a drop with no file of a type its `formats` take, and hands the
document's popup a title and a message that say so. It handed them
without `isOpen`, and `AppProvider`'s `setPopupState` keeps the popup's
`isOpen` when it is not given, which is `false`: the popup got its
title and message and stayed closed, and the user was refused without a
word. Every 0.34.x release has the same two calls and the same
provider. The engine's own popups pass `isOpen: true` (`popupAlert`),
and so does the demo page's.
Both of the upload's popups now pass it. Nothing else changes: a drop
that holds one file too large is still refused whole, and the texts are
the built-in phrases, translated with the document's translator. An
upload inside an open popup is the one case that showed the message
before, measured: it takes that popup's place, before and after this
change.
## Tests
- `upload-popups.test.js`, through the library entry, with the real
popup state and `Modal`:
- a file over `maxSize` opens the dialog, named by its title, with the
file's name and the limit, and `uploadFile` is not called;
- a drop of a small and a large file is refused whole;
- a drop of a type the `formats` do not take opens the
`File Upload Failed!` dialog;
- Ok closes it, and the next refused drop opens it again;
- an accepted file opens no dialog and reaches `uploadFile`.
- `built-in-phrases.test.js` showed the upload's popups in a `Modal` of
its own, since the document opened none. It now reads them from the
document, for each of the three translators.
- The two `Upload` unit tests that stub `setPopupState` now expect
`isOpen: true`, and the size case expects no `onChange` call.
- `interactive-views.pw.js`, in Chromium: a 2 MB + 1 byte image picked
from the keyboard on the `uploadVariants` example opens the dialog
above the page; it takes the focus, Escape closes it, and the focus
goes back to the drop zone. `view-coverage.js` names it under
`Upload`, and `reference.js` holds its values.
On the code before this change, all twelve of the changed and added
jest tests that open a popup fail, and so does the browser test. The
accepted-file case passes on both.
## Gates
On Node 24.14.0, on `origin/master` (#241), these exit 0:
- `npm test` (242 suites, 3158 tests) and `test:coverage`, with every
threshold held;
- `test:react16`, `test:react17` and `test:react19`;
- `lint:js`, `typecheck`, `docs:views:check`, `docs:props:check` and
`docs:phrases:check`;
- `test:e2e` and `test:e2e:react19`, 70 tests each in Chromium, desktop
and touch.
The jest legs ran with `<rootDir>/\.claude/` ignored, for a stray,
gitignored probe in this checkout. The new browser test also passes in
WebKit; Firefox did not start in this environment.
# Conflicts: # e2e/interactive-views.pw.js # e2e/reference.js # src/demo/markdowns/changelog.md
# Conflicts: # src/demo/markdowns/changelog.md
AlexSamBY
added a commit
that referenced
this pull request
Oct 23, 2026
PR 4 of EPBDS-16949. Until now a date field's calendar was rc-picker's `en_US`, whatever the host set: - its `Today`; - the names a screen reader gives its buttons, such as `Previous month (PageUp)`; - its month and day names. A `Text` on the same page already showed dates in moment's global locale. ## What changes - **11 new built-in phrases, 52 in all.** Each is asked for as `ui-render:<ID>`, with the English of today as the fallback: - `TODAY`, `PREVIOUS_MONTH`, `NEXT_MONTH`, `LAST_YEAR` and `NEXT_YEAR`; - `CHOOSE_A_MONTH`, `CHOOSE_A_YEAR` and `CHOOSE_A_DECADE`; - `NOW`, `CALENDAR_OK` and `WEEK`, for what rc-picker shows where a meta passes `showTime`, `needConfirm` or `showWeek`. `CALENDAR_OK` has a prefix because the popup's `OK` id is the English `Ok`, and rc-picker writes `OK`. rc-picker 4.11.3 reads none of its locale's other 14 texts (`Clear`, `Back to today`, `Last decade` and the rest), so none of them is published. - **Month and day names follow the host.** The calendar's names, a date whose `dateFormat` names the month, and what a user types are now in a moment locale chosen this way: - the locale the host's `locale` names, `de` for `de-DE`; - else the one its `language` names; - else English. A locale counts only where moment has it loaded. moment's own fallback for a missing locale is its global locale, which no prop of the document names. The calendar's weeks start as that locale starts them. moment's locale data stays the host's to load (`import 'moment/locale/de'`). - **The closed field's stand-in stays identical to rc-picker.** It writes its date in the same locale. It asks for no phrase until its picker mounts: the phrases are resolved in a small wrapper around rc-picker. - **Fix: a picked date is handed on in English digits.** With moment's global locale set to `ar`, a date picked in the calendar was handed on as `٢٠٢٤-٠٣-٢٠`, and that is what the data held. ## Tests - `calendarLocale.test.js`: - how the moment locale is chosen; - that moment's global locale is never the fallback; - that the calendar's locale is kept by identity, and re-made when a text or the locale changes. - `date-field-language.test.js`, with `de` and `ar` loaded as a host loads them: - German month and day names, from `locale` and from `language`; - a Monday week; - a date in `DD MMMM YYYY`; - moment's global locale ignored; - Latin digits handed on. - `date-field-language.unloaded.test.js`: with `moment/locale/de` unloadable, everything stays English, with no console output. - `built-in-phrases.test.js`: every calendar text for a translating host, a host without translations, and a host with no `translate`. - Extensions to existing tests: - the stand-in comparison, for German and Arabic configs; - typed text in a month-name format, English as before, and German; - one locale object across renders at the rc-picker boundary. The browser tests drive the calendar by class names, not by its accessible names, so none of their selectors changed. ## Gates All exit 0 on `a376958e`, which is on `549979c7`: - `lint:js`, `typecheck` and `typecheck:contract`; - `test:types` and `test:pack`; - `docs:views:check`, `docs:props:check` and `docs:phrases:check`; - the four jest legs: `npm test`, `test:react16`, `test:react17` and `test:react19`; - `test:coverage`; - `CI=1 npm run test:e2e`: 76 passed. `InputDate.tsx` and the new `calendarLocale.ts` are at 100% coverage on every metric, and the new file has a 100% threshold of its own. The jest legs and coverage ran with a gitignored local file under `.claude/` excluded; it is not part of the repository. The branch merges cleanly with #243, which landed after it was cut. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Uploadrefuses a drop that holds a file larger than itsmaxSize, anda drop with no file of a type its
formatstake, and hands thedocument's popup a title and a message that say so. It handed them
without
isOpen, andAppProvider'ssetPopupStatekeeps the popup'sisOpenwhen it is not given, which isfalse: the popup got itstitle and message and stayed closed, and the user was refused without a
word. Every 0.34.x release has the same two calls and the same
provider. The engine's own popups pass
isOpen: true(popupAlert),and so does the demo page's.
Both of the upload's popups now pass it. Nothing else changes: a drop
that holds one file too large is still refused whole, and the texts are
the built-in phrases, translated with the document's translator. An
upload inside an open popup is the one case that showed the message
before, measured: it takes that popup's place, before and after this
change.
Tests
upload-popups.test.js, through the library entry, with the realpopup state and
Modal:maxSizeopens the dialog, named by its title, with thefile's name and the limit, and
uploadFileis not called;formatsdo not take opens theFile Upload Failed!dialog;uploadFile.built-in-phrases.test.jsshowed the upload's popups in aModalofits own, since the document opened none. It now reads them from the
document, for each of the three translators.
Uploadunit tests that stubsetPopupStatenow expectisOpen: true, and the size case expects noonChangecall.interactive-views.pw.js, in Chromium: a 2 MB + 1 byte image pickedfrom the keyboard on the
uploadVariantsexample opens the dialogabove the page; it takes the focus, Escape closes it, and the focus
goes back to the drop zone.
view-coverage.jsnames it underUpload, andreference.jsholds its values.On the code before this change, all twelve of the changed and added
jest tests that open a popup fail, and so does the browser test. The
accepted-file case passes on both.
Gates
On Node 24.14.0, on the branch merged with
origin/master(#242 and#239), these exit 0:
npm test(244 suites, 3187 tests) andtest:coverage, with everythreshold held;
test:react16,test:react17andtest:react19;lint:js,typecheck,docs:views:check,docs:props:checkanddocs:phrases:check;test:e2eandtest:e2e:react19, 76 tests each in Chromium, desktopand touch.
The merges conflicted only where both sides added entries: with
EPBDS-13515: a background class in a header's
classNameHeadercolours the whole header cell #242 ininteractive-views.pw.js,reference.jsand the changelog,and with EPBDS-12884: a date field keeps text that is no date, and says
Invalid date#239 in the changelog. Both sides are kept.test:react16, on the merge with EPBDS-13515: a background class in a header'sclassNameHeadercolours the whole header cell #242 alone, exited 1 on tworuns: a jest worker died with SIGSEGV, a known Node 24 crash, in two
suites this PR does not touch. It exited 0 on the third run, and on
the merge with EPBDS-12884: a date field keeps text that is no date, and says
Invalid date#239 on the first.The jest legs ran with
<rootDir>/\.claude/ignored, for a stray,gitignored probe in this checkout, which CI's checkout does not have.
The new browser test, and the upload's keyboard test, also pass in
WebKit. Firefox did not start in this environment.
🤖 Generated with Claude Code