Repository navigation
add a clear-sort button to the data viewer status bar - #17960
Conversation
When a column sort is active, the "Sorted by: <column>" status at the right of the info bar now includes a small X button that clears the sort, restoring the frame's natural row order. The status element is split into a text span plus a persistent button so the button's click listener survives info-bar updates.
Code review findingsActionable items from an automated multi-agent review. Strengths, dismissed findings, and ratings Important
Suggestions
|
gtritchie
left a comment
There was a problem hiding this comment.
Feedback posted, nit-picky stuff.
🍎 macOS Desktop E2E · ARM64✅ All tests passed!
📥 Download Playwright report⬇️ playwright-report.zip — extract and open
2 shards · macos-26 ARM64 · commit |
|
Addressed in 916ed63:
Dismissing the suggestions:
|
ScrollUtil.setScrollPositionOnLoad polled the preview frame's document from a 50ms Scheduler timer with no try/catch. When the frame is transiently cross-origin (mid-navigation or an interim error page), reading contentWindow.document throws a SecurityError, which killed the polling loop (so the scroll position was never restored) and surfaced as an uncaught client exception that fails e2e tests since #17956. Treat a throw like the other not-ready cases and keep polling, matching the guarded versions of this same access in RmdOutputFramePane.
When a column sort is active, the "Sorted by: ()" status at the right of the data viewer's info bar now includes a small X button that clears the sort, restoring the frame's natural row order.
Implementation notes:
<button>, so the button's click listener (wired once atDOMContentLoaded, like the sidebar toggle) survives info-bar updates; asetSortStatus()helper updates the text and toggles button visibility everywhere the status used to be written directly.clearSort()mirrorshandleSortClick's unsort path: it resets the sort state, clears the active cell, resets header arrows andaria-sort, re-fetches from the top, and saves state so the cleared sort persists.Includes an e2e test covering: sort applied -> status text and button visible -> click -> natural order restored, status cleared, button hidden, header indicator and
aria-sortreset.No NEWS.md entry since the sort status bar is part of the unreleased data viewer rework.
Fixes #17959.
Also tags along an unrelated e2e-stability fix (45d2a49):
ScrollUtil.setScrollPositionOnLoadpolled the rmd preview frame's document without a try/catch, so a transiently cross-origin frame raised an uncaughtSecurityErrorfrom the 50ms timer -- killing the scroll restore and (since #17956) failing whichever e2e test was running, as seen withcreate new rmarkdown and knit to HTMLin run #240. A throw is now treated like the other not-ready cases and polling continues, matching the guarded versions of the same access inRmdOutputFramePane.