deepujain opened a new pull request, #44557:
URL: https://github.com/apache/superset/pull/44557

   ### SUMMARY
   
   A chart with cached data can create its color scale during the dashboard's 
first render, before the dashboard effect installs `label_colors`. Its initial 
output then keeps palette colors even though the metadata specifies custom 
colors.
   
   Keep the grid unmounted until that dashboard's color initialization has run. 
Track the initialized dashboard ID so navigating to another dashboard also 
waits for its colors. The existing color-selection and synchronization 
algorithms stay unchanged.
   
   Fixes #40708.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   The screenshots use the production `DashboardContainer`, ECharts Timeseries 
transform, and ECharts renderer in an isolated Storybook fixture with an 
already-cached query. They demonstrate initial rendering, not the reporter's 
authenticated deployment. The metadata requests dark red for `60_Crashed`, red 
for `50_Error`, and `#008000` for `20_Passed`.
   
   Before: the first render uses palette colors.
   
   ![Before: cached chart ignores metadata 
colors](https://raw.githubusercontent.com/deepujain/superset/evidence-40708-initial-colors-20260923/pr40708-before.png)
   
   After: the same fixture uses the metadata colors on its first render.
   
   ![After: cached chart uses metadata 
colors](https://raw.githubusercontent.com/deepujain/superset/evidence-40708-initial-colors-20260923/pr40708-after.png)
   
   [Fixture and recorded browser series 
colors](https://github.com/deepujain/superset/tree/evidence-40708-initial-colors-20260923).
   
   ### TESTING INSTRUCTIONS
   
   Run the component and dashboard action suites:
   
   ```bash
   cd superset-frontend
   npm run test -- --maxWorkers=2 
src/dashboard/components/DashboardBuilder/DashboardContainer.test.tsx 
src/dashboard/actions/dashboardState.test.ts
   ```
   
   59 tests pass. Four regression cases fail on unmodified `61fffbe0c0`: first 
color consumption with and without StrictMode, plus navigation that reuses or 
changes the color namespace. The tests use the real color initialization action 
and namespace. `npm run plugins:build` and staged-file `pre-commit run` also 
pass, including frontend type checking.
   
   For browser reproduction, follow the linked fixture README and open a fresh 
page for each version. The baseline's ECharts series colors are `#1f77b4`, 
`#ff7f0e`, and `#2ca02c`; the patched version produces `#8b0000`, `#ff0000`, 
and `#008000` without a legend click or refresh.
   
   The grid now mounts one effect later; this does not add a network wait. Full 
application E2E coverage was not run.
   
   ### ADDITIONAL INFORMATION
   
   - [x] Has associated issue: #40708
   - [ ] Required feature flags:
   - [x] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


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