It was most likely a scintillating scotoma, a kind of visual aura associated with migraine.
The migraine can come without headache, in which case I’ve heard it’s called retinal migraine. I had a similar experience, also thought I had a stroke. Went to the ER where they did MRI and then referred me to an ophthalmologist which immediately recognized what I described. I’ve had it a few times since, mostly during periods of high stress and bad sleep. Nothing to worry about once you know what it is.