My Ford focus keeps cutting out?

So I've got a ford focus 2.0tdci ghia and since I've changed the fuel filter the car cuts out all of a sudden every week or so.

At first, I thought it may be running too low on fuel, but the trip computer still says 40 miles and its done this the second time whilst the trip computer was saying 40 miles. We changed the fuel filter ourself thinking it'd be easy, but it was a disaster, and the car got airlocked. Eventually we got rid of the airlock by priming it and it was working fine, started ok, nice and easy.

A week later, it judders it 4th and loses power, then conks out. No restart whatsoever - we then called the AA and he started it up with some easy start fluid, he then saw the fuel lines and saw that air bubbles were coming in, when the fuel leaves the filter and goes in the engine.

After this, it was running fine again, then all of a sudden it just stopped. Same problem, called AA again and got it started, but we can see the air bubbles in the fuel line again. The AA guy goes it might be a cracked fuel line, but there's no sign of leaking diesel, as well as this he said it could also be the fuel housing where the filter is.

When it ran out, we looked at the fuel lines, and there was no fuel in there whatsoever, but then as we cranked the engine, it was trying to shoot up in the engine but was struggling.

What could be the problem here?

I'm taking it to the garage tomorrow, but I thought I'd get an opinion, I'm scared to driveitnow.

You have supplied the answer, at least for me you have. You changed the fuel filter. It has happened before that the old gasket sticks to the filter housing and you put another on with the new filter or if it is a canister type the gasket is not sealed tight. How you were able to prime the system you did not explain but I would go over everything you had your hands on and be sure it is tight. And I hope you know if it is a screw on filter you need to fill the filter with fuel before installing or you will have this type of trouble forever.