Skip to content

An upload's size and type popups open - #243

Merged
AlexSamBY merged 3 commits into
masterfrom
claude/upload-popups-open-fe7e9d
Oct 23, 2026
Merged

AlexSamBY merged 3 commits into
masterfrom
claude/upload-popups-open-fe7e9d

Conversation

@AlexSamBY

@AlexSamBY AlexSamBY commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

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 the branch merged with origin/master (#242 and
#239), these exit 0:

🤖 Generated with Claude Code

## 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
AlexSamBY merged commit 93393a6 into master Oct 23, 2026
7 of 8 checks passed
@AlexSamBY
AlexSamBY deleted the claude/upload-popups-open-fe7e9d branch October 23, 2026 14:09
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant