Closed Bug 1840156 Opened 1 year ago Closed 1 year ago

Shopping toolbar button

Categories

(Firefox :: Shopping, task, P2)

task

Tracking

()

VERIFIED FIXED
118 Branch
Tracking Status
firefox118 --- verified

People

(Reporter: jhirsch, Assigned: fchasen)

References

(Blocks 1 open bug)

Details

(Whiteboard: [fidefe-shopping])

Attachments

(1 file, 1 obsolete file)

This bug covers creating a shopping page action button.

If the shopping experience is enabled, that is, browser.shopping.experience2023.enabled is true, then this button should appear in the URLBar when the user visits a supported product page.

If the shopping experience is disabled, that is, browser.shopping.experience2023.enabled is false, we don't want to show the page action button at all.

There is a pref that tells us whether a user has opted in or out of the experience, browser.shopping.experience2023.optedIn. (Note this is different from the browser.shopping.experience2023.enabled pref, which simply puts a user in the experimental population that might be shown the experience.)

If the browser.shopping.experience2023.optedIn pref value is false, then when the user visits a supported shopping page, we want to display the shopping page action button in an inactive state. (The sidebar will not pop open automatically in this case.)

If the browser.shopping.experience2023.optedIn pref value is true, then when the user visits a supported product page, the page action button will be shown in an active state, and the sidebar will appear.

Whenever the user clicks the page action button, the browser.shopping.experience2023.optedIn pref value should be flipped (note, this behavior may change in the next few days), and the button should toggle between active/inactive states.

Figma designs: https://www.figma.com/file/Wu4kaHSfKSQnzkym7qek3R/Shopping-Experience-MVP?type=design&node-id=67-23327&mode=design&t=VvOstFKWe7hwylJc-4

To notify your button component when the user arrives on a product page, you can make a call directly from either branch of the if (this._isProductPage) conditional here, inside the onLocationChange listener.

Explicit non-goals for this bug:

  • we don't yet have a final icon, so don't spend too much time styling the placeholder shopping cart svg; flipping a color is enough.
  • after the page action button is clicked, the sidebar toggling behavior is still not fully signed off, but flipping the pref is a good enough guess for now.

Implementation notes:

To notify your button component when the user arrives on a product page, you can make a call directly from either branch of the if (this._isProductPage) conditional here.

I would guess Gijs is the right person to review patches, as he's familiar with toolbar button code (I'm not sure if anyone else on the team is).

Severity: -- → S3
Priority: -- → P2
Summary: TBD Toolbar button → Shopping toolbar button
Assignee: nobody → fchasen
Status: NEW → ASSIGNED
  • Adds a urlbar button to toggle sidebar and show isProduct state
  • ShoppingSidebarManager.toggleSidebar() method to open and close sidebar
  • Add shopping cart svg
  • Adds a urlbar button to toggle sidebar and show isProduct state
  • ShoppingSidebarManager.toggleSidebar() method to open and close sidebar
  • Add shopping cart svg
  • Button only toggles sidebars in it's window
  • Sidebar status is stick when opening new windows
  • Sidebar status is saved to a pref for restoring
Attachment #9343587 - Attachment is obsolete: true
Attachment #9343528 - Attachment description: WIP: Bug 1840156 - Shopping toolbar button → Bug 1840156 - Shopping urlbar button r?#shopping-reviewers
Pushed by fchasen@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e9ef633550ad Shopping urlbar button r=shopping-reviewers,fluent-reviewers,desktop-theme-reviewers,Gijs,flod,jhirsch
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 118 Branch
Regressions: 1846750

Verified as fixed in our latest 119.0a1 (2023-08-28).

Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: