Closed Bug 2029686 Opened 5 months ago Closed 5 months ago

Reduce unwanted sidebar auto-open via user preference

Categories

(Core :: Machine Learning: Frontend, enhancement, P1)

enhancement
Points:
2

Tracking

()

VERIFIED FIXED
151 Branch
Iteration:
151.2 - April 6 - April 17
Tracking Status
firefox150 + verified
firefox151 --- verified

People

(Reporter: Mardak, Assigned: yjamora, NeedInfo)

References

(Blocks 1 open bug)

Details

(Whiteboard: [genai])

Attachments

(2 files)

[Tracking Requested - why for this release]: providing user choice in mvp based on initial user research

ahead of bug 2029220 for mvp uplift, we can reduce some friction/annoyance by giving users choice of whether the sidebar defaults to open when navigating or generally switching pages

this involves both updating the logic probably in https://searchfox.org/firefox-main/source/browser/components/aiwindow/ui/modules/AIWindowTabStatesManager.sys.mjs

as well as showing a checkbox for a preference in https://searchfox.org/firefox-main/source/browser/components/preferences/config/aiFeatures.mjs and strings https://searchfox.org/firefox-main/source/browser/locales-preview/aiFeatures.ftl

here's a quick prototype from codex but we'll want official copy from katie

diff --git a/browser/components/preferences/config/aiFeatures.mjs b/browser/components/preferences/config/aiFeatures.mjs
index 2f255614a1e4f..b0b8b68087039 100644
--- a/browser/components/preferences/config/aiFeatures.mjs
+++ b/browser/components/preferences/config/aiFeatures.mjs
@@ -44,4 +44,5 @@ Preferences.addAll([
   { id: "browser.smartwindow.model", type: "string" },
   { id: "browser.smartwindow.preferences.endpoint", type: "string" },
+  { id: "browser.smartwindow.sidebar.openByDefault", type: "bool" },
   { id: "browser.smartwindow.tos.consentTime", type: "int" },
   { id: "browser.preferences.aiControls.showUnavailable", type: "bool" },
@@ -598,4 +599,8 @@ Preferences.addSetting({
   pref: "browser.smartwindow.firstrun.modelChoice",
 });
+Preferences.addSetting({
+  id: "openAssistantSidebarByDefault",
+  pref: "browser.smartwindow.sidebar.openByDefault",
+});
 
 {
@@ -1345,4 +1350,15 @@ SettingGroupManager.registerGroups({
     ],
   },
+  assistantSidebarGroup: {
+    l10nId: "ai-window-sidebar-section",
+    headingLevel: 2,
+    items: [
+      {
+        id: "openAssistantSidebarByDefault",
+        l10nId: "ai-window-open-sidebar-by-default",
+        control: "moz-checkbox",
+      },
+    ],
+  },
   memoriesGroup: {
     l10nId: "ai-window-memories-section",
diff --git a/browser/components/preferences/preferences.js b/browser/components/preferences/preferences.js
index 2add06c3d019f..f5b38006a8b98 100644
--- a/browser/components/preferences/preferences.js
+++ b/browser/components/preferences/preferences.js
@@ -258,5 +258,5 @@ const CONFIG_PANES = Object.freeze({
     iconSrc: "chrome://browser/skin/smart-window-mono.svg",
     badge: "beta",
-    groupIds: ["assistantModelGroup", "memoriesGroup"],
+    groupIds: ["assistantModelGroup", "assistantSidebarGroup", "memoriesGroup"],
     module: "chrome://browser/content/preferences/config/aiFeatures.mjs",
   },
diff --git a/browser/locales-preview/aiFeatures.ftl b/browser/locales-preview/aiFeatures.ftl
index 11e485c9568c7..d1cc8fd5030ee 100644
--- a/browser/locales-preview/aiFeatures.ftl
+++ b/browser/locales-preview/aiFeatures.ftl
@@ -55,4 +55,11 @@ smart-window-model-custom-save =
     .label = Save
 
+ai-window-sidebar-section =
+    .label = Assistant sidebar
+    .description = Choose whether the assistant opens automatically as you browse in Smart Window.
+
+ai-window-open-sidebar-by-default =
+    .label = Open assistant sidebar by default
+
 ai-window-memories-section =
     .label = Memories
Iteration: --- → 151.2 - April 6 - April 17
Priority: -- → P1
Attachment #9567060 - Attachment description: WIP: Bug 2029686 - Add preference to control Smart Window sidebar open → Bug 2029686 - Add preference to control Smart Window sidebar open r?omarg,mardak
Assignee: ogonzalez → yjamora
Pushed by yjamora@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/c7c3c771dbb8 https://hg.mozilla.org/integration/autoland/rev/8e2560109b14 Add preference to control Smart Window sidebar open r=omarg,fluent-reviewers,ai-frontend-reviewers,tgiles,flod
Pushed by sstanca@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/97e742a46f04 https://hg.mozilla.org/integration/autoland/rev/b18e52452019 Revert "Bug 2029686 - Add preference to control Smart Window sidebar open r=omarg,fluent-reviewers,ai-frontend-reviewers,tgiles,flod" for causing mochitests failures in browser_smartwindow_leak.js.

Reverted this because it was causing mochitests failures in browser_smartwindow_leak.js.

  • Revert link
  • Push with failures
  • Failure Log
  • Failure line: TEST-UNEXPECTED-FAIL | browser/components/aiwindow/ui/test/browser/browser_smartwindow_leak.js | Shutdown - leaked window until shutdown [url = chrome://browser/content/aiwindow/aiWindow.html]
Flags: needinfo?(yjamora)
Pushed by elee@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/592adcf5382d https://hg.mozilla.org/integration/autoland/rev/93c546a0ecb4 Add preference to control Smart Window sidebar open r=omarg,fluent-reviewers,ai-frontend-reviewers,tgiles,flod
Status: NEW → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → 151 Branch
Regressions: 2031027
Blocks: 2031027
No longer regressions: 2031027
Attachment #9569345 - Flags: approval-mozilla-beta?

firefox-beta Uplift Approval Request

  • User impact if declined/Reason for urgency: User will face unwanted sidebar that keeps popping out when navigating or generally switching pages in Smart Window.
  • Code covered by automated testing?: yes
  • Fix verified in Nightly?: yes
  • Needs manual QE testing?: yes
  • Steps to reproduce for manual QE testing: 1. Go to about:config
  1. set browser.smartwindow.enabled to true
  2. Toggle Smart Window
  3. Check if the Sidebar in Smart Window opens when navigating tabs or switching pages
  4. Go to about:config again
  5. set browser.smartwindow.sidebar.openByDefault to false
  6. Sidebar in Smart Window should not open anymore.
  • Risk associated with taking this patch: low
  • Explanation of risk level: It is low because the patch is for reducing some friction/annoyance by giving users choice of whether the sidebar defaults to open when navigating or generally switching pages
  • String changes made/needed?: Yes. Smart Window is only for English.
  • Is Android affected?: no
Flags: qe-verify+
Attachment #9569345 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
QA Whiteboard: [uplift][qa-ver-needed-c151/b150]
QA Contact: cgeorgiu

The issue is verified as fixed on latest Beta 150.0b10 and Nightly 151.0a1 with the steps from comment 8, using macOS 26, Ubuntu 26 and Win 11.

Status: RESOLVED → VERIFIED
QA Whiteboard: [uplift][qa-ver-needed-c151/b150] → [uplift][qa-ver-done-c151/b150]
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: