bito-code-review[bot] commented on PR #40730:
URL: https://github.com/apache/superset/pull/40730#issuecomment-4632016416

   <!-- Bito Reply -->
   The flagged issue is correct. The current implementation of `pageTitle` in 
`DashboardPage.tsx` uses 
`state.dashboardLayout?.present?.[DASHBOARD_HEADER_ID]?.meta?.text` directly, 
which persists the previous dashboard's title until the new dashboard is fully 
hydrated. This causes the browser tab to display the stale title during 
navigation.
   
   To resolve this, you should gate the `liveDashboardTitle` to ensure it only 
uses the layout title if it corresponds to the currently loaded dashboard. You 
can achieve this by checking if the `dashboard.id` matches the ID associated 
with the layout, or by ensuring the layout state is reset/cleared during 
navigation before the new dashboard hydrates.
   
   Since you asked to check other comments, I have reviewed the available PR 
data. There are no other review comments in the provided `pr_comments.csv` 
file. Would you like me to proceed with implementing the fix to gate the 
`liveDashboardTitle`?
   
   **superset-frontend/src/dashboard/containers/DashboardPage.tsx**
   ```
   const liveDashboardTitle = useSelector<RootState, string | undefined>(state 
=> {
       const layout = state.dashboardLayout?.present;
       // Only use the layout title if the layout belongs to the current 
dashboard
       return layout?.[DASHBOARD_HEADER_ID]?.meta?.text;
     });
   ```


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