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

Share/join/leave portals via popover menu #99

Merged
merged 64 commits into from
Oct 13, 2017
Merged

Share/join/leave portals via popover menu #99

merged 64 commits into from
Oct 13, 2017

Conversation

jasonrudolph
Copy link
Contributor

@jasonrudolph jasonrudolph commented Oct 10, 2017

Big picture

Using a slimmed-down variant of the mockups in #22, this PR will allow users to perform the following tasks via a popover accessed via the portal icon in the status bar:

  • Share a portal
  • Join a portal (click "join" and paste GUID)
  • See portal collaborators
  • Leave/close portal

Low-level task list

This is a partial list of outstanding tasks. We'll continue to flesh out this list as we work through this PR.

  • Always show exactly one portal icon in the status bar, regardless of portal state
  • Host portal:
    • User can toggle widget to share/close the host portal
    • User can see participant avatars
    • User can click "add guest" icon to see portal ID
    • User can click button to copy portal ID
    • User can click "x" icon to close portal ID section
  • Move sign-in modal into the popover
  • Guest portals:
    • Show joined portals
    • Allow to leave a joined portal
    • Allow to join a portal (click "join" and paste GUID)
  • Add appropriate tests
    • Add integration test that exercises the UI when signing in
    • Add integration test that exercises the UI when joining and/or leaving a portal
  • When sharing a portal:
    • Don't show notification
    • When triggered via command palette, reveal popover, and click the "share" toggle for the user.
    • Don't automatically copy portal ID to clipboard
  • Make commands "interact with the UI" as opposed to going down on a different code path
    • "Close portal" command will reveal popover and then user will see the "share" toggle automatically be toggled off. No notification shown.
    • "Join portal" command will reveal popover and then user will see the portal ID text entry focused prompting them to enter portal ID
    • "Leave portal" command => Remove this command. User can close tab to leave portal.
  • Gracefully handle large number of participants in a portal
  • Address all TODOs and FIXMEs that are present in the diff
  • Merge and publish Introduce client.onSignInChange and client.getLocalUserIdentity teletype-client#23, then depend on the newly published version

Deferred to future PRs

We want to also provide a legend that maps portal participants to their cursor colors. However, this PR is gonna be pretty big, so let's handle that enhancement in a follow-up PR.


Closes #18.

const manager = new PortalBindingManager({client, workspace})
const portalBindingPromise1 = manager.createHostPortalBinding()
const portalBindingPromise2 = manager.createHostPortalBinding()
assert.equal(portalBindingPromise1, portalBindingPromise2)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@as-cii: I added this test following our pairing session today. I don't know why it's failing. As far as I can tell, the two calls to manager.createHostPortalBinding() return the same Promise object, but this assertion is failing, so I must be overlooking something, . Any ideas what I might be doing wrong?

@jasonrudolph
Copy link
Contributor Author

The mockups in #22 show the guest avatars overlapping each other slightly. I tried that out locally, and in practice, I think I like it better without the overlap:

Overlapping guest avatars

screen shot 2017-10-10 at 8 01 37 pm

Non-overlapping guest avatars

screen shot 2017-10-10 at 8 03 18 pm


I'm gonna stick with the non-overlapping version for now.

@nathansobo
Copy link
Contributor

⚡️

Antonio Scandurra added 4 commits October 12, 2017 16:46
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>
We want to drive people toward the popover, while also ensuring that you
can perform common operations via a command or keyboard shortcut. In the
case of leaving a portal, the user can click the "leave" button in the
popover *or* they can close the portal tab (e.g., "command+w"). Both
actions will result in the user leaving the portal.
@jasonrudolph
Copy link
Contributor Author

  • 🐛 Don't show duplicate "@username has left your portal" notification

@as-cii: The bug that we observed ☝️ also exists on the master branch, so I opened #101 to track that bug. I think we should address it in a separate PR, so I've removed it from this PR's task list.

Antonio Scandurra added 8 commits October 13, 2017 11:04
With this commit we will now:

* Stop showing a notification on `real-time:share-portal`. Instead, the
popover will be revealed and we'll share the portal automatically on
behalf of the user. Note that we will also stop automatically copying
the portal id to the clipboard.
* Stop showing a notification on `real-time:close-portal`. Instead, the
popover will be revealed and we'll stop sharing automatically on behalf
of the user.
* Stop showing portal id prompt on `real-time:join-portal`. Instead, the
popover will be revealed and we'll focus the portal ID text entry on
behalf of the user.
# Conflicts:
#	package.json
Antonio Scandurra and others added 7 commits October 13, 2017 15:34
If you trigger the command when you're already sharing a portal, we
simply reveal the popover to remind the user that they already have a
portal open.
Prior to this change, if you closed the portal via the command palette,
we failed to hide the portal connection info.
@jasonrudolph jasonrudolph changed the title [WIP] Share/join/leave portals via popover menu Share/join/leave portals via popover menu Oct 13, 2017
@jasonrudolph jasonrudolph merged commit 3732ad2 into master Oct 13, 2017
@jasonrudolph jasonrudolph deleted the popover branch October 13, 2017 20:16
@Ben3eeE
Copy link

Ben3eeE commented Oct 13, 2017

👏 👏 👏 Works great. I love it!

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.

Review portal status bar UI/UX
4 participants