Here’s something I see a lot in manuscripts and although it’s not a strict rule, it’s just something to consider in tweaking your sentence structure to make the writing flow more smoothly in time. It’s very possible you mean for the action to be happening before the speech, but if you place it after the speech, it will feel as if the character first stops speaking, then acts. So unless sequence in time requires otherwise, always try to put action before speech:
“I knew you were going to say that.” John sighed and slapped the table.
John sighed and slapped the table. “I knew you were going to say that.”
If the speech spurs on an action, then you’ll want to put it after the speech:
“I can do that in a split second!” Cindy snapped her fingers in Bill’s face, then marched out the door.