Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Allow guests to use fuzzy-finder to open any remote editor shared by the host #323

Merged
merged 39 commits into from
Feb 28, 2018

Conversation

jasonrudolph
Copy link
Contributor

@jasonrudolph jasonrudolph commented Feb 9, 2018

Depends on atom/teletype-client#52

Description of the Change

In conjunction with atom/teletype-client#52 and atom/fuzzy-finder#335, this pull request implements the necessary atom/teletype changes to deliver the following functionality for #268:

  • Allow guests to use fuzzy-finder to open any remote editor shared by the host

Notable details

  • Teletype now provides a service that other packages can consume to fetch a list of remote editors. (See lib/teletype-service.js.) The fuzzy-finder package will consume this service.
  • When a guest closes the last remote editor, Teletype no longer automatically leaves the portal. Instead, the guest has the flexibility to open another remote editor in the portal using the fuzzy-finder, or use the Teletype popover in the status bar to leave the portal.
  • When the host focuses a non-editor component (e.g., the "settings" view, the markdown preview pane, the git commit staging view), guests no longer see the message saying "@<hostname> is doing something else right now." Now that guests can switch to an arbitrary open buffer on the host, the old behavior represents unnecessary complexity.

Verification Process

  • Clone this pull request and apm link it.
  • Clone Use fuzzy-finder to open remote editors in Teletype portals fuzzy-finder#335 and apm link it.
  • Open two Atom windows.
  • Create a portal on Window 1 and open several tabs/files.
  • Join that portal on Window 2 and open the fuzzy-finder via:
    • cmd+b, to show all the buffers you've opened locally (including the remote ones).
    • cmd+t, to show all local files as well as all the tabs that are currently open on the host.
  • Open files via the fuzzy-finder commands above.
    • Open files that were already open on the guest.
    • Open files that were not already open on the guest.

Bonus feature: now Pane: Reopen Closed Item works with remote tabs too!

TODO


🍐'ed with @as-cii

Antonio Scandurra and others added 26 commits December 18, 2017 17:34
This new method will later be exposed as a service so that clients like
fuzzy-finder can use the data stored in a teletype session.

Signed-off-by: Jason Rudolph <jasonrudolph@github.com>
Signed-off-by: Jason Rudolph <jasonrudolph@github.com>
Signed-off-by: Jason Rudolph <jasonrudolph@github.com>
Signed-off-by: Jason Rudolph <jasonrudolph@github.com>
Signed-off-by: Jason Rudolph <jasonrudolph@github.com>
Signed-off-by: Jason Rudolph <jasonrudolph@github.com>
Co-authored-by: Antonio Scandurra <as-cii@github.com>
We can only open local editors for which a remote editor already exists,
so it makes sense to expose editors instead of remote buffers. In the
future we may want to decouple remote editors from local editors (e.g.
if we want to allow opening arbitrary files that aren't necessarily in
the host's workspace), but we will probably expose a different API for
that when that time comes.
Co-authored-by: Jason Rudolph <jason@jasonrudolph.com>
Co-authored-by: Jason Rudolph <jason@jasonrudolph.com>
Previously we used to show the empty portal pane item to indicate when
the leader was doing something else. Now that guests can switch to an
arbitrary open buffer on the host, this behavior adds extra complexity
without providing the same value as before.
Guests can use the fuzzy-finder to browse to open buffers on the host.
Also, exercise `getRemoteEditors` via an integration test to ensure we
interact with teletype-client correctly.

Co-authored-by: Jason Rudolph <jason@jasonrudolph.com>
Co-authored-by: Jason Rudolph <jason@jasonrudolph.com>
Co-authored-by: Jason Rudolph <jason@jasonrudolph.com>
Co-authored-by: Jason Rudolph <jason@jasonrudolph.com>
Co-authored-by: Jason Rudolph <jason@jasonrudolph.com>
Co-authored-by: Jason Rudolph <jason@jasonrudolph.com>
Co-authored-by: Jason Rudolph <jason@jasonrudolph.com>
Co-authored-by: Jason Rudolph <jason@jasonrudolph.com>
Instead of using `removeEditorProxy` to understand whether an editor was
removed manually or not from a guest portal, we are moving the code that
manages the destruction of an editor from EditorBinding to
GuestPortalBinding.

This allows to understand the order in which the editor and the editor
proxy destruction events occur. If the former occurs before the latter,
it means that the user has manually destroyed the editor. If the events
occur in the opposite order, it means that the host has destroyed the
editor. These events are then used to determine whether the tether
should be detached after the active pane item changes.

This refactoring will pave the way to remove `addEditorProxy` and
`removeEditorProxy`.
@as-cii as-cii merged commit 6bae0f4 into master Feb 28, 2018
@as-cii as-cii deleted the fuzzy-finder-support branch February 28, 2018 08:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants