YuriyKrasilnikov commented on PR #37790:
URL: https://github.com/apache/superset/pull/37790#issuecomment-3871921882
## What this commit does
This is a stabilization pass over the content localization feature. After
the initial implementation landed, we ran a thorough audit that uncovered
several integration issues that only manifest in real usage — not in isolated
unit tests.
**The most impactful fix** is the filter translation input becoming
unresponsive after 1-2 keystrokes. Root cause: `handleNameTranslationChange`
called `formChanged()` synchronously on every keystroke, while the default name
input used a debounced version. Each synchronous call triggered a state update
cascade through the parent modal, which recreated the callback (due to
`currentTranslations` in deps), causing React to lose focus on the controlled
input. The fix uses `currentTranslationsRef` (which was already prepared but
unused) and `debouncedFormChanged()` — making translation editing behave
identically to default name editing.
**Import/Export was silently broken** for any dashboard or chart that had
translations. Marshmallow schemas used `unknown="raise"`, so the `translations`
field in YAML caused import to fail. Adding the field to
`ImportV1DashboardSchema` and `ImportV1ChartSchema` fixes the round-trip.
**Several API endpoints returned un-localized content**: the chart entity
endpoint (`/dashboard/{id}/charts`), list endpoints, and the etag cache didn't
account for locale — meaning two users with different locales could get each
other's cached responses.
The commit also includes comprehensive test coverage for all the above: 4
Playwright E2E scenarios verifying end-to-end localization on a real dashboard,
plus Python and Jest unit tests for each fix. All linting (ruff, isort, mypy)
passes clean.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]