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

   ### SUMMARY
   Follow-up to #43139, flagged by a bot review comment on that PR (thread left 
unresolved).
   
   The Table chart's `Cell` renderer computes the per-row comparison arrow (and 
its color) twice when both `basicColorFormatters` (row-level) and 
`basicColorColumnFormatters` (column-specific) are present: once from the 
row-level array, then unconditionally reassigned from the column-specific one. 
The sibling `backgroundColor` assignment falls back to its prior value when the 
column-specific lookup is missing (`|| backgroundColor`), but the arrow and 
arrow-color assignments didn't have the same fallback. A row with no entry in 
`basicColorColumnFormatters` (the exact scenario #43139 guarded against 
crashing on) silently lost its arrow glyph entirely, and its arrow color would 
have flipped to the "decrease" color, even though a valid value had already 
been computed from `basicColorFormatters`.
   
   Both reassignments now fall back to the previously-computed value, matching 
how `backgroundColor` already behaves.
   
   Checked for the same shape elsewhere: `plugin-chart-ag-grid-table`'s 
`getCellStyle.ts` already guards its own background-color reassignment the same 
way (with a comment describing this exact failure mode), and its arrow logic 
only ever reads from one formatter source, so it isn't affected.
   
   ### TESTING INSTRUCTIONS
   `npx jest plugins/plugin-chart-table` — 147 passed. Extended the regression 
test #43139 added for the row-count-mismatch scenario to also assert the 
affected row keeps its arrow glyph and color instead of just checking it 
renders. Confirmed the added assertions fail against the pre-fix code (no arrow 
span rendered at all) and pass with the fix.
   
   ### ADDITIONAL INFORMATION
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration
   - [ ] 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