-
Notifications
You must be signed in to change notification settings - Fork 350
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
apply topological sort to reorder cells in editor #3560
Comments
Sounds like a reasonable request. How would you handle things like |
I guess I haven't looked in detail at how the current topological sort does it, but I would suggest looking for the minimal reordering compatible with the topological constraints (in some loose sense anyway, not sure if this is well-defined) , so cells not on the dependency tree just wouldn't move. |
Ah, I see ties are currently broken by registration order - seems reasonable, but for this application it would be preferable to use the current layout order for that I think. |
I could be thinking about layout order wrong, but in my interpretation, that would for sure bubble up markdown to the top. Maybe there is some algorithm/ruleset that would be agreeable (like sorting between pure-markdown blocks, but i can still think of edge cases). |
Oh yes of course, they'll always be clumped if the use of existing order is just to break ties. |
Description
In many cases, I add a cell out of its topological order simply for convenience when editing (ie working with a later portion of the notebook and realize a needed variable was not defined). In this case the work would be more polished for a reader if the cells were reordered to match the topological order (as is currently done when exporting).
Suggested solution
Add a UI command that reorders cells in their topological order.
Also consider a cell-level command that moves that cell only to immediately above the first dependent cell.
Alternative
This can currently be done manually.
Additional context
No response
The text was updated successfully, but these errors were encountered: