-
Notifications
You must be signed in to change notification settings - Fork 16.4k
feat(chart): add default row/column expansion depth to Pivot Table #36849
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
feat(chart): add default row/column expansion depth to Pivot Table #36849
Conversation
|
CodeAnt AI is reviewing your PR. Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
Code Review Agent Run #d34f78Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
Nitpicks 🔍
|
superset-frontend/plugins/plugin-chart-pivot-table/src/PivotTableChart.tsx
Outdated
Show resolved
Hide resolved
superset-frontend/plugins/plugin-chart-pivot-table/src/PivotTableChart.tsx
Show resolved
Hide resolved
superset-frontend/plugins/plugin-chart-pivot-table/src/plugin/transformProps.ts
Outdated
Show resolved
Hide resolved
superset-frontend/plugins/plugin-chart-pivot-table/src/plugin/transformProps.ts
Show resolved
Hide resolved
superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/TableRenderers.jsx
Show resolved
Hide resolved
superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/TableRenderers.jsx
Outdated
Show resolved
Hide resolved
superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/TableRenderers.jsx
Outdated
Show resolved
Hide resolved
|
CodeAnt AI finished reviewing your PR. |
Add controls to configure how deeply rows and columns are expanded by default when a Pivot Table chart loads. This allows charts to start with deeper hierarchy levels collapsed for better overview. - Add defaultRowExpansionDepth and defaultColExpansionDepth controls - Controls only appear when subtotals are enabled and depth > 1 - Add computeCollapsedMap helper function for initial state seeding - Apply initial collapse in componentDidMount (not render) to avoid React anti-pattern - Add unit tests for computeCollapsedMap helper
59d0512 to
33d0ebe
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review Agent Run #8e0549
Actionable Suggestions - 1
-
superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/TableRenderers.jsx - 1
- Convert JS to TS · Line 33-33
Review Details
-
Files reviewed - 7 · Commit Range:
33d0ebe..33d0ebe- superset-frontend/plugins/plugin-chart-pivot-table/src/PivotTableChart.tsx
- superset-frontend/plugins/plugin-chart-pivot-table/src/plugin/controlPanel.tsx
- superset-frontend/plugins/plugin-chart-pivot-table/src/plugin/transformProps.ts
- superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/TableRenderers.jsx
- superset-frontend/plugins/plugin-chart-pivot-table/src/types.ts
- superset-frontend/plugins/plugin-chart-pivot-table/test/plugin/transformProps.test.ts
- superset-frontend/plugins/plugin-chart-pivot-table/test/react-pivottable/computeCollapsedMap.test.ts
-
Files skipped - 0
-
Tools
- Eslint (Linter) - ✔︎ Successful
- Whispers (Secret Scanner) - ✔︎ Successful
- Detect-secrets (Secret Scanner) - ✔︎ Successful
Bito Usage Guide
Commands
Type the following command in the pull request comment and save the comment.
-
/review- Manually triggers a full AI review. -
/pause- Pauses automatic reviews on this pull request. -
/resume- Resumes automatic reviews. -
/resolve- Marks all Bito-posted review comments as resolved. -
/abort- Cancels all in-progress reviews.
Refer to the documentation for additional commands.
Configuration
This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at [email protected].
Documentation & Help
| * @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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Citations
- Rule Violated: dev-standard.mdc:17
Code Review Run #8e0549
Should Bito avoid suggestions like this for future reviews? (Manage Rules)
- Yes, avoid them
|
Thanks for the feedback! You're correct that the project is modernizing to TypeScript. However, converting the entire TableRenderers.jsx file (~950 lines) to TypeScript is a significant refactoring effort that's beyond the scope of this feature PR. I'd prefer to keep this PR focused on the new functionality. The TypeScript conversion of the react-pivottable folder would be better suited as a separate modernization PR. Would you be okay with merging this as-is and addressing the TS conversion in a follow-up? |
User description
Add controls to configure how deeply rows and columns are expanded by default when a Pivot Table chart loads. This allows charts to start with deeper hierarchy levels collapsed for better overview.
SUMMARY
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION
CodeAnt-AI Description
Add controls to set how deeply Pivot Table rows and columns are expanded when the chart loads
What Changed
Impact
✅ Clearer pivot overviews on load✅ Fewer manual collapses required after chart load✅ Consistent initial expansion state across loads💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.