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

Address the tasks in the Meta section #5105

Conversation

anikiki
Copy link
Contributor

@anikiki anikiki commented Oct 8, 2024

Task/Issue URL: https://app.asana.com/0/72649045549333/1208287265878043/f

Description

Added feature flag for switch to tab. Removed unneeded quick insert icons. Formatted urls in autosuggest. Added dividers between autosuggest sections.
Updated color on switch to tab icon.

Steps to test this PR

Feature 1

  • Install from this branch.
  • Open a few tabs.
  • Search for something that matches the open tabs. Notice there's a divides between the top hits and search items. Notice there's a divider between the search items and the bottom section.
  • Notice the quick insert icon is available only for search suggestions.
  • Notice all URLs in suggestions don't have http://www., htps://www., www. as prefix and they don't have a trailing /.
  • Notice that if you turn off the autocompleteTabs from Feature Flag Inventory you don't see the Switch to tab suggestions.

UI changes

Divider dark node Divider light mode
divider_light_mode divider_dark_mode
No top divider Bottom divider
no_top_divider bottom_divider

@anikiki anikiki marked this pull request as ready for review October 8, 2024 11:31
@anikiki anikiki changed the title Added feature flag. Address the tasks in the Meta section Oct 8, 2024
@CrisBarreiro CrisBarreiro self-assigned this Oct 9, 2024
@CrisBarreiro CrisBarreiro self-requested a review October 9, 2024 09:22
Copy link
Contributor

@CrisBarreiro CrisBarreiro left a comment

Choose a reason for hiding this comment

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

Added a few comments, but works as expected! 🚀

.onErrorReturn { emptyList() }
.toObservable()
// TODO: ANA - Do we want to have this check here, or somewhere else? (note: this is using the RxComputationThreadPool).
if (autocompleteTabsFeature.self().isEnabled()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's fine to keep it here, but I'm wondering whether we should cache the value, so we don't need to process the toggle every time. See HistoryFeature

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@@ -247,13 +249,18 @@ class AutoCompleteApi @Inject constructor(
}

private fun getAutocompleteSwitchToTabResults(query: String): Observable<MutableList<RankedSuggestion<AutoCompleteSwitchToTabSuggestion>>> =
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Can the return type have List instead of MutableList?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All MutableList were removed after moving away from rxJava -> #5123

.onErrorReturn { emptyList() }
.toObservable()
} else {
Observable.just(mutableListOf())
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Same here, can we just return listOf?

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a few tests here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added 👍

@@ -262,7 +260,7 @@ sealed class AutoCompleteViewHolder(itemView: View) : RecyclerView.ViewHolder(it
editableSearchClickListener: (AutoCompleteSuggestion) -> Unit,
omnibarPosition: OmnibarPosition,
) = with(binding) {
phrase.text = item.phrase
phrase.text = item.phrase.formatIfUrl()
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we move this one level up so we don't need to format phrase for every type of element?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in the final PR -> #5123

@anikiki anikiki force-pushed the feature/ana/add_translations_for_open_tabs_in_search_autosuggest_l10n branch from 1ee6d24 to 12256db Compare October 10, 2024 15:29
@anikiki anikiki force-pushed the feature/ana/address_the_tasks_in_the_meta_section branch from 418720f to cabd77b Compare October 10, 2024 15:29
@anikiki anikiki force-pushed the feature/ana/add_translations_for_open_tabs_in_search_autosuggest_l10n branch from c46cf24 to 5d0ed05 Compare October 10, 2024 15:39
@anikiki anikiki force-pushed the feature/ana/address_the_tasks_in_the_meta_section branch from cabd77b to 16012e8 Compare October 10, 2024 15:39
@anikiki anikiki force-pushed the feature/ana/add_translations_for_open_tabs_in_search_autosuggest_l10n branch from 5d0ed05 to 871743c Compare October 10, 2024 15:45
@anikiki anikiki force-pushed the feature/ana/address_the_tasks_in_the_meta_section branch from 16012e8 to ed1fee2 Compare October 10, 2024 15:45
@anikiki anikiki force-pushed the feature/ana/add_translations_for_open_tabs_in_search_autosuggest_l10n branch from e62d927 to 26275f2 Compare October 11, 2024 16:07
@anikiki anikiki force-pushed the feature/ana/address_the_tasks_in_the_meta_section branch from ed1fee2 to f679db7 Compare October 11, 2024 16:07
@anikiki anikiki force-pushed the feature/ana/add_translations_for_open_tabs_in_search_autosuggest_l10n branch from 26275f2 to 838a6b3 Compare October 18, 2024 12:10
@anikiki anikiki force-pushed the feature/ana/address_the_tasks_in_the_meta_section branch from 4b8c8a2 to e5b9a08 Compare October 18, 2024 12:10
@anikiki anikiki force-pushed the feature/ana/add_translations_for_open_tabs_in_search_autosuggest_l10n branch from e65d5a4 to f7a8db6 Compare October 21, 2024 15:15
Task/Issue URL:
https://app.asana.com/0/1200581511062568/1208040472309277/f

### Description
Removed rxjava from autosuggest.

### Steps to test this PR

Smoke test the autosuggest. There should be no user facing changes.

This is the final PR. See scenarios and screenshots in
https://app.asana.com/0/1200581511062568/1208264037618741/f

### NO UI changes
@anikiki anikiki merged commit a62cc5a into feature/ana/add_translations_for_open_tabs_in_search_autosuggest_l10n Oct 22, 2024
4 checks passed
@anikiki anikiki deleted the feature/ana/address_the_tasks_in_the_meta_section branch October 22, 2024 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants