-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Allow setting of favourite serp easter egg logo #7467
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
Open
mikescamell
wants to merge
18
commits into
develop
Choose a base branch
from
feature/mike/allow-setting-of-favourite-serp-easter-egg-logo
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Allow setting of favourite serp easter egg logo #7467
mikescamell
wants to merge
18
commits into
develop
from
feature/mike/allow-setting-of-favourite-serp-easter-egg-logo
+1,456
−41
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19e36d2 to
3b8dd59
Compare
7362335 to
b763bc4
Compare
app/src/main/java/com/duckduckgo/app/browser/omnibar/OmnibarLayoutViewModel.kt
Show resolved
Hide resolved
app/src/main/java/com/duckduckgo/app/browser/omnibar/OmnibarLayoutViewModel.kt
Show resolved
Hide resolved
b763bc4 to
bff3474
Compare
app/src/main/java/com/duckduckgo/app/browser/omnibar/OmnibarLayoutViewModel.kt
Outdated
Show resolved
Hide resolved
bff3474 to
cf15f2f
Compare
...rp-logos-impl/src/main/kotlin/com/duckduckgo/serp/logos/impl/ui/SerpEasterEggLogoActivity.kt
Show resolved
Hide resolved
cae2868 to
20a6686
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.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
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) We also need to make sure we cancel the wobble animation before the shared element transition otherwise it becomes glitchy.
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.
No need to extract an existing logo if we have a favourite set. Also prevents getting into any weird state.
…te button clicked Matches iOS and request from Ship Review
… on SERP page in BrowserTabViewModel Moves the logic to ensure we set a Favourite EasterEgg logo to the BrowserTabViewModel. This makes the OmnibarViewModel dumber like before adding the favourite feature, leaving responsibility to the caller (BrowserTab) to decide what should be shown. Add flow observer that combines favourite toggle state and favourite URL to reactively update the serpLogo when: - Favourite logo is set: Show the favourite Easter egg logo - Favourite logo is cleared: Show Dax (Normal logo) - Feature is disabled: Let normal extraction handle it Only reacts when on a SERP page to avoid unnecessary updates on other pages.
When a favourite SERP logo is cleared while on a SERP page, the omnibarViewState.serpLogo should update from EasterEgg to Normal, but currently it stays stale. This test verifies the expected behavior and will pass once a flow observer is added to BrowserTabViewModel to react to favourite logo changes
500da4f to
b0e3498
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
- Display a title telling the user they've discovered an Easter Egg logo
- Added a button to set/unset the logo as favourite
- Only plays once per unique logo URL
- Skips animation for favourite logos
- Waits for image crossfade to complete before animating
- 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
Setting a Favourite Logo
Resetting to Default
Flag off
UI changes
Note
Medium Risk
Moderate risk: adds new persisted preference (DataStore), new UI state/animation paths, and changes SERP logo selection logic in
BrowserTabViewModel/omnibar rendering, which could cause regressions in address-bar icon state or transitions.Overview
Adds a new “favourite SERP Easter Egg logo” capability: users can set/unset a discovered Easter Egg logo, persist the chosen logo URL via a new DataStore, and have that logo override normal SERP logo extraction on DuckDuckGo search result pages when the
serpEasterEggLogos.setFavouritetoggle is enabled.Updates the Easter Egg logo discovery screen to show discovery text and a favourite toggle button, introduces a one-time “wiggle” animation for non-favourite Easter Egg logos in the omnibar, and adds explicit cancellation of the logo animation when launching the logo screen to avoid transition glitches. Tests are expanded across
BrowserTabViewModel,OmnibarLayoutViewModel, andserp-logosto cover toggle/favourite interactions and state preservation.Written by Cursor Bugbot for commit b0e3498. This will update automatically on new commits. Configure here.