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

[FEATURE REQUEST] New UI for "Manage accounts" view #4410

Merged
merged 17 commits into from
Jun 25, 2024

Conversation

joragua
Copy link
Collaborator

@joragua joragua commented May 23, 2024

Related Issues

App: #4312

  • Add changelog files for the fixed issues in folder changelog/unreleased. More info here
  • Add feature to Release Notes in ReleaseNotesViewModel.kt creating a new ReleaseNote() with String resources (if required)

QA

Regression test plan over manage accounts: https://github.com/owncloud/QA/blob/master/Mobile/Android/Executions/Release_4.3/Account%20Manager%20Regression.md

@joragua joragua linked an issue May 23, 2024 that may be closed by this pull request
18 tasks
@JuancaG05 JuancaG05 force-pushed the feature/new_ui_manage_accounts branch from 277df42 to 2d78b9e Compare June 5, 2024 12:50
@JuancaG05
Copy link
Collaborator

JuancaG05 commented Jun 17, 2024

Modified too:

  • New message for "Clear local data" dialog, specifying the account for which local data will be removed
  • Second menu from the drawer has been removed
  • Mini-avatars in the drawer have been removed

The aim of the last 2 points is to centralize all the accounts management functionalities in the new dialog

@JuancaG05 JuancaG05 changed the title [FEATURE REQUEST] New UI for Manage Accounts [FEATURE REQUEST] New UI for "Manage accounts" view Jun 20, 2024
@JuancaG05 JuancaG05 marked this pull request as ready for review June 20, 2024 08:37
@JuancaG05 JuancaG05 force-pushed the feature/new_ui_manage_accounts branch from c8c4e08 to be124fc Compare June 20, 2024 08:43
@JuancaG05 JuancaG05 requested a review from Aitorbp June 20, 2024 09:03
Copy link
Contributor

@Aitorbp Aitorbp left a comment

Choose a reason for hiding this comment

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

Some questions here @JuancaG05

@JuancaG05 JuancaG05 requested a review from Aitorbp June 21, 2024 07:57
Copy link
Contributor

@Aitorbp Aitorbp left a comment

Choose a reason for hiding this comment

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

LGTM, ready for QA!

@jesmrec
Copy link
Collaborator

jesmrec commented Jun 21, 2024

(1) [FIXED]

  1. Click on avatar to open Manage Accounts
  2. Change device orientation

Current:

app crashes. This is the stacktrace:

Process: com.owncloud.android.debug, PID: 6409
                 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.owncloud.android.debug/com.owncloud.android.ui.activity.FileDisplayActivity}: androidx.fragment.app.Fragment$InstantiationException: Unable to instantiate fragment com.owncloud.android.presentation.accounts.ManageAccountsDialogFragment: could not find Fragment constructor
                 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3449)
                 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3601)
                 	at android.app.ActivityThread.handleRelaunchActivityInner(ActivityThread.java:5456)
                 	at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:5362)
                 	at android.app.servertransaction.ActivityRelaunchItem.execute(ActivityRelaunchItem.java:69)
                 	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
                 	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
                 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066)
                 	at android.os.Handler.dispatchMessage(Handler.java:106)
                 	at android.os.Looper.loop(Looper.java:223)
                 	at android.app.ActivityThread.main(ActivityThread.java:7656)
                 	at java.lang.reflect.Method.invoke(Native Method)
                 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
                 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
                 Caused by: androidx.fragment.app.Fragment$InstantiationException: Unable to instantiate fragment com.owncloud.android.presentation.accounts.ManageAccountsDialogFragment: could not find Fragment constructor
                 	at androidx.fragment.app.Fragment.instantiate(Fragment.java:681)
                 	at androidx.fragment.app.FragmentContainer.instantiate(FragmentContainer.java:57)
                 	at androidx.fragment.app.FragmentManager$3.instantiate(FragmentManager.java:507)
                 	at androidx.fragment.app.FragmentState.instantiate(FragmentState.java:81)
                 	at androidx.fragment.app.FragmentStateManager.<init>(FragmentStateManager.java:85)
                 	at androidx.fragment.app.FragmentManager.restoreSaveStateInternal(FragmentManager.java:2507)
                 	at androidx.fragment.app.FragmentManager.attachController(FragmentManager.java:2667)
                 	at androidx.fragment.app.FragmentController.attachHost(FragmentController.java:117)
                 	at androidx.fragment.app.FragmentActivity.lambda$init$3$androidx-fragment-app-FragmentActivity(FragmentActivity.java:140)
                 	at androidx.fragment.app.FragmentActivity$$ExternalSyntheticLambda3.onContextAvailable(Unknown Source:2)
                 	at androidx.activity.contextaware.ContextAwareHelper.dispatchOnContextAvailable(ContextAwareHelper.java:99)
                 	at androidx.activity.ComponentActivity.onCreate(ComponentActivity.java:352)
                 	at androidx.fragment.app.FragmentActivity.onCreate(FragmentActivity.java:217)
                 	at com.owncloud.android.ui.activity.DrawerActivity.onCreate(DrawerActivity.kt:418)
                 	at com.owncloud.android.ui.activity.FileActivity.onCreate(FileActivity.java:119)
                 	at com.owncloud.android.ui.activity.FileDisplayActivity.onCreate(FileDisplayActivity.kt:197)
                 	at android.app.Activity.performCreate(Activity.java:8000)
                 	at android.app.Activity.performCreate(Activity.java:7984)
                 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1309)
                 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3422)
                 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3601) 
                 	at android.app.ActivityThread.handleRelaunchActivityInner(ActivityThread.java:5456) 
                 	at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:5362) 
                 	at android.app.servertransaction.ActivityRelaunchItem.execute(ActivityRelaunchItem.java:69) 
                 	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) 
                 	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) 
                 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066) 
                 	at android.os.Handler.dispatchMessage(Handler.java:106) 
                 	at android.os.Looper.loop(Looper.java:223) 
                 	at android.app.ActivityThread.main(ActivityThread.java:7656) 
                 	at java.lang.reflect.Method.invoke(Native Method) 
                 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) 
                 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947) 
                 Caused by: java.lang.NoSuchMethodException: com.owncloud.android.presentation.accounts.ManageAccountsDialogFragment.<init> []
                 	at java.lang.Class.getConstructor0(Class.java:2332)
                 	at java.lang.Class.getConstructor(Class.java:1728)
                 	at androidx.fragment.app.Fragment.instantiate

Expected:

no crash

Android 11, Pixel 2
083b578e

@JuancaG05
Copy link
Collaborator

@jesmrec (1) should be fixed now

@jesmrec
Copy link
Collaborator

jesmrec commented Jun 24, 2024

(2) [FIXED]

  1. Add an account
  2. Download some files
  3. Open Accounts Manager
  4. Click on broom icon to remove the local copies

Current:

Nothing is locally deleted

Expected:

Local copies are removed

Pixel 2, Android 11
997ea67d

@jesmrec
Copy link
Collaborator

jesmrec commented Jun 24, 2024

(3) [WONT FIX HERE]

This one is also reproducible in v4.2.2, that means, it's not a regression. If you think we can get rid of it easily in this branch or PR, it'd be very cool, if not, it could be addressed to a separate issue. I report here because it was detected in the feature's regression test and is tied to the manage accounts. Let me know.

  1. Add one account to the device
  2. Switch to device settings without closing the app
  3. Accounts -> oC account -> Remove Account
  4. Switch to oC account

Current:

