alex-poor commented on code in PR #40679:
URL: https://github.com/apache/superset/pull/40679#discussion_r3875453375
##########
superset-frontend/src/dashboard/components/gridComponents/Chart/Chart.tsx:
##########
@@ -758,6 +758,7 @@ const Chart = (props: ChartProps) => {
props.updateSliceName(props.id, name)
}
sliceName={props.sliceName}
+ localizedName={slice.localized_name}
Review Comment:
Fixed in 95fcbe7 — and thank you, this was the worst thing in the PR. It was
not gated on the feature at all: `localized_name` falls back to the canonical
name, so `localizedName ?? sliceName` always won, and every deployment with an
overridden panel would have rendered the canonical name, feature flag or not.
Taken the first of your two options: the override is authored on this
dashboard and has no translation to resolve, so the localized value is offered
only while the panel is still showing the canonical name. Translating the
override would mean pushing dashboard layout metadata through the hook, which
seems like the wrong shape for it. There is now a test that fails without the
guard.
##########
superset-frontend/src/dashboard/components/Header/index.tsx:
##########
@@ -607,14 +609,15 @@ const Header = (): JSX.Element => {
const editableTitleProps = useMemo(
() => ({
- title: dashboardTitle,
+ // Editing operates on the canonical title; display localizes.
+ title: editMode ? dashboardTitle : (localizedTitle ?? dashboardTitle),
Review Comment:
Fixed in 95fcbe7 — the same staleness I had fixed on the list views while
missing this one. Rather than clearing on rename, hydration now records which
canonical title the translation was resolved for, and the header uses the
translation only while the live title still matches. That covers undo as well:
clearing on rename would leave the canonical title showing after an undo
restored the very name the translation belongs to.
--
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]