Improved Regret and Contextual Linear Extension for Pandora's Box and Prophet Inequality