Where a tab standing on this edge belongs: just outside whichever drawer is open.
What the canvas gives up on its right for this bar, so a drawer can hand the slot back.
Step aside: the comment rail has taken the slot, this wide. Zero hands it back.
The tab: open the tools, and take the edge back to do it.
The edge holds one drawer at a time, and the tools are the Editing drawer — so pressing this tab from Commenting is a request to author, not a request to look at a panel the mode has switched off. It puts the mode back and folds the comment rail on the way.
Optionale: MouseEvent
Put the bar, its tab and the canvas where the current state says they go — once per frame.
One place rather than a branch per caller: the edge is shared with the comment rail now, and every one of open, folded, mode-hidden and stepped-aside has to leave the tab somewhere clickable — next to the rail's tab, never underneath it.
Coalesced, because switching drawers touches this edge twice in one tick: the mode change closes one, the event behind it opens the other. Written out as it happens, the tabs would travel to the window edge and back again, and the document would be laid out and redrawn on the way through. The intermediate state is real but nobody needs to see it.
A microtask and not requestAnimationFrame: both run before the browser paints, but frames stop in a background tab, and an editor left in one would come back with its drawers where they were two clicks ago.