Skip to content

feat(remote): route a click on an attachable remote session to a terminal - #228

Merged
devsuitup merged 1 commit into
mainfrom
remote-attach-click-routing
Sep 8, 2026
Merged

devsuitup merged 1 commit into
mainfrom
remote-attach-click-routing

Conversation

@devsuitup

Copy link
Copy Markdown
Owner

Follow-up to #221, which added the attach path but left it unreachable: the
renderer routed every remote session click to the read-only transcript, so the
new code was dead from the user's point of view.

A remote session now carries remoteAttachable, computed in the main process by
joining the descriptors already fetched each cycle (getRemoteSessions(alias))
to the sidebar rows by session id, and asking the adapter whether it supports
that descriptor. The click routes on that boolean: attachable opens a terminal,
anything else opens the transcript as before, with the reason on hover.

The renderer never names a multiplexer — it consumes a boolean decided upstream.
That is the point of the descriptor-driven design, and a test asserts the title
cannot leak the name.

Verification

Three mutations, each printed before the run and restored from an md5-verified
copy:

  1. Routing condition reverted to "always transcript" → the attachable test fails.
  2. Routing condition disabled → the non-attachable test fails.
  3. The hover reason changed to mention a multiplexer by name → the leakage
    assertion fails.

Two existing tests changed, both honestly:

  • dom-sidebar-remote-session.test.js pinned "a remote click always opens the
    transcript", which is exactly the behaviour being changed. It is kept for the
    no-live-descriptor case, which is unchanged, plus assertions on the reason.
  • get-projects-cold-start-reconcile.test.js evaluates the real handler body
    through new Function with a named parameter list; the new helper had to be
    declared there or every call raised a swallowed ReferenceError. A passthrough
    mock is supplied; the populate/reconcile logic it guards is untouched.

task check: 1132 passed, 0 failed, 8 pre-existing skips.

Noted, not fixed here: trigger-watcher.test.js failed intermittently under full
suite load, on a different test each run, including on main without this
change. That is #173.

remote-attach.js has carried a working tmux-attach adapter since #227,
but the sidebar sent every remote-session click to the read-only
transcript unconditionally, so the path was unreachable from the UI.

Join the sidebar's remote sessions to the indexer's live descriptors in
main.js's get-projects handler (new annotateRemoteAttachable(), next to
where remoteIndexer and remoteAttachAdapter already live) and expose the
result to the renderer as a plain boolean, session.remoteAttachable --
named for what the renderer is allowed to know, not for how attach is
implemented. The renderer only branches on that boolean; it never
inspects or names the underlying mechanism. A non-attachable remote
session keeps falling back to the transcript and now says why via a
hover title, matching the disabled-control idiom already used for a
missing project path.

Refs #221
@devsuitup
devsuitup enabled auto-merge (squash) September 8, 2026 15:11
@devsuitup
devsuitup merged commit 61fa49e into main Sep 8, 2026
9 checks passed
@devsuitup
devsuitup deleted the remote-attach-click-routing branch September 8, 2026 15:17
@devsuitup devsuitup mentioned this pull request Sep 8, 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.

1 participant