Skip to content

Conversation

mikescamell
Copy link
Contributor

@mikescamell mikescamell commented Aug 21, 2025

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

Description

This PR adds support for displaying special Easter Egg logos on DuckDuckGo search results pages. When a user performs a search that triggers an Easter Egg logo, the app will extract and display it in the omnibar, and allow users to view an enlarged version by tapping on it.

Enabled only on internal builds for testing.

Steps to test this PR

Ensure to test on at least 2 Android versions, one below 30 and above 30 should suffice.

Happy path

  • Enable the serpEasterEggLogos feature flag (It should be enabled by default if using an internal build)
  • Search for a term that has an Easter Egg logo (e.g., "predator", "terminator", "android" etc.)
  • Verify the special logo appears in the omnibar
  • Tap on the logo to see the enlarged version
  • Tap anywhere on the screen to dismiss the enlarged view
  • Navigate away from the SERP page and verify the logo is replaced with the standard DuckDuckGo logo

Search term edits

  • Search for a term that has an Easter Egg logo (e.g., "predator", "terminator", "android" etc.)
  • Verify the special logo appears in the omnibar
  • Click on the omnibar
  • Press the back arrow
  • The special logo should still be there
  • Click on the omnibar
  • Delete some letters
  • Press the back arrow
  • The special logo should still be there
  • Click on the omnibar
  • Delete all text via X
  • Press the back arrow
  • The special logo should still be there
  • Click on the omnibar
  • Enter a search term without special logo e.g. "monkeys"
  • Verify the logo is replaced with the standard DuckDuckGo logo

UI changes

See Ship Review main task

@mikescamell mikescamell force-pushed the feature/mike/serp-icons-in-ominbar branch 2 times, most recently from 1165b4f to 8e2d42c Compare August 26, 2025 17:59
@mikescamell mikescamell changed the title [WIP] SERP Easter Egg Logos in Omnibar SERP Easter Egg Logos in Omnibar Aug 26, 2025
@mikescamell mikescamell marked this pull request as ready for review August 26, 2025 18:11
@mikescamell mikescamell force-pushed the feature/mike/serp-icons-in-ominbar branch from 0933974 to 7e264f8 Compare August 28, 2025 09:59
@mikescamell mikescamell requested a review from Copilot August 28, 2025 12:16
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces SERP Easter Egg logo functionality that displays special DuckDuckGo logos in the omnibar when users search for specific terms. When triggered, the logo can be tapped to show an enlarged view with a smooth transition animation.

Key changes:

  • Adds JavaScript-based logo extraction from SERP pages
  • Implements omnibar logo display using the existing dax icon with dynamic image loading
  • Creates enlarged logo viewer activity with shared element transitions

Reviewed Changes

Copilot reviewed 31 out of 32 changed files in this pull request and generated 4 comments.

File Description
serp-logos module Complete new module containing API definitions, logo extraction logic, and Easter egg logo viewer activity
BrowserTabViewModel.kt Adds logo extraction triggering and command handling for SERP pages
OmnibarLayoutViewModel.kt Integrates logo display logic into omnibar state management with feature toggle support
BrowserTabFragment.kt Implements logo extraction execution and activity launching with transitions

…d references

We'll use a new class for the logo in a future commit that takes a url.
Internal only for now while it's tested
We're using a shared element transition so we have to postpone entering before glide is ready

We also need a custom style to make the view transparent with a slight dark tint, shielding the view behind and making the logo prominent

Clicking anywhere closes the logo but an X is added in case people don't realise
This commit introduces the functionality to extract and evaluate SERP logos.

Key changes:
- Added `SerpLogos` API for extracting logo information from a WebView.
- Implemented `RealSerpLogoEvaluator` to handle the logo extraction logic using JavaScript.
- Introduced `SerpLogoJavascriptInterface` to provide the JavaScript code for logo detection.
- Defined `SerpLogo` sealed class to represent different types of logos (EasterEgg, Normal).
- Added unit tests for `RealSerpLogoEvaluator` and `RealSerpLogoJavascriptInterface`.
- Add logo click handling and extraction commands to BrowserTabFragment and BrowserTabViewModel
- Implement dynamic logo display in omnibar with EasterEggLogo state
- Add logo click listener interface and transition animations
- Update OmnibarViewState to include serpLogo field
- Modify omnibar layout to support logo image loading with Glide

I needed to edit the daxIcon layout to use larger padding so the easter egg logo fits properly but it is still the same size
…us change

When the omnibar gains focus, the leading icon changes to Search. Previously,
if an Easter egg logo was displayed, it would be lost when focus was regained
because the logic only checked the current leading icon state (which was Search).

Changes:
- Added previousLeadingIconState field to ViewState to store icon state before focus
- Store current leading icon state when gaining focus
- Use previous state (instead of current) when losing focus to restore Easter egg logos
- Clear previous state after restoration to avoid memory retention

This ensures Easter egg logos persist correctly through focus changes.
…r Easter Egg logo activity

Fixes the 3 button nav issues
This is a leftover from Josh's loading bar experiment. Ondrej needed to account for that when adding the new Bottom Omnibar here but as Josh has removed the experiment it is no longer needed. I tested and it makes no difference and now acts the same way as the top omnibar
@mikescamell mikescamell force-pushed the feature/mike/serp-icons-in-ominbar branch from 10991d0 to 76d7477 Compare August 28, 2025 12:28
Copy link
Contributor

@anikiki anikiki left a comment

Choose a reason for hiding this comment

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

Looks good and works as expected! 🎉

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

### Description

Added translations for the "Close" content description in the SERP logos
feature. Moved the string from common-ui to the serp-logos module and
added translations for all supported languages.

### Steps to test this PR

_SERP Logos_
- [ ] Verify that the "cdClose" string is now available in the
serp-logos module
- [ ] Check that translations are available for all supported languages
- [ ] Confirm that screen readers properly announce the close button in
different languages

### UI changes
N/A

---------

Co-authored-by: Dax The Translator <[email protected]>
@mikescamell mikescamell merged commit b90c93d into develop Aug 28, 2025
6 checks passed
@mikescamell mikescamell deleted the feature/mike/serp-icons-in-ominbar branch August 28, 2025 17:51
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