bito-code-review[bot] commented on code in PR #40679:
URL: https://github.com/apache/superset/pull/40679#discussion_r3876708993


##########
superset-frontend/src/pages/ChartList/ChartList.test.tsx:
##########
@@ -273,6 +273,34 @@ describe('ChartList', () => {
 
     expect(screen.queryByTestId('delete-modal-input')).not.toBeInTheDocument();
   });
+
+  test('renders the localized chart name, falling back to slice_name', async 
() => {
+    // Served from a response of its own rather than the shared mock, which
+    // other suites assert against by canonical name.
+    const [translated, untranslated] = mockCharts;
+    fetchMock.removeRoutes();

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Wrong fetchMock reset API</b></div>
   <div id="fix">
   
   `fetchMock.removeRoutes()` (plural) wipes every route registered by 
`beforeEach`'s `setupMocks()`, so the component will fail to fetch 
`CHARTS_INFO`, `CHART_VIZ_TYPES`, and other required endpoints. Use 
`fetchMock.removeRoute(API_ENDPOINTS.CHARTS)` (singular) — the same pattern 
already used at line 220 — to override only the CHARTS response.
   </div>
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #a9c438</i></small>
   </div>
   
   ---
   Should Bito avoid suggestions like this for future reviews? (<a 
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
   - [ ] Yes, avoid them



##########
superset-frontend/src/views/CRUD/types.ts:
##########
@@ -61,7 +61,11 @@ export interface Dashboard {
   changed_on_utc?: string;
   changed_by: string;
   dashboard_title: string;
+  // Title resolved for the viewer's locale (read-only); falls back to
+  // dashboard_title. Present only when asset-metadata translation is enabled.
+  localized_title?: string;
   slice_name?: string;
+  localized_name?: string;

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Chart field on Dashboard type</b></div>
   <div id="fix">
   
   `localized_name` is a chart field (see `src/types/Chart.ts:40`, 
`ChartCard.tsx:249`, `ChartList/index.tsx:498`, `views/CRUD/hooks.ts:760`), but 
it's being added to the `Dashboard` interface. The local `Dashboard` interface 
in `DashboardList/index.tsx:112` correctly omits it. This makes the shared 
`Dashboard` type misleading — consumers will assume `localized_name` is a 
dashboard field. Also missing the explanatory comment that `localized_title` 
has above.
   </div>
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #a9c438</i></small>
   </div>
   
   ---
   Should Bito avoid suggestions like this for future reviews? (<a 
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
   - [ ] Yes, avoid them



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