Closed Bug 1113896 Opened 10 years ago Closed 9 years ago

UITour: Hello panel isn't closing on icon click after being opened using showMenu("loop")

Categories

(Firefox :: Tours, defect)

defect
Not set
normal
Points:
2

Tracking

()

VERIFIED FIXED
Firefox 38
Iteration:
38.3 - 23 Feb
Tracking Status
firefox35 --- wontfix
firefox36 --- fixed
firefox37 --- verified
firefox38 --- verified

People

(Reporter: ckprice, Assigned: mikedeboer)

References

Details

(Whiteboard: [UITour:P2])

Attachments

(1 file, 2 obsolete files)

In development of the Hello product page - which also interacts with the Hello icon - we've come across an issue where the panel doesn't close as expected.

STR:

# Run in updated Nightly
# Set about:config values (requireSecure=false, browser.uitour.testingOrigins=https://www-demo2.allizom.org)
# Browse to https://www-demo2.allizom.org/en-US/firefox/hello/
# Click on the "TRY FIREFOX HELLO" CTA to bring down the Hello panel
# You can also open the Web Console to run the function manually

Issue: can't close panel by clicking on the Hello icon, clicking in the chrome, refreshing browser, changing tabs or clicking in the document

Expected behavior: should close like a standard panel.

:agibson can confirm, but we're not seeing this in the FTUE prototypes so far.

:dolske, how would you rate this on priority/ease to fix? The product page is 100% landing in GA 35.
Flags: needinfo?(dolske)
Flags: needinfo?(agibson)
Note: this happens both for loop.gettingStarted.seen = true and false.
> Issue: can't close panel by clicking on the Hello icon, clicking in the chrome, refreshing browser, changing tabs or clicking in the document

It is normal for UiTour to create "sticky" menus when calling showMenu(), this is by design as they have auto-hide set to false. The browser will automatically close the menu while changing tabs, however the web page can handle most other cases:

- Use Page Visibility API to hide the menu when the tab is not visible or the browser is minimized (this will also take care if refreshing the page etc). 

- Use a one time click handler on the document to close the menu once it is opened

The only way the Hello panel behaves any differently from calling say showMenu('appMenu') is that the panel does not close if you click the Hello icon. This I would consider a bug.

Hope that makes sense
Flags: needinfo?(agibson)
Thanks Alex - this make sense.

Jon, can we add Page Visibility API calls, and an event handler for document clicks in case this bug isn't fixed before Jan 13th?

+ Arcadio to keep informed.
Flags: needinfo?(jon)
Summary: UITour: Hello panel isn't closing as expected after being opened from showMenu("loop") on product page → UITour: Hello panel isn't closing on icon click after being opened from showMenu("loop") on product page
(In reply to Cory Price [:ckprice] from comment #3)
> Thanks Alex - this make sense.
> 
> Jon, can we add Page Visibility API calls, and an event handler for document
> clicks in case this bug isn't fixed before Jan 13th?

Yep, I've got these checks built in now.
Flags: needinfo?(jon)
Summary: UITour: Hello panel isn't closing on icon click after being opened from showMenu("loop") on product page → UITour: Hello panel isn't closing on icon click after being opened using showMenu("loop")
An alternative fix is to provide an optional argument to showMenu to disable sticky menus which would also fix this issue and is useful for things like the product page and snippets that don't want sticky menus. Then those pages don't need to handle clicks on the page themselves.

Btw. there isn't currently an API to close the Hello panel with the SocialFrame stuff but you can close it with a reference to the panel.
Blocks: 1117795
Putting this on the radar for RC 36. The campaign will be much more widespread (PR, snippets, etc).
Blocks: 1113400
Flags: needinfo?(dolske)
Marking this as a P2 for Hello 36 tours. Although it will not impede development, we're at risk for a much larger audience being exposed to this UX.
Whiteboard: [UITour:P2]
Assignee: nobody → mdeboer
Status: NEW → ASSIGNED
Iteration: --- → 38.2 - 9 Feb
Points: --- → 2
Did someone already mention once that UITour-lib.js is using single quotes for string literals, tabs for indentation and contains Windows newlines?
Just sayin'.
Attachment #8558465 - Flags: review?(jaws)
(In reply to Mike de Boer [:mikedeboer] from comment #8)
> Did someone already mention once that UITour-lib.js is using single quotes
> for string literals, tabs for indentation and contains Windows newlines?
> Just sayin'.

Blame http://hg.mozilla.org/mozilla-central/rev/491b452af425 for introducing the tabs for indentation. http://hg.mozilla.org/mozilla-central/rev/ca251a28d3dd was supposed to fix the Windows line endings, but I can't see where they were added back in. Want to add a patch to this bug that fixes these issues (a secondary patch)? I don't think it's worth it as a good-first-bug, since there is no way for the new contributor to confirm or test our their changes.
Comment on attachment 8558465 [details] [diff] [review]
Patch v1: add an option to auto-hide a panel that is shown with UITour.showMenu

Review of attachment 8558465 [details] [diff] [review]:
-----------------------------------------------------------------

::: browser/components/uitour/UITour.jsm
@@ +1410,5 @@
>        aOpenCallback(event);
>      }
>  
>      if (aMenuName == "appMenu") {
> +      aWindow.PanelUI.panel.setAttribute("noautohide", !aAutohide);

We should only set noautohide if aAutohide is true, otherwise we should remove the attribute. It's common in XUL to expect that the presence of an attribute is analogous to the value being true.

@@ +1435,5 @@
>          return;
>        }
>  
>        let panel = aWindow.document.getElementById("loop-notification-panel");
> +      panel.setAttribute("noautohide", !aAutohide);

Ditto.
Attachment #8558465 - Flags: review?(jaws) → review+
Comment on attachment 8558465 [details] [diff] [review]
Patch v1: add an option to auto-hide a panel that is shown with UITour.showMenu

Review of attachment 8558465 [details] [diff] [review]:
-----------------------------------------------------------------

::: browser/components/uitour/UITour.jsm
@@ +1410,5 @@
>        aOpenCallback(event);
>      }
>  
>      if (aMenuName == "appMenu") {
> +      aWindow.PanelUI.panel.setAttribute("noautohide", !aAutohide);

Sorry, I meant "we should only set noautohide if aAutohide is false. But the flip from noautohide (a poorly named attribute continued through legacy) to "autohide" is confusing. I'm usually against having booleans with a negation attached to them, but in this case I'd prefer that the argument be `aNoAutohide` since that should be pretty common to anybody working with XUL panels.
Comment on attachment 8558486 [details] [diff] [review]
Patch 2: adjust unit tests to not use 'noautohide' when showing the Loop panel

Review of attachment 8558486 [details] [diff] [review]:
-----------------------------------------------------------------

::: browser/components/uitour/test/browser_UITour_loop.js
@@ +35,5 @@
>        return loopButton.open;
>      }, "Menu should be visible after showMenu()");
>  
>      ok(loopPanel.hasAttribute("noautohide"), "@noautohide should be on the loop panel");
> +    is(loopPanel.getAttribute("noautohide"), "false", "@noautohide should be set to |false|");

This line should be removed and the one above it adjusted to use `!loopPanel.hasAttribute()`
Attachment #8558486 - Flags: review?(jaws) → review+
Comment on attachment 8558465 [details] [diff] [review]
Patch v1: add an option to auto-hide a panel that is shown with UITour.showMenu

Review of attachment 8558465 [details] [diff] [review]:
-----------------------------------------------------------------

