Posts, a community app by Read.cv

Thread
joe
joe @joeytee

i have such a niche help request but… has anyone ever worked on chat-bubble text-wrapping? I’m trying to figure out the rules how iMessage wraps text tightly around its bubbles—it’s not just max-width and sometime the second line of a bubble is longer than the first!

joe
joe @joeytee

I thought maybe the first line’s break point was maybe being used to define max-width for subsequent lines text wrapping, but that still creates large rags!

 @
Replying to @joeytee

Nah it’s some magic for sure. I spent a solid hour trying to figure it out a couple weeks ago for my own app and ended up totally confused, and just settled on max-width.

joe
joe @joeytee

hmm sharing what @andy posted and adding that I wonder if iMessage is somehow doing this balancer thing with ideal-width and max-width on frames? (I’m just hearing ideal width for the first time as an iOS term) react-wrap-balancer.vercel.app/

React Wrap Balancer
Simple React Component That Makes Titles More Readable