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


##########
superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/TableRenderers.jsx:
##########
@@ -23,6 +23,26 @@ import PropTypes from 'prop-types';
 import { PivotData, flatKey } from './utilities';
 import { Styles } from './Styles';
 
+/**
+ * Computes the initial collapsed state map for a given set of keys and depth.
+ * Keys at the specified depth will be marked as collapsed, hiding their 
children.
+ * @param {Array<Array>} keys - Array of key arrays (e.g., rowKeys or colKeys)
+ * @param {number} depth - The depth at which to collapse (1-based). Keys at 
this depth will be collapsed.
+ * @returns {Object} A map of flatKey => true for all keys that should be 
collapsed
+ */
+export function computeCollapsedMap(keys, depth) {

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Convert JS to TS</b></div>
   <div id="fix">
   
   This file is written in JavaScript, but the Superset development standards 
require converting all JavaScript files to TypeScript as part of ongoing 
modernization. The added computeCollapsedMap function and componentDidMount 
logic should be typed for better safety and maintainability.
   </div>
   
   
   </div>
   
   <details>
   <summary><b>Citations</b></summary>
   <ul>
   
   <li>
   Rule Violated: <a 
href="https://github.com/apache/superset/blob/33d0ebe/.cursor/rules/dev-standard.mdc#L17";>dev-standard.mdc:17</a>
   </li>
   
   </ul>
   </details>
   
   
   
   
   <small><i>Code Review Run #8e0549</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