Closed
Bug 1097876
Opened 10 years ago
Closed 9 years ago
Collect UITelemetry about the Panic Button.
Categories
(Firefox :: Toolbars and Customization, defect)
Tracking
()
RESOLVED
FIXED
Firefox 38
Tracking | Status | |
---|---|---|
firefox38 | --- | fixed |
People
(Reporter: bwinton, Assigned: abhilashmhaisne)
Details
Attachments
(1 file, 5 obsolete files)
3.04 KB,
patch
|
florian
:
review+
|
Details | Diff | Splinter Review |
We're interested in how users engage with the PanelUI-panicView. Specifically, "Which time-option do they choose?" and "Do they click the Forget button, or cancel out of the panel?".
Reporter | ||
Comment 1•9 years ago
|
||
The panel is defined at https://dxr.mozilla.org/mozilla-central/source/browser/components/customizableui/content/panelUI.inc.xul#187 and the code that handles it is at https://dxr.mozilla.org/mozilla-central/source/browser/components/customizableui/CustomizableWidgets.jsm#990
Is this bug about this : https://addons.mozilla.org/en-US/firefox/addon/panic-button/
Flags: needinfo?(bwinton)
Reporter | ||
Comment 3•9 years ago
|
||
Good guess, but no. It's about https://support.mozilla.org/en-US/kb/forget-button-quickly-delete-your-browsing-history instead. :)
Flags: needinfo?(bwinton)
So what we need to do is collect UI Telemetry about quick forget button, such as how many times it was used, right? :)
Flags: needinfo?(bwinton)
Reporter | ||
Comment 5•9 years ago
|
||
Partially how often the button was clicked, but if you try it yourself, you can see that clicking the button opens a panel like this one: https://www.dropbox.com/s/rnakzparozmygfx/Screenshot%202015-02-09%2011.39.34.png?dl=0 and we're also interested in which option people choose at the top, and whether they click the "Forget!" button at the bottom (or not).
Flags: needinfo?(bwinton)
https://dxr.mozilla.org/mozilla-central/source/browser/components/customizableui/CustomizableWidgets.jsm#990 : In the code, there is a mention of sanitize.js, and frequent use of sanitize functions. What exactly does "sanitize" do?
Flags: needinfo?(bwinton)
Reporter | ||
Comment 8•9 years ago
|
||
The Sanitizer is the bit of code that clears out the requested parts of your history. I don't think we need to worry about it too much if we're logging UI events. :)
Flags: needinfo?(bwinton)
Okayz, so we need the count of how many times the "forget" button is pressed, and which option is selected out of the 3. UI events right :D
Reporter | ||
Comment 10•9 years ago
|
||
Yep, exactly! :D I think we'll want to make a function called something like countPanicEvent, and then call it when the Forget button is pressed. You can probably copy some of the code from https://dxr.mozilla.org/mozilla-central/source/browser/modules/BrowserUITelemetry.jsm#594 and edit it to make it do what you want. ;)
Reporter | ||
Updated•9 years ago
|
Assignee: nobody → abhilashmhaisne
Status: NEW → ASSIGNED
Assignee | ||
Comment 11•9 years ago
|
||
Just to make sure, this function "countPanicEvent" should also be written in BrowserUITelemetry.jsm, right? :)
Reporter | ||
Comment 12•9 years ago
|
||
Yep. Perhaps after the countSearchSettingsEvent function…
Assignee | ||
Comment 13•9 years ago
|
||
Umm, I wanted to ask, is this how you count the times panic button has been pressed : countPanicEvent: function(id, type, view_Id) { this._countEvent(["panic-button", id, type, view_Id]); },
Reporter | ||
Comment 14•9 years ago
|
||
It would be something like that, but there are a couple of changes… We already have something called "panic-button", so let's call it "forget-button" instead. And instead of passing in the id, type, and view_Id, let's pass in the id of the timeSpan they chose.
Assignee | ||
Comment 15•9 years ago
|
||
Okay, so like this : countPanicEvent: function(timeId) { this._countEvent(["forget-button", timeId]); },
Flags: needinfo?(bwinton)
Reporter | ||
Comment 16•9 years ago
|
||
Looks good to me! Do you know where you'll be calling the new function?
Flags: needinfo?(bwinton)
Assignee | ||
Comment 17•9 years ago
|
||
https://dxr.mozilla.org/mozilla-central/source/browser/components/customizableui/CustomizableWidgets.jsm#1010 I guess, inside the forgetButtonCalled function here. And I will have to declare a variable too right?
Flags: needinfo?(bwinton)
Reporter | ||
Comment 18•9 years ago
|
||
That looks right, and yes, you will probably need to declare a new variable. :)
Flags: needinfo?(bwinton)
Assignee | ||
Comment 19•9 years ago
|
||
So, this would be the variable and function call : let cnt = countPanicEvent(group); Now, how do I add it to UI Telemetry? I mean like panicButtonCount = result.something?
Reporter | ||
Comment 20•9 years ago
|
||
(In reply to Abhilash Mhaisne from comment #19) > So, this would be the variable and function call : > let cnt = countPanicEvent(group); I think we only want the "id" attribute of the group, not the whole element. > Now, how do I add it to UI Telemetry? I mean like panicButtonCount = > result.something? The "this._countEvent" call in "countPanicEvent" will add it for you! :)
Assignee | ||
Comment 21•9 years ago
|
||
Okay. So here we go : https://drive.google.com/file/d/0Bxoyzo1JAHpRNnVmZlE5eElaNHc/view?usp=sharing The number besides left, is nicely indicating how many times I click the forget button. However , the option selected is not being shown. And what is that "left" in panic-button?
Flags: needinfo?(bwinton)
Reporter | ||
Comment 22•9 years ago
|
||
Hmm. I don't see "forget-button" anywhere. Can you open the Browser Console (with Ctrl-Shift-J), and see if there are any errors when you click the forget button in the panel? The "left" tells us how many times you opened the panel with the left mouse button. :)
Flags: needinfo?(bwinton)
Assignee | ||
Comment 23•9 years ago
|
||
Yep, there is an error present, its called : Reference Error : countPanicEvent is not defined. "panic-button" is shown besides UI Telemetry, and the count is also coming.
Reporter | ||
Comment 24•9 years ago
|
||
Ah! So you'll notice that when we call the countSearchSettings function on this line: https://dxr.mozilla.org/mozilla-central/source/browser/base/content/urlbarBindings.xml#1014 we need to tell Javascript that it's defined on the BrowserUITelemetry object. I bet we need to do the same with the countPanicEvent function. :)
Flags: needinfo?(bwinton)
Assignee | ||
Comment 25•9 years ago
|
||
Okay, so I did that, but it now shows an error in the console, BrowserUITelemetry not defined. :)
Reporter | ||
Comment 26•9 years ago
|
||
Excellent! Progress! :) Can you post the diff of the code you have so far, just so that I can understand where we are? ('hg diff > bug1097876.diff' should show all your changes…)
Assignee | ||
Comment 27•9 years ago
|
||
Flags: needinfo?(bwinton)
Reporter | ||
Comment 28•9 years ago
|
||
Ah, I see what's happening… You'll need to import the BrowserUITelemetry into the CustomizableWidgets module. It should go up near the top of the file, and you can copy the couple of lines from here: https://dxr.mozilla.org/mozilla-central/source/browser/base/content/browser.js#15 Let me know if that fixes the problem! :)
Flags: needinfo?(bwinton)
Assignee | ||
Comment 29•9 years ago
|
||
https://drive.google.com/file/d/0Bxoyzo1JAHpRQk9jWUEtSWZlS0k/view?usp=sharing Done! :)
Flags: needinfo?(bwinton)
Reporter | ||
Comment 30•9 years ago
|
||
Alright, so one more change, and I think it will be good to ask for review! You'll notice in the UITelemetry that you have: "forget-button":{"[object XULElement]": 2} That's because you're passing the whole "group" element in to countPanicEvent. I think we only want the "id" attribute of the group, because that should be a more readable (and useful) value. ;)
Flags: needinfo?(bwinton)
Assignee | ||
Comment 31•9 years ago
|
||
Sir, I passed "group.id" to the function, so now the appearance is like this : "forget-button":{"PanelUI-panic-timeSpan":2} Good to proceed?
Reporter | ||
Comment 32•9 years ago
|
||
Well, it looks much more readable, but it doesn't tell us which time span was selected… Could you get the id of the selected radio element instead?
Assignee | ||
Comment 33•9 years ago
|
||
Ok, so I passed this to the function : BrowserUITelemetry.counPanicEvent(group.selectedItem.id) What happens is, no matter whatever radio is selected, it always shows: "forget-button":{"PanelUI-panic-5min":2} It always says 5min. How to fix that? :)
Reporter | ||
Comment 34•9 years ago
|
||
Hmm. I'm not sure. Can you post your latest set of changes, and I'll try running them here to see what I get?
Assignee | ||
Comment 35•9 years ago
|
||
Reporter | ||
Comment 36•9 years ago
|
||
Comment on attachment 8564557 [details] [diff] [review] bug_1097876.diff Review of attachment 8564557 [details] [diff] [review]: ----------------------------------------------------------------- I think I found it… :) ::: browser/components/customizableui/CustomizableWidgets.jsm @@ +1014,5 @@ > this._ensureSanitizer(); > this._sanitizer.range = this._getSanitizeRange(doc); > let group = doc.getElementById("PanelUI-panic-timeSpan"); > group.selectedItem = doc.getElementById("PanelUI-panic-5min"); > + let cnt = BrowserUITelemetry.countPanicEvent(group.selectedItem.id); What does the line immediately above this one do? ;)
Assignee | ||
Comment 37•9 years ago
|
||
I think it defaults the selected item to 5 min radio button, does it? :D :)
Reporter | ||
Comment 38•9 years ago
|
||
It does! But it also changes the selectedItem away from the one the user selected. :) So, if you move the countPanicEvent line up above that line, it should fix the problem!
Assignee | ||
Comment 39•9 years ago
|
||
Done sir! :) I am attaching the patch.
Assignee | ||
Comment 40•9 years ago
|
||
Collected UITelemetry about the panic(forget) button.
Flags: needinfo?(bwinton)
Attachment #8564685 -
Flags: review?(florian)
Reporter | ||
Comment 41•9 years ago
|
||
Awesome! I'm looking forward to seeing what Florian says! :)
Flags: needinfo?(bwinton)
Comment 42•9 years ago
|
||
Comment on attachment 8564685 [details] [diff] [review] bug_1097876.diff Review of attachment 8564685 [details] [diff] [review]: ----------------------------------------------------------------- ::: browser/components/customizableui/CustomizableWidgets.jsm @@ +1013,5 @@ > let doc = aEvent.target.ownerDocument; > this._ensureSanitizer(); > this._sanitizer.range = this._getSanitizeRange(doc); > let group = doc.getElementById("PanelUI-panic-timeSpan"); > + let cnt = BrowserUITelemetry.countPanicEvent(group.selectedItem.id); nit: double space between "cnt" and "=". @@ +1033,5 @@ > } else { > otherWindow.PanicButtonNotifierShouldNotify = true; > } > }); > + return cnt; Is this returned value ever used? ::: browser/modules/BrowserUITelemetry.jsm @@ +589,5 @@ > > countSearchSettingsEvent: function(source) { > this._countEvent(["click-builtin-item", source, "search-settings"]); > }, > + nit: trailing whitespace.
Attachment #8564685 -
Flags: review?(florian) → feedback+
Assignee | ||
Comment 43•9 years ago
|
||
Sorry, "return cnt" is never used. I am adding the new patch with changes mentioned above.
Flags: needinfo?(florian)
Flags: needinfo?(bwinton)
Assignee | ||
Comment 44•9 years ago
|
||
Assignee | ||
Comment 45•9 years ago
|
||
Attachment #8563490 -
Attachment is obsolete: true
Attachment #8564557 -
Attachment is obsolete: true
Attachment #8564685 -
Attachment is obsolete: true
Attachment #8565346 -
Attachment is obsolete: true
Flags: needinfo?(florian)
Attachment #8565347 -
Flags: review?(florian)
Comment 46•9 years ago
|
||
Comment on attachment 8565347 [details] [diff] [review] Collected UITelemetry about panic(forget) button. [Improved patch] Review of attachment 8565347 [details] [diff] [review]: ----------------------------------------------------------------- Thanks for the updated patch. ::: browser/components/customizableui/CustomizableWidgets.jsm @@ +1013,5 @@ > let doc = aEvent.target.ownerDocument; > this._ensureSanitizer(); > this._sanitizer.range = this._getSanitizeRange(doc); > let group = doc.getElementById("PanelUI-panic-timeSpan"); > + let cnt = BrowserUITelemetry.countPanicEvent(group.selectedItem.id); If it's never going to be used, you don't need the 'cnt' variable at all. ::: browser/modules/BrowserUITelemetry.jsm @@ +592,5 @@ > }, > > + countPanicEvent: function(timeId) { > + this._countEvent(["forget-button", timeId]); > + }, nit: keep an empty line before the _logAwesomeBarSearchResult method.
Attachment #8565347 -
Flags: review?(florian) → feedback+
Assignee | ||
Comment 47•9 years ago
|
||
Attachment #8565347 -
Attachment is obsolete: true
Attachment #8565365 -
Flags: review?(florian)
Comment 48•9 years ago
|
||
Comment on attachment 8565365 [details] [diff] [review] Collected UITelemetry about panic(forget) button. [Improved patch] Review of attachment 8565365 [details] [diff] [review]: ----------------------------------------------------------------- Thanks, looks good! :-)
Attachment #8565365 -
Flags: review?(florian) → review+
Assignee | ||
Comment 49•9 years ago
|
||
Thank you sir! :)
Reporter | ||
Updated•9 years ago
|
Flags: needinfo?(bwinton)
Reporter | ||
Comment 50•9 years ago
|
||
Okay, almost done. The next steps are to make sure the patch passes all our tests, and then add "checkin-needed" to the keywords, and someone will check it in for you! :) To make sure it passes all the tests, you should push the code to our Try Server, but since I don't think you can do that yet, I've taken the liberty of doing it for you. ;) You can watch it run here: https://treeherder.mozilla.org/#/jobs?repo=try&revision=8f85c5acc521 Once it shows all green, feel free to add the checkin-needed keyword. (If there are errors, needinfo me here, and I'll check them out and let you know what the next steps are.)
Reporter | ||
Comment 51•9 years ago
|
||
(As a side note, for your next patch, you probably want to read https://developer.mozilla.org/en-US/docs/Mercurial_FAQ#How_can_I_generate_a_patch_for_somebody_else_to_check-in_for_me.3F to make the patch easier for people to check in. ;) You'll also want to skip to the "If you don't want to use Mercurial Queues" section, because we're recommending people don't use Mercurial Queues these days.)
Reporter | ||
Comment 52•9 years ago
|
||
So I just checked, and the two errors we got seem intermittent, so you should be okay to add the checkin-needed keyword, Abhilash. :)
Comment 53•9 years ago
|
||
https://hg.mozilla.org/integration/fx-team/rev/80eced23e8e0
Whiteboard: [fixed-in-fx-team]
https://hg.mozilla.org/mozilla-central/rev/80eced23e8e0
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox38:
--- → fixed
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 38
You need to log in
before you can comment on or make changes to this bug.
Description
•