Skip to content

Gate overlay and ask handoff on the origin's pane lead - #661

Merged
umputun merged 2 commits into
masterfrom
overlay-lead-routing
Sep 26, 2026
Merged

umputun merged 2 commits into
masterfrom
overlay-lead-routing

Conversation

@umputun

@umputun umputun commented Sep 26, 2026

Copy link
Copy Markdown
Owner

the origin handed every new session overlay and ask to whichever attached Mac held the presenter role, whether or not anyone was working there. After coming back to the origin and taking a pane's lead back, a --block overlay ran on the origin but drew on the other Mac's screen, so nothing showed locally and the caller waited until a manual close.

the handover now also requires the origin's pane to report follower: the target pane for a pane-scoped overlay or ask, every existing pane for a session-wide one. A pane that leads, is unowned, or never reported a role (a daemon predating the lead patch) keeps the request local. One already handed over stays where it is when the lead changes, so close, resize and result keep working against it.

the rule lives in one internal Session.followsRemotely predicate that both AppStore.openRemoteOverlay and AppStore.presentAskRemotely check. Core tests cover the role matrix, swapped pane identities and the lifecycle after a lead change; the hosted presenter fixtures seed the follower role, and new hosted cases check that the control server falls through to a local overlay, terminal ask and GUI ask.

known limit, unchanged: the presenter role still goes to the first attached Mac, so with two viewers an overlay can reach the one holding the role rather than the one leading the pane.

the origin handed every new overlay and ask to whichever attached Mac held the presenter role, even after the user came back to the origin and took the lead. A `--block` overlay then ran on the origin but drew on the other Mac's screen, so nothing showed locally and the caller waited until a manual close.

the handover now also requires the origin's target pane to report `follower`, or every existing pane for a session-wide overlay or ask. A pane that leads, is unowned, or never reported a role keeps the request local. One already handed over stays where it is when the lead changes.

the hosted presenter fixtures seed the follower role, and new hosted cases cover the local fall-through for an overlay, a terminal ask and a targeted GUI ask.
…not guarantee

the app-side overlay and ask wrappers still said nil meant no viewer presents the session. They now also return nil while a presenter exists, so the doc comments say nil leaves the request to the caller here. The guide said a request that stays local opens on the origin, which a hidden GUI ask never does; it now says the request stays there.
Copilot AI lite review requested due to automatic review settings September 26, 2026 20:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@umputun
umputun merged commit bb74d60 into master Sep 26, 2026
8 checks passed
@umputun
umputun deleted the overlay-lead-routing branch September 26, 2026 20:59
nickalie added a commit to nickalie/agterm-linux that referenced this pull request Sep 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants