Fix native input regressions in search-only mode#8677
Open
malmstein wants to merge 1 commit into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.onChatSubmittednow opens the contextual sheet instead, via a newonContextualSheetRequestedcallback wired toBrowserTabViewModel.openDuckAIContextualMode()(sendsCommand.ShowDuckAIContextualMode(tabId)).AV4 — Tool buttons visible in search-only mode.
NativeInputModeWidget.updateBottomRowVisibility()only gated onisChatTabSelected(), which can remain true inBROWSERcontext if a previous interaction settoggleSelection=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 newNativeInputState.shouldSuppressBottomRow()extension hides the row wheninputMode=SEARCH_ONLY && inputContext=BROWSER, mirroring the existingshouldShowToggleRowBack/shouldShowCardRowBackpattern.DUCK_AIandDUCK_AI_CONTEXTUALcontexts are unchanged.Unit tests added for both fixes.
Steps to test this PR
AV3 — duck.ai icon should not reload the page
AV4 — tool buttons should be hidden in search-only mode from the browser
DUCK_AIcontext), bottom row behavior is unchanged.Regressions check
UI changes