Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help: Fix chat ended experience #1714

Merged
merged 2 commits into from
Dec 18, 2015

Conversation

omarjackman
Copy link
Contributor

Fix "chat has ended" experience.

This pull request aims to fix the jarring experience a user might have when a chat has ended and there are no operators available.

Whats changed

  • Removed the operator availability notifications that currently show up inside of the olark chat widget.
  • Added calypso notifications to indicate olark operator availability when the chatbox is expanded or while viewing the contact form.
  • Show a notification within the olark widget immediately after an operator sends the !end command.
  • Allow the calypso notices to be dismissed.

How to test

Note: You must be in a group that has one operator

  1. Navigate to http://calypso.localhost:3000/help/contact
  2. Start a chat
  3. Leave the contact form by clicking on any link in the sidebar.
  4. Have the operator end the chat with the !end command.
  5. Have the operator set them self as "Away" in olark.
  6. Notice that the notification that operators went away now appears.
  7. Have the operator set them self as "Available" in olark.
  8. Notice that the notificaiton appears again saying that operators have returned.
  9. Collapse the olark widget and repeat steps 5 and 7. Notice that no availability messages were displayed because the olark widget is collapsed.

Before
screen shot 2015-12-17 at 4 50 46 am

screen shot 2015-12-17 at 2 43 58 am

screen shot 2015-12-17 at 2 44 15 am

After
screen shot 2015-12-17 at 2 06 56 pm

screen shot 2015-12-17 at 4 28 45 am

screen shot 2015-12-17 at 4 32 54 am

screen shot 2015-12-17 at 2 40 10 am

Fixes #1340
Fixes #1341
Fixes #1337

@omarjackman omarjackman added [Status] In Progress Live Chat [Feature Group] Support All things related to WordPress.com customer support. labels Dec 17, 2015
@omarjackman omarjackman self-assigned this Dec 17, 2015
@omarjackman omarjackman force-pushed the update/olark-operator-availability-notice branch 3 times, most recently from ce75090 to 7f250c2 Compare December 17, 2015 03:02
@omarjackman omarjackman force-pushed the update/olark-operator-availability-notice branch 5 times, most recently from b85f0ef to a18b52f Compare December 17, 2015 07:24
@omarjackman
Copy link
Contributor Author

cc @mtias @dllh review please

@omarjackman omarjackman added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. and removed [Status] In Progress labels Dec 17, 2015
@omarjackman omarjackman force-pushed the update/olark-operator-availability-notice branch 2 times, most recently from f9ddf51 to 9bb9f1c Compare December 17, 2015 09:41
@omarjackman omarjackman changed the title Help: Move operator availability notice Help: Fix chat ended experience Dec 17, 2015
@dllh
Copy link
Member

dllh commented Dec 17, 2015

I tested this a bit, and it's working well for me. Would rather have another set of eyes on the code, though it looked fine to my somewhat inexperienced eye.

@dllh
Copy link
Member

dllh commented Dec 17, 2015

I did some more testing and it still feels really good on the whole. I think it's a little weird still that in the case of no operators and and ended chat, we re-render the contact form with chat in the lower right and a notice rather than just showing the inline chat with some ui indicating that the chat is done (like what's displayed here), but I think that on the whole, this is a big improvement and we should try to get the code reviewed asap and get this merged.

@omarjackman omarjackman added [Status] In Progress and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Dec 17, 2015
@omarjackman omarjackman force-pushed the update/olark-operator-availability-notice branch 2 times, most recently from 99ca2ff to 39629b4 Compare December 17, 2015 19:12
@omarjackman omarjackman added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. and removed [Status] In Progress labels Dec 17, 2015
@omarjackman
Copy link
Contributor Author

I think it's a little weird still that in the case of no operators and and ended chat

@dllh this is fixed now.

@omarjackman
Copy link
Contributor Author

cc @mtias @dmsnell review please

