If you know a person does not like being interrupted don't be selfish and write a message. Why does your productivity matter more than mine?
I was a naive intern at my first paid software gig, so I towed the line, but I watched as a startup went from hiring some very smart people to the engineers realizing they could come in at 11 hungover and leave at 4 because they were all smart, management was treating them like crap and they couldn't just fire everyone. There were other issues, but power tripping over personal productivity and not giving engineers time for help or questions about the business was a huge issue at that job.
This is not a promotion of the anti-WFH control busy body managers, but just know if your coworkers are asking you questions so they can do their job you should be mentoring them so they need to ask less questions. If you're the type to answer a slack message hours later, people are slowly growing to hate you and will eventually sabotage you.
I feel like people don’t treat achieving business goals as part of their job in dev. I’ve never had people treat this as a problem across other job roles.
Of course people should make themselves available and not be jerks but I strongly believe that a culture that encourages unrestricted interruptions will achieve worse business outcomes in the long run.
I do believe that there is room for better tools in this area, and I'm working on it. Tools that help users solve their problems collaboratively without imposing undue burden on their coworkers.