(In reply to Harry Twyford [:harry] from comment #0)
Verdi, could you please clarify what the expected behaviour is here? If the megabar is expanded and an icon is clicked, should the megabar collapse and subsequent icon clicks keep it collapsed? Or should it stay expanded no matter how many icons are clicked?
Yes, we should use the "focused and collapsed" state here. The bar should remain that way until the user focuses it again (clicks back inside, uses keyboard shortcut, starts typing a URL, etc.).
What should happen when icons are clicked when the megabar is collapsed?
It should remain in it's current state whether that's "unfocused & collapsed" or "focused and collapsed."
(In reply to Harry Twyford [:harry] from comment #1)
Currently, if the Urlbar is focused and the user clicks an identity icon, we blur the Urlbar. If the icon is clicked again to hide the doorhanger, we re-focus the Urlbar but at the beginning of the string (not where the cursor was previously). This might be a good opportunity to fix this slightly weird behaviour. For example, we could select the entire string when the identity icon is clicked the second time, instead of putting the cursor at the beginning.
Yes, let's do that — select the entire string when the identity icon is clicked the second time.