Skip to content

Conversation

@mikescamell
Copy link
Contributor

@mikescamell mikescamell commented Jan 12, 2026

Task/Issue URL: https://app.asana.com/1/137249556945/project/1207908166761516/task/1212553599261552?focus=true

Description

This PR adds the ability for users to set a SERP Easter Egg logo as their favourite, which will then display on all DuckDuckGo search result pages.

Features implemented:

  1. Feature toggle - Added remote feature toggle (serpEasterEggLogos.setFavourite) to control the favourite logo functionality
  2. Favourite logo data store - Added FavouriteSerpLogoDataStore to persist the user's favourite logo URL preference
  3. Discovery screen enhancements - Updated the Easter Egg logo screen to:
    - Display a title telling the user they've discovered an Easter Egg logo
    - Added a button to set/unset the logo as favourite
  4. Wiggle animation - Easter Egg logos now play a subtle wiggle animation when displayed in the omnibar:
    - Only plays once per unique logo URL
    - Skips animation for favourite logos
    - Waits for image crossfade to complete before animating
  5. State management fixes - Fixed race conditions that could cause Easter Egg logos to be lost:
    - Preserve existing Easter Egg when onViewModeChanged is called
    - Distinguish between SerpLogo.Normal (explicitly no Easter Egg) and null (pending state)
    - Reset to Dax logo when favourite preference changes

Steps to test this PR

Easter Egg Discovery

  • Search for a term that triggers an Easter Egg logo (e.g., "Southampton FC", "f1", "predator")
  • Verify the Easter Egg logo appears in the omnibar with a wiggle animation
  • Tap on the logo to open the enlarged view
  • Verify the discovery text "You found a hidden logo!" is displayed at the top
  • Verify the "Set as Favourite" button is visible
  • Tap anywhere outside to dismiss the view

Setting a Favourite Logo

  • Open the Easter Egg logo screen
  • Tap "Set as Favourite"
  • Search for something that does not have an easter egg logo e.g. "fpl"
  • Verify the favourite logo persists in the omnibar
  • Search for a term that triggers an Easter Egg logo (e.g., "Southampton FC", "f1", "predator") but is not your current favourite logo
  • Verify the favourite logo persists in the omnibar
  • Search for the same term for your favourite logo
  • Verify the logo no longer plays the wiggle animation (since it's now a favourite)

Resetting to Default

  • With a favourite logo set, tap on the logo
  • Verify the button now shows "Reset to Default"
  • Tap "Reset to Default"
  • Dismiss the easter egg logo screen
  • Verify the DDG logo is visible
  • Search for something that does not have an easter egg logo e.g. "fpl"
  • Verify the DDG logo is still visible
  • Search for a term that triggers an Easter Egg logo (e.g., "Southampton FC", "f1", "predator")
  • Verify the Easter Egg logo appears in the omnibar with a wiggle animation

Flag off

  • Disable the flag
  • Search for a term that triggers an Easter Egg logo (e.g., "Southampton FC", "f1", "predator")
  • Tap the EasterEgg logo
  • The Easter Egg Logo screen should open
  • Verify the discovery text "You found a hidden logo!" is displayed
  • Verify the "Switch to this logo" button is not visible

UI changes

Before After
before-light-mode after-light-mode
before-dark-mode after-dark-mode

@mikescamell mikescamell changed the title Feature/mike/allow setting of favourite serp easter egg logo Allow setting of favourite serp easter egg logo Jan 12, 2026
@mikescamell mikescamell force-pushed the feature/mike/allow-setting-of-favourite-serp-easter-egg-logo branch from f2ffff9 to 19e36d2 Compare January 12, 2026 16:12
This will act as a kill switch, we don't want people stuck with a favourite icon and no way to turn it off if we can help it!
We now include a title to tell the user they have discovered an easter egg logo and allow them to set the logo as their favourite via the newly added button on screen.
When an Easter Egg logo is displayed in the omnibar (from a special
search like "f1"), it now plays a subtle wiggle animation once
the image loads. The animation:

- Only plays once per unique logo URL (prevents re-triggering on
  ViewState updates)
- Skips animation for favourite logos (set by user preference)
- Waits 1 second after image loads for crossfade to complete
When a SERP page loads with an Easter Egg logo, two events occur
in non-deterministic order: onViewModeChanged and
onExternalOmnibarStateChanged. If onViewModeChanged was called
after the Easter Egg was already set, it would overwrite the
leadingIconState with Dax because it always passed logoUrl = null.

This fix preserves the existing Easter Egg URL in onViewModeChanged
by extracting it from the current state before updating, following
the same pattern already used in onExternalLoadingStateChanged.
When navigating between searches, onExternalOmnibarStateChanged may be
called with serpLogo = null before the new logo extraction completes.
Previously this would clear the existing Easter Egg logo, causing Dax
to briefly flash or persist if timing was unfavorable.

Now we distinguish between:
- SerpLogo.Normal: Explicitly no Easter Egg, clear and show Dax
- null: Unknown/pending state, preserve existing Easter Egg if present

This prevents the logo from being lost during navigation between
Easter Egg searches.
@mikescamell mikescamell force-pushed the feature/mike/allow-setting-of-favourite-serp-easter-egg-logo branch from 19e36d2 to 3b8dd59 Compare January 13, 2026 17:48
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