I have an attitude that there's absolutely nothing I do that can't be improved. This may sound miserable on the surface, but for me it's actually quite freeing. It has the effect of making it easier to accept that things aren't actually going to be perfect (so it can help avoid the trap of over-engineering) and at the same time, it makes it much easier to have productive conversations with co-workers about what to improve/delete/rework because the existing product is something that could be better.
The other thing to think about, IMO, is that that PR comment, snarky or not, was something someone put the time in to come up with. For you. It's a gift. I've worked in places where getting any kind of PR comment beyond "approved" or "Fix your indenting" was an uphill battle. So getting a comment from a colleague that is meant to a) help make you better at what you do and b) help you both create something you can be proud of, is massively positive. It took time and effort for them to read what you did and think of a way to make it better.