Weak values and modular variables from a quantum phase-space perspective