update
Replaces the contents of the frame handle refers to, in place — keeping its position, and thus its precedence, in the stack. Use this instead of remove + push when a still-mounted frame's scope/screen/section changes: re-pushing would move the frame to the top and let it wrongly override inner frames that are still on the stack. A no-op (and no snapshot churn) if the contents are unchanged, the handle was already removed, or it belongs to another stack.
The arguments are replaced, not merged: omitting one clears it. Changing screen also ends the frame's visit (AmbientContext.screenViewId); an unchanged one, or a new section, keeps it.
This revises scope/screen/section only. It never changes the frame's parent link (reparent), whether it is masked (setScreenMasked) or whether it is active (setActive) — a pipeline revising what a frame says must not move it to another lineage or flip either switch by accident. Note the consequence while a frame is masked: a screen written here is stored but does not resolve until the mask is lifted, because the mask wins in recompute.
To un-mask, use setScreenMasked; remove + push is not a way to. Re-pushing is the very thing the paragraph above rules out: the replacement lands at the end of the list, so a container that un-masked this way would out-rank the inner frames its own content is still holding — measured, screen went to the container while its Detail content was on display. It also strands anything pushed with parent = the removed frame on a dangling link, which drops that subtree's scope entirely ({container, child} became {}).