IMHO this is a case of two wrongs not making a right. And blurring of boundaries.
She’s at work. Her job is to serve customers. If she doesn’t serve you promptly, exchange brief pleasantries, then leave you in peace, no doubt she’s not doing her job as expected. Though it sounds like the sort of pub where bar staff chat as mates with the regulars.
And you also say she’s a friend. Some people are more chatty. We should all be able to vent a bit to friends. But she’s clearly not realising you’re in the pub as a customer, rather than to chat to her.
So, you should be more assertive, rather than passive aggressive. It was rude to make a noise rather than interjecting calmly, politely and assertively:
”Sorry to interrupt. Could I have a drink, please. I want to go and sit down”
”Sorry to interrupt. We’re here for a quiet drink. Could I chat to you some other time”
She obviously struggles to understand social norms and good customer service. When people clearly don’t realise, it’s best to let them know if it bothers you if you’re being reasonable. As she’s texted you, I’d use the opportunity to let her know directly:
“I’m sorry I was rude and spoke to you about this in front of other customers. I realise it embarrassed and blindsided you when we’re friends. I was frustrated, as you were talking a lot rather than serving me. I should have let you know more discretely that when I come to the pub, it’s for a drink, rather than a chat. It’s always good to see you. But I usually want to get my order and sit in peace. I also feel awkward when you tell me private things about your ex. I should have made all this clear before, but I didn’t want to hurt your feelings”.
She may get shirty and offish with you for being direct with her. Or she may keep doing it when she knows how you feel. In either case, she’s hard work and I’d give her a wide berth. But also try to see it with a bit of humour. We all know chatty people where it’s harder to get a word in. Better that, IMHO, than people who barely say a word.