(In reply to Mike de Boer [:mikedeboer] from comment #8)
> Did someone already mention once that UITour-lib.js is using single quotes
> for string literals

The library was originally trying to match www.mozilla.org style for the quotes.

::: browser/components/uitour/UITour-lib.js
@@ +196,5 @@
>  
>  		_sendEvent('showMenu', {
>  			name: name,
>  			showCallbackID: showCallbackID,
> +			autohide: autohide

I don't think we need another argument to control this. We just need to fix clicks on the Hello button to toggle visibility instead of always trying to show the panel. This is what we do with the appMenu button.
Attachment #8558465 - Flags: feedback-
Aaaah, much nicer. You were so right, Matt.
Attachment #8558465 - Attachment is obsolete: true
Attachment #8558486 - Attachment is obsolete: true
Attachment #8560422 - Flags: review?(MattN+bmo)
Comment on attachment 8560422 [details] [diff] [review]
Patch v2: toggle the Loop panel upon clicking the toolbar button

Review of attachment 8560422 [details] [diff] [review]:
-----------------------------------------------------------------

::: browser/base/content/browser-loop.js
@@ +41,5 @@
>  
> +    togglePanel: function(event, tabId = null) {
> +      if (this.panel.state == "open") {
> +        this.panel.hidePopup();
> +      } else {

IMO this would be nicer down a level in PanelFrame so other consumers benefit as it seems like something they would all benefit from. Since we want this for 36 and it needs to get uplifted very soon, I won't block on this.
Attachment #8560422 - Flags: review?(MattN+bmo) → review+
Pushed to fx-team as: https://hg.mozilla.org/integration/fx-team/rev/90ee83dcb817

Will work on moving this logic to PanelFrame.jsm in a follow-up that can be tracked on trunk.
Flags: qe-verify+
Flags: firefox-backlog+
Blocks: 1131001
Iteration: 38.2 - 9 Feb → 38.3 - 23 Feb
https://hg.mozilla.org/mozilla-central/rev/90ee83dcb817
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → Firefox 38
Comment on attachment 8560422 [details] [diff] [review]
Patch v2: toggle the Loop panel upon clicking the toolbar button

Approval Request Comment
[Feature/regressing bug #]: UITour for Fx36
[User impact if declined]: The user won't be able to close the Loop panel once it's been opened via the UITour. This patch also improves the general Loop toolbarbutton UX.
[Describe test coverage new/current, TreeHerder]: landed on m-c, tests pass.
[Risks and why]: minor
[String/UUID change made/needed]: n/a.
Attachment #8560422 - Flags: approval-mozilla-beta?
Attachment #8560422 - Flags: approval-mozilla-aurora?
QA Contact: catalin.varga
Attachment #8560422 - Flags: approval-mozilla-beta?
Attachment #8560422 - Flags: approval-mozilla-beta+
Attachment #8560422 - Flags: approval-mozilla-aurora?
Attachment #8560422 - Flags: approval-mozilla-aurora+
I verified this bug using the following environment:

FF 38
Build Id:20150219070749
Test Environment: https://www-demo2.allizom.org
OS: Win 7 x64, Mac Os X 10.10, Ubuntu 12.04 x86
Setting as qe-verify- since this was verified once on the demo environment.
Flags: qe-verify+ → qe-verify-
(In reply to Florin Mezei, QA (:FlorinMezei) from comment #22)
> Setting as qe-verify- since this was verified once on the demo environment.

Shouldn't it be marked as verified instead then? qe-verify- means it doesn't need to be verified which is different.
Status: RESOLVED → VERIFIED
Flags: qe-verify-
Flags: qe-verify+
Flags: needinfo?(florin.mezei)
(In reply to Matthew N. [:MattN] from comment #23)
> Shouldn't it be marked as verified instead then? qe-verify- means it doesn't
> need to be verified which is different.

Wanted to set qe-verify- so this no longer shows up on our lists of bugs that need verification. But you have a good point there Matthew. Could we perhaps keep the VERIFIED status and remove the qe-verify flag? That way we will know this was verified and it will no longer show up in our lists for fixes that need verification.
Flags: needinfo?(florin.mezei) → needinfo?(MattN+bmo)
(In reply to Florin Mezei, QA (:FlorinMezei) from comment #24)
> Could we
> perhaps keep the VERIFIED status and remove the qe-verify flag? That way we
> will know this was verified and it will no longer show up in our lists for
> fixes that need verification.

I haven't seen the qe-verify flag cleared before when verifying. The list of bugs to verify should exclude bugs with the VERIFIED status.
Flags: needinfo?(MattN+bmo)
(In reply to Matthew N. [:MattN] from comment #25)
> I haven't seen the qe-verify flag cleared before when verifying. The list of
> bugs to verify should exclude bugs with the VERIFIED status.

We don't exclude bugs with the Verified status because that includes bugs verified for example on Nightly and then uplifted, so that means bugs that would still need verification on Aurora or Beta (Beta usually being more important). To not generate more bugmail on this, I'll just keep a note on this and it's fine to keep it this way. Thank you Matthew!
Verified as fixed using:

FF 37 RC2
Build Id: 20150326190726
OS: Win 7 x64, Ubuntu 14.04 x86, Mac Os X 10.9.5
Verified on Firefox 38 according to comment 21.
See Also: → 1157846
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: