Skip to content

Fix native input regressions in search-only mode#8677

Open
malmstein wants to merge 1 commit into
developfrom
feature/david/fix_search_only_input_regressions
Open

Fix native input regressions in search-only mode#8677
malmstein wants to merge 1 commit into
developfrom
feature/david/fix_search_only_input_regressions

Conversation

@malmstein
Copy link
Copy Markdown
Contributor

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

  • Internal build, complete onboarding choosing "Search only" (AI toggle off).
  • Open a tab and load https://bbc.com.
  • Tap the address bar to open the native input widget — URL is pre-filled.
  • 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

  • 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.
  • Expected: bottom row (paperclip / options / reasoning / model picker / submit container) is NOT visible. Back arrow, input field, and start-chat icon remain.
  • On a Duck.ai page (DUCK_AI context), bottom row behavior is unchanged.

Regressions check

  • Switch the AI toggle back on. Confirm the bottom row tools appear normally on the chat tab.
  • 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)

AV3: tapping the duck.ai start-chat icon on a pre-filled page URL no
longer submits the URL as a navigation (which reloaded the current
page). The URL branch in NativeInputManager.onChatSubmitted now opens
the contextual sheet via a new onContextualSheetRequested callback,
wired to BrowserTabViewModel.openDuckAIContextualMode.

AV4: NativeInputModeWidget's bottom row (attach, options, reasoning,
model picker) is suppressed when inputMode is SEARCH_ONLY and
inputContext is BROWSER. A stale toggleSelection of DUCK_AI from a
previous interaction would otherwise leave isChatTabSelected() true
and expose the chat tools despite the AI toggle being off.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant