fix(chart-list): sort by changed_on instead of last_saved_at#39984
fix(chart-list): sort by changed_on instead of last_saved_at#39984massucattoj wants to merge 4 commits into
Conversation
Code Review Agent Run #7b28b9Actionable 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 |
|
The flagged issue is correct - the test now fails because the initial page load already sorts by 'changed_on_delta_humanized', so clicking the header creates a second matching request. To fix this, change the assertion to check the latest call instead of expecting exactly one call. superset-frontend/src/pages/ChartList/ChartList.listview.test.tsx |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #39984 +/- ##
=======================================
Coverage 64.20% 64.20%
=======================================
Files 2592 2592
Lines 139232 139232
Branches 32327 32327
=======================================
Hits 89389 89389
Misses 48308 48308
Partials 1535 1535
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Code Review Agent Run #a9ef52Actionable 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 |
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
SUMMARY
The "Last modified" column on the chart list page (/chart/list/) was sorting incorrectly because the displayed value and the sort key referenced different fields:
Charts with NULL last_saved_at (never saved by a user) or with divergent last_saved_at/changed_on appeared out of order, since the visible humanized date didn't match the underlying sort key.
This change aligns the column's accessor/id with the displayed value (changed_on_delta_humanized), matching the existing pattern in DashboardList and SavedQueryList. The backend already supports ordering by changed_on_delta_humanized via the @renders("changed_on") decorator in superset/models/helpers.py, so it correctly sorts by the underlying changed_on datetime column.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before:

After:

TESTING INSTRUCTIONS
To reproduce, you need charts with divergent changed_on and last_saved_at values (a fresh seed will not show the bug since both columns are populated identically at insert time).
ADDITIONAL INFORMATION