Hide toggle in contextual sheet native input widget#8584
Merged
Conversation
When the contextual sheet hosts a NativeInputModeWidget, it subscribes to the same per-tab NativeInputStateProvider slot as the main browser widget. The browser widget publishes inputContext=BROWSER for the same tabId, so the contextual widget briefly observes a state with toggleVisible=true and shows the toggle row — regression after the state store landed in develop. Add a private isContextualWidget flag, set from configureContextual(). Use it to force the toggle row hidden in applyToggleVisibility and to short-circuit applyOmnibarShape (which would otherwise reset the parent contextualNativeInputCard's top-only corners to all-corners rounded for SEARCH_ONLY users whose published state has toggleVisible=false). Leaves the underlying shared-store race and the outer card's visual treatment for a separate follow-up; this is the minimal scoped fix to get the toggle hidden in contextual mode. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
YoussefKeyrouz
approved these changes
May 15, 2026
Collaborator
YoussefKeyrouz
left a comment
There was a problem hiding this comment.
LGTM. Wasn’t able to reproduce on develop but changes looks good.
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/task/1214837570101572
Description
When the contextual Duck.ai sheet opens with the native input widget enabled, the Search/Duck.ai toggle row briefly shows before being hidden — and on some users (typically
SEARCH_ONLYmode) it stays visible. Regression after the per-tabNativeInputStateProviderlanded: the contextual widget subscribes to the sametabIdslot as the main browser widget, so it observes a state withinputContext = BROWSERandtoggleVisible = true/falsepublished by the main widget.This change adds a
private var isContextualWidget: BooleanonNativeInputModeWidget, set fromconfigureContextual(). It is then used to:applyToggleVisibilityto GONE, regardless of the observed state.applyOmnibarShapeso it does not mutate the parentcontextualNativeInputCard's shape (otherwise aBROWSER/toggleVisible=falseemission would overrideContextualNativeInputManager.applyCardShape's top-only rounded corners).The underlying shared-store race and the contextual sheet's outer visual treatment are not in scope here — this is the minimal scoped fix to get the toggle hidden.
Steps to test this PR
Toggle hidden in contextual sheet
SEARCH_ONLYmode) and repeat. Toggle still hidden.No regression in browser / full-screen Duck.ai
UI changes
Note
Low Risk
Low-risk UI-only change that gates toggle visibility and shape mutations when the widget is used in the contextual sheet; main risk is unintended suppression of the toggle if the contextual flag is set incorrectly.
Overview
Prevents the Search/Duck.ai toggle row from appearing in the Duck.ai contextual sheet by marking
NativeInputModeWidgetinstances created viaconfigureContextual()and forcingapplyToggleVisibilityto hide the toggle regardless of per-tab state emissions.Also skips
applyOmnibarShape()for contextual widgets so sharedNativeInputStateProviderupdates from the main browser widget can’t override the contextual sheet card’s rounded-corner styling.Reviewed by Cursor Bugbot for commit 8b5465a. Bugbot is set up for automated code reviews on this repo. Configure here.