Tags: duckduckgo/Android
Tags
Create tag 5.281.1.8-internal for internal release.
Create tag 5.281.1.7-internal for internal release.
Create tag 5.281.1.6-internal for internal release.
Create tag 5.281.1.5-internal for internal release.
Create tag 5.281.1.4-internal for internal release.
Create tag 5.281.1.3-internal for internal release.
Hide Duck.ai toggle in chat, show back arrow with sidebar (#8699) Task/Issue URL: https://app.asana.com/1/137249556945/project/1214157224317277/task/1215159003631557?focus=true ### Description Two related navigation tweaks from the iOS Ship Review fallout that apply to Android — both small, both in service of the broader "Duck.ai opens in a new tab" model that the next PR delivers. 1. **Hide the Search/Duck.ai toggle inside a chat.** The toggle row only makes sense in the browser context now that Duck.ai will open in a new tab; keeping it visible inside chat would spawn a new tab on every toggle interaction. `NativeInputState.toggleVisible` already excluded the contextual sheet — this extends the rule to the fullscreen chat, phrased positively as `inputContext == BROWSER`. `applyOmnibarShape()` used `toggleVisible` to short-circuit and implicitly covered DUCK_AI; its guard is narrowed to `inputContext != BROWSER` so DUCK_AI fullscreen doesn't fall through to the minimized-pill card styling. 2. **Show the back arrow whenever the chat-history sidebar is visible.** The back arrow next to the sidebar only appeared when the user had the unified input on but the Search/Duck.ai toggle setting off — a narrow Search-Only case. With the toggle on (Search & Duck.ai), the arrow stayed hidden, leaving no consistent way back to the previous tab while viewing a chat. Tying the arrow to the sidebar's own visibility makes both appear and disappear together; focus and voice-mode gating still sit on `showDuckAISidebar`. `isDuckAiBackAvailable` has no other consumers, so it and its dedicated tests are removed. Companion Asana task for #2: https://app.asana.com/1/137249556945/task/1215159003631561 ### Steps to test this PR _Toggle hidden in chat_ - [x] Open the app with the unified input enabled. - [x] Tap the input to focus it on a browser tab; the Search/Duck.ai toggle row appears. - [x] Submit a Duck.ai query (or open a Duck.ai chat). Inside the chat, focus the input again. - [x] Confirm the Search/Duck.ai toggle row is not shown. - [x] Open the contextual sheet over a webpage; toggle is still hidden as before. - [x] Open the input on a normal browser tab again; the toggle reappears. _Back arrow alongside the sidebar_ - [x] Enable the Search/Duck.ai toggle setting (Settings → Duck.ai). - [x] Open a Duck.ai chat from anywhere (omnibar, history, etc.). - [x] Confirm both the chat-history sidebar icon and the back arrow are visible to the left of the address bar. - [x] Disable the Search/Duck.ai toggle setting and repeat — both icons still visible. - [x] Focus the input on the chat tab; both icons hide together. Defocus; both reappear. - [x] Start voice mode; both icons hide. Exit voice; both reappear. ### UI changes | Before | After | | ------ | ----- | !(Upload before screenshot)|(Upload after screenshot)| <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > UI and visibility rules in omnibar and native input only; no auth, networking, or data-layer changes. > > **Overview** > Aligns Duck.ai omnibar and unified input behavior with **Duck.ai in its own tab**: the Search/Duck.ai toggle only appears in **browser** context, and the control beside chat history tracks the sidebar instead of a narrow “search-only + native input” case. > > **Unified input:** `NativeInputState.toggleVisible` is now true only when `inputContext == BROWSER` (fullscreen chat and contextual sheet no longer show the toggle). `NativeInputModeWidget.applyOmnibarShape()` applies minimized-pill card styling only in browser context so fullscreen Duck.ai does not inherit that shape. Tests reflect toggle hidden in Duck.ai chat. > > **Omnibar:** `showDuckBack` matches `showDuckAISidebar` (sidebar and back/close control show and hide together). `isDuckAiBackAvailable` and its dependency on the input-screen user setting are removed, along with related ViewModel tests. `duckAiBack` uses the **close** icon instead of the back arrow. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 65f05dc. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: David Gonzalez <malmstein@Davids-MacBook-Pro.local> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Create tag 5.281.1.2-internal for internal release.
Fix native input regressions in search-only mode (#8677) Task/Issue URL: https://app.asana.com/1/137249556945/project/1214157224317277/task/1214970032476125?focus=true ### Description Two regressions reported under "Android: Ship Review Feedback" (AV3, AV4) in the toggle-disabled (search-only) configuration with the native input widget. **AV3 — Duck.ai icon tap reloads the page.** On a loaded page (e.g. bbc.com), focusing the address bar opens the native input widget with the page URL pre-filled. Tapping the duck.ai start-chat icon submitted that URL as a navigation, reloading the page. The URL branch of `NativeInputManager.onChatSubmitted` now opens the contextual sheet instead, via a new `onContextualSheetRequested` callback wired to `BrowserTabViewModel.openDuckAIContextualMode()` (sends `Command.ShowDuckAIContextualMode(tabId)`). **AV4 — Tool buttons visible in search-only mode.** `NativeInputModeWidget.updateBottomRowVisibility()` only gated on `isChatTabSelected()`, which can remain true in `BROWSER` context if a previous interaction set `toggleSelection=DUCK_AI` (the widget config doesn't reset it on every activation). The chat tools (attach, options, reasoning mode, model picker) were therefore shown despite the AI toggle being off. A new `NativeInputState.shouldSuppressBottomRow()` extension hides the row when `inputMode=SEARCH_ONLY && inputContext=BROWSER`, mirroring the existing `shouldShowToggleRowBack` / `shouldShowCardRowBack` pattern. `DUCK_AI` and `DUCK_AI_CONTEXTUAL` contexts are unchanged. Unit tests added for both fixes. ### Steps to test this PR _AV3 — duck.ai icon should not reload the page_ - [x] Internal build, complete onboarding choosing "Search only" (AI toggle off). - [x] Open a tab and load https://bbc.com. - [ ] Tap the duck.ai (chevron-down) start-chat icon. - [ ] Expected: the Duck.ai contextual sheet appears. Page is NOT reloaded. _AV4 — tool buttons should be hidden in search-only mode from the browser_ - [x] Same config (Search only). - [ ] If the screenshot scenario can be reached on your build (toggle row hidden but chat tab implicitly selected from a prior session), open the address bar from a regular page. - [x] Expected: bottom row (paperclip / options / reasoning / model picker / submit container) is NOT visible. Back arrow, input field, and start-chat icon remain. - [x] On a Duck.ai page (`DUCK_AI` context), bottom row behavior is unchanged. _Regressions check_ - [x] Switch the AI toggle back on. Confirm the bottom row tools appear normally on the chat tab. - [x] On a Duck.ai page with toggle off, confirm the existing behavior is unchanged (out of scope for this PR). ### UI changes | Before | After | | ------ | ----- | !(Upload before screenshot)|(Upload after screenshot)| <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Targeted UI/input routing and per-tab state reset with unit tests; no auth, security, or data-layer changes. > > **Overview** > Fixes **search-only** native input regressions: URL-like chat submits from the browser no longer navigate away, chat tool chrome stays hidden when it should, and per-tab state is cleaned up when the contextual sheet closes. > > **Duck.ai / URL submit (AV3):** `NativeInputManager` reorders `onChatSubmitted` so **Duck.ai mode** always treats input as chat (including pasted URLs). Outside Duck.ai, a URL now triggers **`onContextualSheetRequested`** → `openDuckAIContextualMode()` / `ShowDuckAIContextualMode` instead of reloading the page. > > **Bottom row tools (AV4):** `NativeInputModeWidget` uses **`shouldSuppressBottomRow()`** when `SEARCH_ONLY` + `BROWSER` so attach/options/model UI does not show from stale `toggleSelection=DUCK_AI`. > > **Contextual sheet cleanup:** On sheet close, **`ContextualNativeInputManager.onContextualClosed`** resets per-tab `NativeInputState` to browser defaults via `NativeInputStatePublisher` (preserving `inputMode`). > > Unit tests cover the new command, bottom-row suppression, and publisher reset behavior. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit f23299d. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: David Gonzalez <malmstein@Davids-MacBook-Pro.local>
Create tag 5.281.1.1-internal for internal release.
PreviousNext