Make UI only allow actions valid for current state, and update tabs based on location of Uri