app crashes, this is the stacktrace:

 FATAL EXCEPTION: DefaultDispatcher-worker-15
                 Process: com.owncloud.android.debug, PID: 32604
                 java.lang.NullPointerException: Parameter specified as non-null is null: method com.owncloud.android.data.spaces.datasources.implementation.OCLocalSpacesDataSource$Companion.toModel, parameter <this>
                 	at com.owncloud.android.data.spaces.datasources.implementation.OCLocalSpacesDataSource$Companion.toModel(Unknown Source:2)
                 	at com.owncloud.android.data.spaces.datasources.implementation.OCLocalSpacesDataSource.getSpaceWithSpecialsByIdForAccount(OCLocalSpacesDataSource.kt:106)
                 	at com.owncloud.android.data.spaces.repository.OCSpacesRepository.getSpaceWithSpecialsByIdForAccount(OCSpacesRepository.kt:67)
                 	at com.owncloud.android.domain.spaces.usecases.GetSpaceWithSpecialsByIdForAccountUseCase.run(GetSpaceWithSpecialsByIdForAccountUseCase.kt:33)
                 	at com.owncloud.android.domain.spaces.usecases.GetSpaceWithSpecialsByIdForAccountUseCase.run(GetSpaceWithSpecialsByIdForAccountUseCase.kt:27)
                 	at com.owncloud.android.domain.BaseUseCase.invoke(BaseUseCase.kt:30)
                 	at com.owncloud.android.presentation.files.filelist.MainFileListViewModel$updateSpace$1.invokeSuspend(MainFileListViewModel.kt:350)
                 	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
                 	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
                 	at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
                 	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
                 	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
                 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
                 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
                 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
                 	Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@75ce667, Dispatchers.IO]
12:08:33.981  E  FATAL EXCEPTION: DefaultDispatcher-worker-18
                 Process: com.owncloud.android.debug, PID: 32604
                 java.lang.NullPointerException: Parameter specified as non-null is null: method com.owncloud.android.data.spaces.datasources.implementation.OCLocalSpacesDataSource$Companion.toModel, parameter <this>
                 	at com.owncloud.android.data.spaces.datasources.implementation.OCLocalSpacesDataSource$Companion.toModel(Unknown Source:2)
                 	at com.owncloud.android.data.spaces.datasources.implementation.OCLocalSpacesDataSource.getSpaceWithSpecialsByIdForAccount(OCLocalSpacesDataSource.kt:106)
                 	at com.owncloud.android.data.spaces.repository.OCSpacesRepository.getSpaceWithSpecialsByIdForAccount(OCSpacesRepository.kt:67)
                 	at com.owncloud.android.domain.spaces.usecases.GetSpaceWithSpecialsByIdForAccountUseCase.run(GetSpaceWithSpecialsByIdForAccountUseCase.kt:33)
                 	at com.owncloud.android.domain.spaces.usecases.GetSpaceWithSpecialsByIdForAccountUseCase.run(GetSpaceWithSpecialsByIdForAccountUseCase.kt:27)
                 	at com.owncloud.android.domain.BaseUseCase.invoke(BaseUseCase.kt:30)
                 	at com.owncloud.android.presentation.files.filelist.MainFileListViewModel$updateSpace$1.invokeSuspend(MainFileListViewModel.kt:350)
                 	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
                 	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
                 	at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
                 	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
                 	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
                 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
                 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
                 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
                 	Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@b6bac14, Dispatchers.IO]

Expected:

login view displayed with no crash

Pixel 2, Android 11
997ea67d

@JuancaG05
Copy link
Collaborator

@jesmrec (2) should be fixed now. I'm able to reproduce (3) but I don't think it has an immediate fix, so in order not to block the release, we can move it to another issue (also, it produces a crash but after the crash the app works normally, so nothing very intrusive)

@JuancaG05 JuancaG05 force-pushed the feature/new_ui_manage_accounts branch from c12ed3b to 4fd814d Compare June 25, 2024 12:54
@jesmrec
Copy link
Collaborator

jesmrec commented Jun 25, 2024

(2) is fixed and (3) will be addressed to another issue as no-regression

Approved

@JuancaG05 JuancaG05 merged commit 4b65d34 into master Jun 25, 2024
3 checks passed
@JuancaG05 JuancaG05 deleted the feature/new_ui_manage_accounts branch June 25, 2024 14: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.

[FEATURE REQUEST] New UI for "Manage accounts" view
4 participants