-
Notifications
You must be signed in to change notification settings - Fork 1k
SERP Easter Egg Logos in Omnibar #6633
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
1165b4f
to
8e2d42c
Compare
0933974
to
7e264f8
Compare
There was a problem hiding this 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 |
serp-logos/serp-logos-impl/src/main/res/values/strings-serp-logos.xml
Outdated
Show resolved
Hide resolved
...ogos/serp-logos-impl/src/main/kotlin/com/duckduckgo/serp/logos/impl/RealSerpLogoEvaluator.kt
Show resolved
Hide resolved
...os/serp-logos-impl/src/test/java/com/duckduckgo/serp/logos/impl/RealSerpLogoEvaluatorTest.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/duckduckgo/app/browser/omnibar/OmnibarLayoutViewModel.kt
Outdated
Show resolved
Hide resolved
…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.
…vity_serp_easter_egg_logo.xml
…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
…ts from JavaScript result
10991d0
to
76d7477
Compare
There was a problem hiding this 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]>
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
serpEasterEggLogos
feature flag (It should be enabled by default if using an internal build)Search term edits
UI changes
See Ship Review main task