When combined with the dictionary form of verbs, ところだった
will indicate that something was about to happen, and will regularly be translated as ‘was just about to do (A)’, or ‘was in the middle of (A)’. In many cases, ところだった
will indicate either a positive or negative result that came about from ‘not doing (A)’.
As this grammar pattern is a combination of ところ ‘place’, and the past tense of だ, だった; it will put put emphasis of ‘having been in the place or situation of (A)’, before something happened that caused the expected result to change.
That was close. I was about to run over that person.
If I woke up 3 minutes later, I would have been late.
In cases where a positive result was narrowly missed out on, のに will often appear directly after ところだった. This can be interpreted as ‘despite almost doing (A), (B)’.
I was just about to leave the house now, but it suddenly started raining, so I am going to wait until the rain stops.
The killer was just about to confess, but you went off on a tangent...