Skip to content

Hide toggle in contextual sheet native input widget#8584

Merged
malmstein merged 1 commit into
developfrom
feature/david/contextual_toggle_visible_fix
May 15, 2026
Merged

Hide toggle in contextual sheet native input widget#8584
malmstein merged 1 commit into
developfrom
feature/david/contextual_toggle_visible_fix

Conversation

@malmstein
Copy link
Copy Markdown
Contributor

@malmstein malmstein commented May 15, 2026

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_ONLY mode) it stays visible. Regression after the per-tab NativeInputStateProvider landed: the contextual widget subscribes to the same tabId slot as the main browser widget, so it observes a state with inputContext = BROWSER and toggleVisible = true/false published by the main widget.

This change adds a private var isContextualWidget: Boolean on NativeInputModeWidget, set from configureContextual(). It is then used to:

  • Force applyToggleVisibility to GONE, regardless of the observed state.
  • Short-circuit applyOmnibarShape so it does not mutate the parent contextualNativeInputCard's shape (otherwise a BROWSER/toggleVisible=false emission would override ContextualNativeInputManager.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

  • Install internal build with native input enabled.
  • Open the browser, navigate to a page.
  • Open the Duck.ai contextual sheet (e.g. from the page-context entry point).
  • Verify the Search/Duck.ai toggle row is not visible inside the sheet.
  • Switch the input-screen setting off (SEARCH_ONLY mode) and repeat. Toggle still hidden.
  • Close the sheet and reopen it. Toggle still hidden.

No regression in browser / full-screen Duck.ai

  • In the main browser omnibar with native input, verify the toggle still appears as before (when applicable).
  • Open full-screen Duck.ai mode, verify the toggle still appears as before.

UI changes

Before After
Toggle row briefly/persistently visible inside the contextual sheet Toggle row hidden, sheet shows only the Duck.ai input

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 NativeInputModeWidget instances created via configureContextual() and forcing applyToggleVisibility to hide the toggle regardless of per-tab state emissions.

Also skips applyOmnibarShape() for contextual widgets so shared NativeInputStateProvider updates 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.

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>
Copy link
Copy Markdown
Collaborator

@YoussefKeyrouz YoussefKeyrouz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Wasn’t able to reproduce on develop but changes looks good.

@malmstein malmstein merged commit 2f84e1d into develop May 15, 2026
32 checks passed
@malmstein malmstein deleted the feature/david/contextual_toggle_visible_fix branch May 15, 2026 22:20
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.

2 participants