Skip to content

Decouple Duck.ai native chat input behind a flag#8946

Draft
malmstein wants to merge 1 commit into
developfrom
feature/david/native_chat_input_flag
Draft

Decouple Duck.ai native chat input behind a flag#8946
malmstein wants to merge 1 commit into
developfrom
feature/david/native_chat_input_flag

Conversation

@malmstein

Copy link
Copy Markdown
Contributor

Task/Issue URL: https://app.asana.com/1/137249556945/project/1157893581871903/task/1215886794910094
Tech Design URL (if applicable):

Description

aiChat.nativeInputField() currently bundles several behaviours behind one toggle:

  1. the native composing widget that replaces the old input screen (omnibar / new tab),
  2. the native-input=true Duck.ai URL param (+ origin attribution),
  3. the supportsNativeChatInput / supportsNativePrompt JS flags sent to the Duck.ai web frontend,
  4. the native input shown inside Duck.ai — the contextual sheet and the fullscreen Duck.ai page.

Disabling the flag to turn one of these off forced all of them off, which has caused issues.

This PR adds a new aiChat.nativeChatInput() toggle that gates only the Duck.ai-side native chat input (2, 3, 4), leaving the composing widget on nativeInputField. A single suppressor-aware source of truth drives all three:

isNativeChatInputEnabled = isNativeInputFieldEnabled && nativeChatInput().isEnabled()

exposed as DuckChatInternal.isNativeChatInputEnabled() (JS helper) and DuckChat.observeNativeChatInputEnabled() (UI consumers). Because it ANDs the widget gate, the new flag has no effect while the widget is off.

When nativeChatInput is off, Duck.ai contextual and fullscreen fall back to the web input and the native overlay is suppressed (no more "two inputs").

Behaviour matrix:

nativeInputField nativeChatInput Composing UI Duck.ai input
on on native widget native overlay (web input hidden)
on off native widget web input only
off on old input screen web input only (no effect)
off off old input screen web input only

Default: INTERNAL + @InternalAlwaysEnabled, mirroring nativeInputField.

Draft — opening for team discussion on scope and the default before review.

Steps to test this PR

Native chat input enabled (default, internal build)

  • Open Duck.ai contextual sheet → native input card shows; web input hidden
  • Open fullscreen Duck.ai → native input shows; web input hidden
  • URL contains native-input=true

Native chat input disabled (remote-disable aiChat.nativeChatInput)

  • Composing widget (omnibar / new tab) still shows
  • Contextual sheet shows only the web input (no native card)
  • Fullscreen Duck.ai shows only the web input (no native overlay)
  • URL has no native-input param; supportsNativeChatInput/supportsNativePrompt are false

UI changes

Before After
(Upload before screenshot) (Upload after screenshot)

🤖 Generated with Claude Code

The aiChat.nativeInputField() toggle bundled three behaviours: the
native composing widget that replaces the old input screen, the
native-input Duck.ai URL param, and the supportsNativeChatInput /
supportsNativePrompt JS flags. It also gated the native input shown
inside Duck.ai (contextual sheet and fullscreen). Disabling it to turn
one off forced all of them off.

Add aiChat.nativeChatInput() to gate only the Duck.ai-side native chat
input integration, leaving the composing widget on nativeInputField.
A single suppressor-aware source of truth, isNativeChatInputEnabled =
isNativeInputFieldEnabled && nativeChatInput().isEnabled(), drives the
URL param, the JS flags, and the in-Duck.ai native input, so the flag
has no effect while the widget is off.

When the new flag is off, Duck.ai contextual and fullscreen fall back to
the web input and the native overlay is suppressed, avoiding two inputs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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