I wonder if a good distinction is user initiated actions versus system initiated. If the user begins the action, the changes are immediate and buffered to the interface that appears next.
But when the system initiates it (eg. notifications, popups), then the prior interface remains active.
This is not the only distinction, but it is one of them, and I think that one is a good idea. Another distinction is the results of the user initiated action, of whether the result is expected or unexpected, and that distinction is not always so clear.
I also really enjoyed your poems :) I aspire to have an interesting website like yours. I came back to read them again and your website was down though :(
The ceremony is caused not by typescript but your misuse of map. You don’t need to create perserverid as an object first. Instead you could flatten fe.blocks, and then filter by b.serverId and then map to a key,value array and use Object.fromEntries to turn this into a keyed object.
But when the system initiates it (eg. notifications, popups), then the prior interface remains active.
There's this paper studying this, and I think more work on it too.. https://dl.acm.org/doi/full/10.1145/3660338