How to get diagnostic/warning if content has been clipped?

Well, I guess then panic() will do a great job preventing you from badly laid out badges.

You can also check out Using Typst for event badges and etykett – Typst Universe.