Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Migrate SessionControl to LibState #5574

Closed
colintheshots opened this issue Sep 25, 2019 · 7 comments · Fixed by #6651
Closed

Migrate SessionControl to LibState #5574

colintheshots opened this issue Sep 25, 2019 · 7 comments · Fixed by #6651
Assignees
Labels
E8 Estimation Point: about 8 days eng:health Improve code health eng:qa:verified QA Verified help wanted Help wanted from a contributor. More complex than good first issue. P2 Upcoming release performance Possible performance wins
Milestone

Comments

@colintheshots
Copy link
Contributor

colintheshots commented Sep 25, 2019

User Story

As a developer, I'd like SessionControl to implement LibState.

As a user, I'd appreciate a faster cold app startup achieved by not initiating RxJava's AndroidSchedulers.mainThread by blocking the main thread for 42ms.

Dependencies

None

Acceptance Criteria

  • SessionControl implements LibState
  • SessionControl has tests

┆Issue is synchronized with this Jira Task

@colintheshots colintheshots added eng:health Improve code health performance Possible performance wins P2 Upcoming release E8 Estimation Point: about 8 days labels Sep 25, 2019
@colintheshots colintheshots added this to To be Triaged in Fenix Sprint Kanban via automation Sep 25, 2019
@colintheshots colintheshots moved this from To be Triaged to Prioritized Eng Backlog in Fenix Sprint Kanban Sep 25, 2019
@sblatz sblatz added the help wanted Help wanted from a contributor. More complex than good first issue. label Sep 27, 2019
@liuche
Copy link
Contributor

liuche commented Oct 1, 2019

@baron-severin this is another LibState bug that you could pick up as well - christian has been more than happy to help out with these, in terms of pairing or answering questions, etc. Once these are all finished, we can start removing architecture code that supports the pre-LibState state.

@mcomella mcomella added this to Needs triage in Performance, front-end roadmap Oct 7, 2019
@gabrielluong gabrielluong self-assigned this Nov 6, 2019
@project-bot project-bot bot moved this from Needs prioritization to In progress in Performance, front-end roadmap Nov 6, 2019
@severinrudie
Copy link
Contributor

It looks like this one is 'in progress' on another board. Moving it there in the Fenix sprint kanban.

@severinrudie severinrudie moved this from Prioritized Eng Backlog to In Progress in Fenix Sprint Kanban Nov 15, 2019
gabrielluong added a commit to gabrielluong/fenix that referenced this issue Nov 17, 2019
…ControlInteractor and SessionControlController.

- Introduces the SessionControlInteractor and SessionControlController classes.
- Removes the TabAction.SaveTabGroup.
gabrielluong added a commit to gabrielluong/fenix that referenced this issue Nov 17, 2019
…ControlInteractor and SessionControlController. (mozilla-mobile#6651)

- Introduces the SessionControlInteractor and SessionControlController classes.
- Removes the TabAction.SaveTabGroup.
gabrielluong added a commit to gabrielluong/fenix that referenced this issue Nov 17, 2019
…n to SessionControlInteractor and SessionControlController (mozilla-mobile#6651)
gabrielluong added a commit to gabrielluong/fenix that referenced this issue Nov 17, 2019
…n to SessionControlInteractor and SessionControlController (mozilla-mobile#6651)
gabrielluong added a commit to gabrielluong/fenix that referenced this issue Nov 17, 2019
gabrielluong added a commit to gabrielluong/fenix that referenced this issue Nov 17, 2019
…abItemMenu (mozilla-mobile#6651)

In mozilla-mobile#2205, the tab overflow button was removed which would have shown the
TabItemMenu when clicked. So, we can remove TabItemMenu since it is not
used and as a result, we can also remove TabAction.Share since there are
no consumers.
gabrielluong added a commit to gabrielluong/fenix that referenced this issue Nov 17, 2019
…ionControlInteractor and SessionControlController. (mozilla-mobile#6651)

- Introduces the SessionControlInteractor and SessionControlController classes.
- Removes the TabAction.SaveTabGroup.
gabrielluong added a commit to gabrielluong/fenix that referenced this issue Nov 17, 2019
…More to SessionControlInteractor and SessionControlController (mozilla-mobile#6651)
gabrielluong added a commit to gabrielluong/fenix that referenced this issue Nov 17, 2019
gabrielluong added a commit to gabrielluong/fenix that referenced this issue Nov 17, 2019
…abItemMenu (mozilla-mobile#6651)

In mozilla-mobile#2205, the tab overflow button was removed which would have shown the
TabItemMenu when clicked. So, we can remove TabItemMenu since it is not
used and as a result, we can also remove TabAction.Share since there are
no consumers.
gabrielluong added a commit to gabrielluong/fenix that referenced this issue Nov 17, 2019
…ion.PauseMedia to SessionControlInteractior and SessionControlControler (mozilla-mobile#6651)
gabrielluong added a commit to gabrielluong/fenix that referenced this issue Nov 17, 2019
…ion.PauseMedia to SessionControlInteractor and SessionControlController (mozilla-mobile#6651)
gabrielluong added a commit to gabrielluong/fenix that referenced this issue Nov 17, 2019
gabrielluong added a commit to gabrielluong/fenix that referenced this issue Nov 17, 2019
gabrielluong added a commit to gabrielluong/fenix that referenced this issue Nov 17, 2019
gabrielluong added a commit to gabrielluong/fenix that referenced this issue Dec 4, 2019
gabrielluong added a commit to gabrielluong/fenix that referenced this issue Dec 4, 2019
gabrielluong added a commit to gabrielluong/fenix that referenced this issue Dec 4, 2019
gabrielluong added a commit to gabrielluong/fenix that referenced this issue Dec 4, 2019
gabrielluong added a commit to gabrielluong/fenix that referenced this issue Dec 4, 2019
…faultSessionControlController and SessionControlInteractor (mozilla-mobile#6651)
boek added a commit to gabrielluong/fenix that referenced this issue Dec 5, 2019
Performance, front-end roadmap automation moved this from Backlog (prioritized) to Done Dec 5, 2019
gabrielluong added a commit that referenced this issue Dec 5, 2019
* For #5574 - Part 1: Port TabAction.SaveTabGroup to TabSessionInteractor and SessionControlController. (#6651)

- Introduces the TabSessionInteractor, SessionControlInteractor and SessionControlController classes.
- Removes the TabAction.SaveTabGroup.

* For #5574 - Part 2: Port TabAction.PrivateBrowsingLearnMore to TabSessionInteractor and SessionControlController (#6651)

* For #5574 - Part 3: Port TabAction.ShareTabs to TabSessionInteractor and SessionControlController (#6651)

* For #5574 - Part 4: Remove unused TabAction.Share and TabItemMenu (#6651)

In #2205, the tab overflow button was removed which would have shown the
TabItemMenu when clicked. So, we can remove TabItemMenu since it is not
used and as a result, we can also remove TabAction.Share since there are
no consumers.

* For #5574 - Part 5: Port TabAction.PlayMedia and TabAction.PauseMedia to TabSessionInteractor and SessionControlController (#6651)

* For #5574 - Part 6: Port TabAction.Select to TabSessionInteractor and SessionControlController (#6651)

* For #5574 - Part 7: Port Onboarding.Finish to OnboardingInteractor and SessionControlController (#6651)

* For #5574 - Part 8: Port TabAction.Close and TabAction.CloseAll to TabSessionInteractor and SessionControlController (#6651)

- Removes TabAction

* For #5574 - Part 9: Port CollectionAction.Delete to CollectionInteractor and SessionControlController (#6651)

* For #5574 - Part 10: Port CollectionAction.ShareTabs to CollectionInteractor and SessionControlController (#6651)

* For #5574 - Part 11: Port CollectionAction.AddTab and CollectionAction.Rename to CollectionInteractor and SessionControlController (#6651)

* For #5574 - Part 12: Port CollectionAction.RemoveTab to CollectionInteractor and SessionControlController (#6651)

* For #5574 - Part 13: Port CollectionAction.OpenTab to CollectionInteractor and SessionControlController (#6651)

* For #5574 - Part 14: Port CollectionAction.CloseTabs to CollectionInteractor and SessionControlController (#6651)

* For #5574 - Part 15: Introduce a HomeFragmentStore (#6651)

- We will hook up the HomeFragmentStore in later parts.
- Removes List<Tab>.toSessionBundle(context: Context) since it is unused.

* For #5574 - Part 16: Port CollectionAction.Collapse and CollectionAction.Expand to CollectionInteractor and SessionControlController (#6651)

- We assume the store is hooked up to the SessionControlController in this part,
but this work will be done in a later part.
- Removes CollectionAction.

* For #5574 - Part 20: Remove the architecture module. (#6651)

* For #5574 - Part 17:  Remove duplicate subscribeToTabCollections in BrowserFragment.kt (#6651)

There is a duplicate call of subscribeToTabCollections() in both HomeFragment and BrowserFragment.
In this patch, we remove the call in BrowserFragment to avoid passing the HomeFragmentStore to
BrowserFragment in order to dispatch the CollectionsChange event.

* For #5574 - Part 18: Delete SessionControlComponent and fix TabCollection and Tab imports (#6651)

* For #5574 - Part 19: Use the new HomeFragmentStore in the HomeFragment (#6651)

- Renames SessionControlUIView to SessionControlView

* For #5574 - Part 21: Fix white screen on home fragment (#6651)

* For #5574 - Part 22: Fix formatting in SessionControlInteractor and replace See with @see in SessionControlController (#6651)

* For #5574 - Part 23: Move to metrics.track call to the beginning of handleCollectionRemoveTab (#6651)

This ensures that the metrics.track will be called immediately before the tab is removed from the collection.

* For #5574 - Part 24: Use the sessionManager getter in SessionControlController (#6651)

* For #5574 - Part 25: Use mapNotNull in List<Tab>.toSessionBundle (#6651)

* For #5574 - Part 26: Simplify closeTab and closeAllTabs functions by assigning a deletionJob constant (#6651)

* For #5574 - Part 27: Replace listOf() with emptyList() in removeAllTabsWithUndo (#6651)

* For #5574 - Part 28: Replace the Context parameter with the HomeActivity in SessionControlController (#6651)

* For #5574 - Part 29: Add test for HomeFragmentStore, DefaultSessionControlController and SessionControlInteractor (#6651)

* For #5574 - Removes running CI against the architecture debug build varient
@project-bot project-bot bot moved this from In Progress to Sprint 12.1 Done in Fenix Sprint Kanban Dec 5, 2019
@boek boek added the eng:qa:needed QA Needed label Dec 5, 2019
@project-bot project-bot bot moved this from Sprint 12.1 Done to Ready for QA in Fenix Sprint Kanban Dec 5, 2019
@gabrielluong gabrielluong reopened this Dec 5, 2019
Fenix Sprint Kanban automation moved this from Ready for QA to In Progress Dec 5, 2019
Performance, front-end roadmap automation moved this from Done to In progress Dec 5, 2019
@gabrielluong gabrielluong moved this from In Progress to Ready for QA in Fenix Sprint Kanban Dec 5, 2019
@liuche liuche added this to the v3.0 milestone Dec 7, 2019
@AndiAJ
Copy link
Collaborator

AndiAJ commented Dec 18, 2019

Hi @colintheshots, could you please give us a heads up on how should we test this matter? and on what should we focus while testing. ☺️

@gabrielluong
Copy link
Member

Hi @colintheshots, could you please give us a heads up on how should we test this matter? and on what should we focus while testing. ☺️

Actually, I can do that. It will take me a bit of time, but I should have an extensive list of things in a few hours.

@gabrielluong
Copy link
Member

So, this is unfortunately gonna be long because we converted most of the architecture in the Home fragment. As a result, we need to check everything feature this architectural change touched. The Home fragment is basically gonna be our starting point for every bullet point that needs to be tested.

Collections

  • Check that the Collection Creation fragment (this allows you to select the tabs and add them to a collection) is shown when an user taps on the "Add tab" collection menu item.
  • A tab is opened when a user clicks on a tab in a collection.
  • All the tabs in a collection is opened when an user taps on the "Open tabs" collection menu item.
  • A tab is removed from a collection when an user swipes to remove a tab or clicks on the tab close button.
  • Shares the tabs in a collection when an user clicks on the Collection Share button.
  • Show a prompt for deleting a collection when an user taps on the "Delete collection" collection menu item.
  • Show the Collection Creation fragment when an user taps on the "Rename collection" collection menu item.
  • Toggle expanding and collapsing a collection when an user clicks on a collection header.

Onboarding

  • Hides the onboarding when an user clicks on the "Start Browsing" button.

Tabs

  • A tab is closed when an user swipes to close a tab or clicks on the Close Tab button.
  • All tabs are closed when an user clicks on the Close Tabs button or "Close all tabs".
  • All playing Media are paused when an user clicks on the Pause button in the tab view.
  • Resume playing all paused Media when an user clicks on the Play button in the tab view.
  • Show the Private Browsing Learn More page in a new tab when an user clicks on "Common myths about private browsing" link in private mode.
  • Save a tab to a collection when an user clicks on the "Save to collection" button or in the tab menu item and on a long click of an open tab.
  • Selects a tab when an user clicks on a tab.
  • Shares the current opened tabs when an user clicks on the Share Tabs button in private mode or in the tab menu item in non-private mode.

@gabrielluong
Copy link
Member

gabrielluong commented Dec 19, 2019

We'll also need to test the following functionality:

  • Returning to the Home fragment (from an opened tab) shows the correct list of collections, tabs and mode.
  • Adding tab(s) to collections work correctly.
  • Switching between private and normal mode works as expected

@Diana-Rus
Copy link

Hi @colintheshots,
Verifed the scenarios, from the last 2 comments, no regression has been encountered, on build Firefox Preview Nightly 12/23 #13570607 using:

  • Google Pixel 3a XL (Android 10)
  • OnePlus 5T (Android 9)

@AndiAJ AndiAJ closed this as completed Dec 24, 2019
Performance, front-end roadmap automation moved this from In progress to Done Dec 24, 2019
@project-bot project-bot bot moved this from Ready for QA to Sprint 12.2 Done in Fenix Sprint Kanban Dec 24, 2019
@AndiAJ AndiAJ added eng:qa:verified QA Verified and removed eng:qa:needed QA Needed labels Dec 24, 2019
@project-bot project-bot bot moved this from Sprint 12.2 Done to Sprint Backlog in Fenix Sprint Kanban Dec 24, 2019
@project-bot project-bot bot moved this from Sprint Backlog to Sprint 12.2 Done in Fenix Sprint Kanban Dec 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
E8 Estimation Point: about 8 days eng:health Improve code health eng:qa:verified QA Verified help wanted Help wanted from a contributor. More complex than good first issue. P2 Upcoming release performance Possible performance wins
Development

Successfully merging a pull request may close this issue.

8 participants