As usual, I'm baffled and bewildered.
I don’t tip on anything I bring up to a register myself, or anything that’s prepackaged at a coffee shop even if the fridge (or whatever) is behind the counter. When someone makes something for me I’ll tip a dollar or two depending whether I’m being a real PITA with the complexity of my order. Taking a cab home from the train station recently (I’m in Philly) I downloaded the taxi app and set it to automatically tip 30%, with which I surprised myself, but... taxis are cheap? And underutilized? And the drivers all work so hard
I'm so old that I remember people saying "keep the change". Tips were (usually) small generosities. The tip jar was a creation of the now-so-old cash economy.
But your specific example - buying a bag of coffee beans - is almost too easy for me. I never tip when buying groceries. I rarely tip for buying a "thing". I tip for services, not for products. Nobody tips at Best Buy or CVS. If a transaction takes place at a cash register, I am unlikely to feel very served, merely sold to.
I tip on every service because it's hard out here. A friend recently worked at a popular ramen restaurant in Little Tokyo. He had to give even his cash tips to the managers and some nights he'd only get $3 back.