Much of modern metrology and communication technology encodes information in electromagnetic waves, typically as an amplitude or phase. Although current hardware can perform near-ideal measurements of photon number or field amplitude, the ability to perform an ideal phase measurement is still lacking, even in principle. In this work, we implement a single-shot canonical phase measurement on a one-photon wave packet, which surpasses the current standard of heterodyne detection and is optimal for single-shot phase estimation. By applying quantum feedback to a Josephson parametric amplifier, our system adaptively changes its measurement basis during photon arrival and allows us to validate the detector’s performance by tracking the quantum state of the photon source. These results demonstrate that quantum feedback can both enhance the precision of a detector and enable it to measure new classes of physical observables.