Skip to content
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

Add interstitial search #719

Merged
merged 29 commits into from
Feb 27, 2020
Merged

Conversation

subsymbolic
Copy link
Contributor

@subsymbolic subsymbolic commented Feb 21, 2020

Task/Issue URL: https://app.asana.com/0/361428290920652/1154054879959297

Description:
Add a new interstitial search suggestion screen which displays autocomplete and device app results similar to that of the system default google app.

This interstitial screen is displayed when users launch our app

  • via the google search bar, intent action com.duckduckgo.mobile.android.NEW_SEARCH
  • DuckDuckGo widgets
  • assistant (for users who set us as the system assistant)

Steps to test this PR:

Test launch from Widget

  1. Run our app
  2. Install the widget
  3. Tap the widget
  4. Ensure the interstitial screen shows and widget launch pixel m_w_l fires

Test launch from Assistant

  1. Run our app
  2. Set our app as the default Assistant
  3. Press and hold the home button
  4. Ensure the interstitial screen shows and the assistant launch pixel m_a_l fires

Test launch from Google action

  1. Close our app
  2. From the terminal run adb shell am start -a com.duckduckgo.mobile.android.NEW_SEARCH to send the correct action to our app
  3. Ensure the interstitial screen shows and google bar launch pixel m_g_l fires

Test Dax icon opens main app

  1. Open the interstitial screen again
  2. Tap on the dax icon
  3. Ensure this launches our app and the interstitial app launch pixel m_i_ld fires

Test autocomplete selection opens entry in browser

  1. Open the interstitial screen again
  2. Start typing
  3. Select an autcomplete result
  4. Ensure this launches in our browser and the interstitial browser launch pixel m_i_lbq fires

Test app selection entry opens app

  1. Open the interstitial screen again
  2. Start typing Goo
  3. Select an app result
  4. Ensure this launches the app and the interstitial device app pixel m_i_sda fires

Test UI

  1. Check the interstitial screen in landscape and split screen

Test Migration

  1. Uninstall previous versions of the app
  2. Install develop version of the app, run it and add widget
  3. Install this version over the top
  4. Tap widget to ensure it still works

Internal references:

Software Engineering Expectations
Technical Design Template

# Conflicts:
#	app/src/androidTest/java/com/duckduckgo/app/statistics/VariantManagerTest.kt
# Conflicts:
#	app/src/main/res/values/string-untranslated.xml
# Conflicts:
#	app/src/androidTest/java/com/duckduckgo/app/statistics/VariantManagerTest.kt
@subsymbolic subsymbolic marked this pull request as ready for review February 25, 2020 00:17
@subsymbolic
Copy link
Contributor Author

Over to you for review @CDRussell. Ping me if you want to zoom to go over it!

Copy link
Member

@CDRussell CDRussell left a comment

Choose a reason for hiding this comment

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

Looking awesome! all scenarios tested, and all comments optional

one question; did we deliberately decide to omit bookmarks from the interstitial search?

Copy link
Contributor

@malmstein malmstein left a comment

Choose a reason for hiding this comment

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

few comments but LGTM

@subsymbolic
Copy link
Contributor Author

Thanks for the great feedback @CDRussell & @malmstein!

@subsymbolic subsymbolic merged commit 412d70b into develop Feb 27, 2020
@subsymbolic subsymbolic deleted the feature/mia/interstitial_search branch February 27, 2020 14:55
@JeffAment
Copy link
Contributor

@subsymbolic,

First off, very strong work here! 👍
Please see the gif below. It appears the if statement in the function below may have some unintended side effects when the spacebar is pressed before the auto-complete suggestions appear (whitespace trimming issue). Happy to submit a fix for this if this is not the intended behavior && you are too busy to fix this.

    private fun renderViewState(viewState: SystemSearchViewState) {
        if (omnibarTextInput.text.toString() != viewState.queryText) {
            omnibarTextInput.setText(viewState.queryText)
            omnibarTextInput.setSelection(viewState.queryText.length)
        }

        deviceLabel.isVisible = viewState.appResults.isNotEmpty()
        autocompleteSuggestionsAdapter.updateData(viewState.autocompleteResults.query, viewState.autocompleteResults.suggestions)
        deviceAppSuggestionsAdapter.updateData(viewState.appResults)
    }

whitespace

@subsymbolic
Copy link
Contributor Author

subsymbolic commented Mar 5, 2020

Thanks @JeffAment! Yes, I was a little overzealous in using the "view model" as a source of truth 😬I have a task to clean it up over the next few days, hope I can sneak it into the next release.

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.

4 participants