It's also worth mentioning that this diagram doesn't capture dataflow or the relationships between the subsystems needed to make this work. The logic for notifications requires interaction with user preferences, channel membership, comment parsing, thread management, and more[0].
All told, you may still be looking at (low) thousands of lines of code, with maybe 1.5-2x times that amount for test code.
[0] I'm just guessing how the app is structured internally. I have no idea what it is actually like.
Also now should include adding random old stuff to notification.
I would also imagine that there are a variety of other features which require similar flow charts.
Code is generally the easy part once you know exactly what you're doing.
Not least because it's really the product designer and product owner's job to make this kind of chart.
A large fraction of the time, the PM just goes "that is correct", and the spec / ticket / whatever gets updated. When the answer is not "that is correct", you do lose out on whatever work you've done since sending that message, but writing code you eventually throw away isn't the end of the world. Also "that is not correct" responses often highlight areas where either the developer misunderstood what the PM was envisioning or the PM has a misunderstanding of what the system can do or how their proposed feature interacts with something else.
For this to work, you need:
1. Some variety of asynchronous channel that the developer can push stuff into at whatever frequency they want, and that the PM periodically catches up on entirely.
2. The developer to have a working understanding of how existing systems work and the system as a whole, from the business level.
3. The flexibility to modify specifications between the initial conception and implementation.
If you have all of those things, the PM doesn't necessarily need to think through the entire workflow beforehand -- it's nice if they can do that, but you can still ship working features without that and sometimes that is the pragmatic way to do it.
Systematically articulating all of these different conditions isn't necessarily the strong suit of a PM, but they're generally quite capable of understanding and providing input to such documents.
Apologies to William James' apocryphal quote.