sadpandajoe commented on code in PR #40679:
URL: https://github.com/apache/superset/pull/40679#discussion_r3872690882


##########
superset/charts/api.py:
##########
@@ -233,6 +233,7 @@ def ensure_thumbnails_enabled(self) -> Optional[Response]:
         "dashboards.dashboard_title",
         "params",
         "slice_name",
+        "localized_name",

Review Comment:
   The list endpoint now returns this field, but the checked-in OpenAPI 
artifact only adds it to the chart GET/dashboard GET response components, not 
the chart/dashboard list-item schemas. Generated clients for the list APIs 
therefore cannot discover the field the React list views consume. Could the 
list response schemas be included in the artifact update too?



##########
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:
   `localizedTitle` is hydrated once and is not cleared when `handleChangeText` 
updates the canonical title. After renaming and leaving edit mode without a 
reload, this will switch back to the previous title's translation. Could the 
rename path invalidate the localized value until the refreshed dashboard 
supplies one?



##########
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:
   This prefers the translation of the canonical slice name over 
`props.sliceName`, which is the dashboard-specific title override. A panel 
overridden from `Sales` to `Q2 Sales` will render `Sales` (even with 
translation disabled, because the API falls back `localized_name` to the 
canonical name). Could the localized value be used only when there is no 
override, or be resolved for the displayed override?



-- 
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]

Reply via email to