Automattic / Automattic/happychat-client

Confusing message during page unload

Open
#341 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
13
Forks
5
PR merge metrics
No merged PRs in 30d

Description

When browsing away from HC, or refreshing the page, the user sees a popup confirming they want to leave the site. This is the generic message from each browser.

**Chrome**
![image](https://user-images.githubusercontent.com/7596032/146818266-373cede9-1348-40c6-9e93-7432b98ee562.png)

**Firefox**
![image](https://user-images.githubusercontent.com/7596032/146818288-dc4d5914-2e88-4815-9e4e-37133f1f11c3.png)

**Safari**
![image](https://user-images.githubusercontent.com/7596032/146818313-805c8eb7-ea5a-4a52-a8ab-da7d3a9c6ba9.png)

This is being triggered in the HappychatForm component, and has an actual message to display:

https://github.com/Automattic/happychat-client/blob/2b1f59e5b5ab7bc3f081941f8eecfbd3bb68d25d/src/ui/components/happychat-form/index.js#L47-L50

However, that message is no longer displaying.

If you refresh [the support page on WooCommerce.com](https://woocommerce.com/my-account/create-a-ticket/), or leave and come back with chat still active on HUD, the chat is still there, so this alert may not be needed any more. If we keep it, it should be updated to display something less confusing.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in src/ui/components/happychat-form/index.js at lines 47-50 and inspect how the page-unload handler is triggered. Reproduce the alert while refreshing or leaving the WooCommerce support page, then determine whether the alert is still needed given that active chat persists. Done means the resulting behavior no longer shows a confusing prompt, or the prompt displays an appropriate message.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.