@@ -78,7 +78,7 @@ var OlarkEventEmitter = {
*/
olarkEventListener: function( event, ...eventArguments ) {
debug( 'Olark event: %s', event );
this.emit( event, eventArguments );
this.emit( event, ...eventArguments );
Copy link
Member

Choose a reason for hiding this comment

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

This is a 0.5 out of 10 as far as being an important critique, but is eventArguments a little verbose when something like args seems like it would convey the same meaning?

olarkApi( event, ( ...args ) => this.olarkEventListener( event, ...args ) );


olarkEventListener( event, ...args ) {
    this.emit( event, ...args );
}

setExpanded( isOlarkExpanded ) {
dispatcher.handleServerAction( {
isOlarkExpanded,
type: ActionTypes.OLARK_EXPANDED
Copy link
Member

Choose a reason for hiding this comment

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

This is slightly confusing. Maybe OLARK_SET_EXPANDED would be a clearer indication that the action is doing something.

@dmsnell
Copy link
Member

dmsnell commented Dec 17, 2015

@omarjackman I left a few suggestions. Happy to go for a second pass when you need it.

@dmsnell dmsnell added [Status] Needs Author Reply and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Dec 17, 2015
@dllh
Copy link
Member

dllh commented Dec 17, 2015

I think the fixes for the last case I mentioned are a big improvement in terms of the interaction. I do have one more bit of feedback for it, but I'd not block the PR for this (would instead see about improving in a future PR). Here's what I see when opers are available and the chat ends:

ended-available

Looks great. If the oper then goes away, I see this:

ended-away

It's definitely better in my opinion that jumping back to the contact form with the chat box at lower right, but it's a little weird that it now shows the different offline form and doesn't have info pre-filled even though I'm logged in. I know that this is something Olark does, so we may be very limited in what we can do to fix it. This feels to me like an improved experience, so I'd be in favor of landing with this and then later exploring our options to improve it further.

@omarjackman omarjackman force-pushed the update/olark-operator-availability-notice branch from 39629b4 to 43c8929 Compare December 17, 2015 19:58
@omarjackman
Copy link
Contributor Author

@dmsnell all comments addressed. More review please.

@omarjackman omarjackman added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. and removed [Status] Needs Author Reply labels Dec 17, 2015
@dmsnell
Copy link
Member

dmsnell commented Dec 17, 2015

looks good on the code size @omarjackman. if there were one thing to mention it's that I probably wouldn't be declaring those new functions as such in the linear flow of the code as it is. I'd probably either create variables that are functions at the top of the scope or create those functions outside of the scope. it's strange to see a bunch of sequential code and then a function definition and then more sequential code

I did not test, so please merge at will as long as the testing is taken care of

… and discontinue showing these notices in the olark widget as visitor notices.

Also keep chat inlined if chat ends while on the contact form with no available operators.
@omarjackman omarjackman force-pushed the update/olark-operator-availability-notice branch from 43c8929 to 0953de4 Compare December 17, 2015 20:55
@omarjackman
Copy link
Contributor Author

if there were one thing to mention it's that I probably wouldn't be declaring those new functions as such in the linear flow

@dmsnell I moved it out of the function.

@omarjackman
Copy link
Contributor Author

@dmsnell @dllh can I git a 🚢 ?

@dmsnell
Copy link
Member

dmsnell commented Dec 17, 2015

🚢

@dmsnell dmsnell added [Status] Ready to Merge and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Dec 17, 2015
showAvailabilityNotice() {
const noticeOptions = { showDismiss: true };
const { isOperatorAvailable, isUserEligible, isOlarkExpanded, isOlarkReady } = olarkStore.get();
const onEligibleContactForm = isUserEligible && window.location.pathname === '/help/contact';
Copy link
Member

Choose a reason for hiding this comment

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

This is not a blocker now, but I find it odd to have this tied to a url from this place — seems like the route should choose to display the notice, not the module look at the route.

Copy link
Member

Choose a reason for hiding this comment

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

In other words, this seems like controller's business.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature Group] Support All things related to WordPress.com customer support.
Projects
None yet
5 participants