fix(tui): sort tasks in state not just view (#9373)
### Description
Move the new task ordering from just the view to the underlying state so
that the task list syncs up with the pane.
### Testing Instructions
Added unit testing for new insertion order.