Skip to content

Add brand-design Duck.AI fire button onboarding dialog#8857

Merged
lmac012 merged 4 commits into
developfrom
feature/lukasz/duck-ai-fire-dialog-brand-design-update
Jun 18, 2026
Merged

Add brand-design Duck.AI fire button onboarding dialog#8857
lmac012 merged 4 commits into
developfrom
feature/lukasz/duck-ai-fire-dialog-brand-design-update

Conversation

@lmac012

@lmac012 lmac012 commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Task/Issue URL: https://app.asana.com/1/137249556945/project/1205648422731273/task/1215626471231067?focus=true
Tech Design URL (if applicable):

Description

Adds a brand-design-update variant of the Duck.AI in-context fire button onboarding
CTA (CtaId.DAX_DUCK_AI_FIRE_BUTTON).

The new CTA mirrors DaxFireButtonBrandDesignUpdateContextualCta but preserves the legacy
Duck.AI UX: no in-card primary button and no dismiss button — the user dismisses by tapping
the actual fire button.

Supporting changes:

  • BrandDesignContextualDaxDialogCta now supports CTAs that render title + description
    only
    : activeIncludeId becomes optional (open val … = 0) and the render pipeline
    gracefully skips slot work when no content slot is present. A new empty content-include
    slot (contextualBrandDesignNoCtaContent) and a showDismiss flag (default true)
    back this.
  • Four BrowserTab call sites that drove fire-button behaviour (pulse highlight,
    isDuckAiOnboarding flag, fireFireButtonPressed metric, dismissal) only matched the
    legacy DaxDuckAiFireButtonCta; they now treat the brand-design variant equivalently.
  • The brand-design variant is gated behind a new onboardingDuckAiExperimentMay26BrandDesignUpdate
    toggle (default INTERNAL).

Steps to test this PR

Prerequisites

  • Apply patch included in asana task

Brand-design Duck.AI fire-button dialog

  • Run the Duck.AI onboarding flow until the in-context fire-button CTA appears; confirm
    it renders in the brand-design style (title + description, no in-card button, no
    dismiss button).
  • Tap the fire button the arrow points at; confirm the fire flow runs and the CTA
    dismisses.

Legacy fallback

  • The toggle defaults to INTERNAL (on in internal builds). Override
    onboardingDuckAiExperimentMay26BrandDesignUpdate to disabled; confirm the
    legacy Duck.AI fire-button CTA renders instead.

UI changes

Before After
Screenshot_20260612_110935 Screenshot_20260612_105603

Note

Low Risk
Onboarding UI and CTA selection only; legacy path remains when brand-design is off, with broad test coverage for parity.

Overview
Introduces DaxDuckAiFireButtonBrandDesignUpdateContextualCta for Duck.AI onboarding on Duck Chat URLs when the brand-design update flag is on, replacing the legacy DaxDuckAiFireButtonCta in that path while keeping the same CtaId.DAX_DUCK_AI_FIRE_BUTTON and “resolve via toolbar fire button” behavior (no in-card primary button, showDismiss = false).

BrandDesignContextualDaxDialogCta now supports title/description-only cards: activeIncludeId is optional, animations and include reset handle a missing slot, showDismiss hides the corner dismiss control, and layout adds contextualBrandDesignNoCtaContent as a padding compensator for no-button CTAs.

BrowserTabFragment, BrowserTabViewModel, and CtaViewModel treat the new CTA like the legacy Duck.AI fire CTA for fire-button pulse/highlight, isDuckAiOnboarding, deferred fire-menu handling, impression metrics, and dismissal.

Reviewed by Cursor Bugbot for commit 65bc4e2. Bugbot is set up for automated code reviews on this repo. Configure here.

lmac012 commented Jun 12, 2026

Copy link
Copy Markdown
Contributor Author

@lmac012 lmac012 changed the title Allow brand-design contextual CTAs without a content slot Add brand-design Duck.AI fire button onboarding dialog Jun 12, 2026
@lmac012 lmac012 marked this pull request as ready for review June 12, 2026 09:12
@lmac012 lmac012 requested a review from LukasPaczos June 12, 2026 09:28
@lmac012 lmac012 force-pushed the feature/lukasz/duck-ai-fire-dialog-brand-design-update branch from 857f75a to f0f440a Compare June 15, 2026 20:06

@LukasPaczos LukasPaczos left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One request below to remove the flag check, otherwise LGTM!

Comment thread app/src/main/java/com/duckduckgo/app/cta/ui/CtaViewModel.kt Outdated
Comment thread app/src/main/java/com/duckduckgo/app/cta/ui/CtaViewModel.kt Outdated
lmac012 added 4 commits June 18, 2026 01:59
Make `BrandDesignContextualDaxDialogCta.activeIncludeId` optional. Subclasses
that render only title + description — with no in-card button or options — can
leave it at the default `0` and the render pipeline gracefully skips slot-related
work when `findViewById(activeIncludeId)` returns null.

Removes the implicit invariant that every contextual CTA must declare a content
slot, and lets future no-content CTAs be defined without inventing a placeholder
view in every layout variant the CTA might be inflated into (e.g. landscape).

Surface changes:
- `activeIncludeId` switched from `abstract val` to `open val activeIncludeId: Int = 0`.
- The four `findViewById<View>(activeIncludeId)` sites now bind to `View?`.
- `resetAllIncludesExcept(view, active: View)` → `active: View?`. With `active = null`,
  all slots get hidden.
- `snapToFinished(..., activeInclude: View, ...)` → `activeInclude: View?`. The
  `.alpha = 1f` line becomes a safe call.
- The slot-fade-in animator is only added when a slot is present.
Adds a brand-design variant of the Duck.AI fire-button CTA (CtaId.DAX_DUCK_AI_FIRE_BUTTON)
so the redesigned visuals stay consistent when both the brand-design and Duck.AI
onboarding flags are enabled.

The new CTA mirrors DaxFireButtonBrandDesignUpdateContextualCta but preserves the
legacy Duck.AI UX: no in-card primary button and no dismiss button — the user
dismisses by tapping the actual fire button the arrow points at. To support that,
BrandDesignContextualDaxDialogCta gains a `showDismiss` flag (default true) and a
new empty content-include slot (`contextualBrandDesignNoCtaContent`) for CTAs that
render title + description only.
Four BrowserTab call sites pattern-match on OnboardingDaxDialogCta.DaxDuckAiFireButtonCta
to drive fire-button behaviour while the CTA is shown — fire-button pulse highlight,
isDuckAiOnboarding flag on the fire flow, fireFireButtonPressed metric, and the
dismissal path. The new brand-design variant from
DaxDuckAiFireButtonBrandDesignUpdateContextualCta was missed in those checks, so
with the brand-design flag on none of those behaviours fired. Treat both types
equivalently in each site, with mirroring unit tests.
@lmac012 lmac012 force-pushed the feature/lukasz/duck-ai-fire-dialog-brand-design-update branch from f0f440a to 65bc4e2 Compare June 18, 2026 00:39
@lmac012 lmac012 merged commit 4b91b24 into develop Jun 18, 2026
15 checks passed
@lmac012 lmac012 deleted the feature/lukasz/duck-ai-fire-dialog-brand-design-update branch June 18, 2026 00:59
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