-
Notifications
You must be signed in to change notification settings - Fork 1.3k
For #17800: Request desktop site from home screen. #18653
Conversation
0e56809
to
8b096a7
Compare
@@ -808,7 +810,8 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity { | |||
newTab: Boolean, | |||
engine: SearchEngine?, | |||
forceSearch: Boolean, | |||
flags: EngineSession.LoadUrlFlags = EngineSession.LoadUrlFlags.none() | |||
flags: EngineSession.LoadUrlFlags = EngineSession.LoadUrlFlags.none(), | |||
requestDesktopMode: Boolean? = null |
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.
I think this should default to false
too
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.
Thanks!
ContentAction.UpdateDesktopModeAction( | ||
components.core.store.state.selectedTabId.toString(), true | ||
)) | ||
settings().openNextTabInDesktopMode = false |
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.
is this resetting the mode? it's a bit confusing having this within the if (requestDesktopMode == true)
block
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.
Yes. I added a short comment.
val requestDesktopSiteUseCase = | ||
components.useCases.sessionUseCases.requestDesktopSite | ||
requestDesktopSiteUseCase.invoke(requestDesktopMode) | ||
components.core.store.dispatch( | ||
ContentAction.UpdateDesktopModeAction( | ||
components.core.store.state.selectedTabId.toString(), true | ||
)) | ||
settings().openNextTabInDesktopMode = false |
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.
Nit: create a helper function here (handleRequestDesktopMode()
)
@@ -193,6 +203,9 @@ class HomeMenu( | |||
syncedTabsItem, | |||
bookmarksItem, | |||
historyItem, | |||
BrowserMenuDivider(), | |||
desktopItem, |
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.
I am curious what designs we are using since the home menu ordering doesn't look anything like this anymore.
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.
I am just inserting this item here, I am somewhat unsure on the final designs and if there is any open issue about reordering menu items in the home screen,
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.
The rest of the reordering is in #17770
@@ -1020,4 +1020,9 @@ class Settings(private val appContext: Context) : PreferencesHolder { | |||
default = false, | |||
featureFlag = FeatureFlags.addressesFeature | |||
) | |||
|
|||
var openNextTabInDesktopMode by booleanPreference( |
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.
Our list of settings is getting a bit long. Would you mind adding a comment to describe this preference for future documentation purposes?
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 great! 🎉
For #17800
Pull Request checklist
To download an APK when reviewing a PR: