grass
grass copied to clipboard
wxGUI/history: Order commands by time and optimize node refresh
This PR addresses several interconnected enhancements that have been linked into a single PR:
-
Command Ordering: Commands are now ordered from newest (at the top) to oldest. Originally, they were not sorted - there was not mechanism for that.
-
Node Refresh Optimization:
- Replaces the method
_refreshTree()
, which only refreshed and sorted day nodes, with_reloadNode()
, which reloads and sorts both day nodes and command nodes. - When a node is updated with new information (after a command run finishes), the update is made directly to the node's attributes. Previously, the node was removed and re-added, which caused delay. Refreshing and sorting are now made through new methods in the new
HistoryTreeModel
.
- Refactoring: Necessary refactoring to support the changes in command ordering and optimization improvements.