feat(remote): route a click on an attachable remote session to a terminal - #228
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 byjoining 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:
assertion fails.
Two existing tests changed, both honestly:
dom-sidebar-remote-session.test.jspinned "a remote click always opens thetranscript", 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.jsevaluates the real handler bodythrough
new Functionwith a named parameter list; the new helper had to bedeclared there or every call raised a swallowed
ReferenceError. A passthroughmock 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.jsfailed intermittently under fullsuite load, on a different test each run, including on
mainwithout thischange. That is #173.