Modal to modal (Dialog fragment) navigation then dismiss behaviour
mrfidgety opened this issue · 0 comments
mrfidgety commented
When navigating to a modal, then following a route that also presents as a modal, the following occurs:
- First modal navigation works as expected
- Second modal navigation works as expected (unsure if first modal is expected to remain 'behind' this one, it does)
- Closing second modal results in the first modal being revealed, but no interaction works, except for closing the modal.
The logs indicate the visit location upon closing the second modal (signup route) becomes the root route, not the login route.
Expectations:
- If we expect the original (first) modal to remain, then closing the second modal should render the original modal interactable
- If we don't expect the original (first) modal to remain, then visiting another modal should dismiss the original modal, or treat it as a "replace" action.
Through testing, this only occurs when the modals use uri: "turbo://fragment/web/modal/sheet"
which uses a TurboWebBottomSheetDialogFragment()
. If all path configs use "turbo://fragment/web"
it seems fine.
Let me know if I have configured something incorrectly. For context my path configuration has:
{
patterns: [".*"],
properties: {
context: "default",
pull_to_refresh_enabled: true,
uri: "turbo://fragment/web"
}
},
{
patterns: %w[
/new
/edit
/login
/signup
/contact
/passwords/reset
/spotted/collect
/account/close
],
properties: {
context: "modal",
pull_to_refresh_enabled: false,
uri: "turbo://fragment/web/modal/sheet"
},
},
{
patterns: %w[
/$
/spotted$
/browse$
],
properties: {
presentation: "replace_root",
uri: "turbo://fragment/web"
}
}
Video
Screen_recording_20240615_112959.webm
Logcat
11:20:02.972 D visitProposedToLocation ........... [session: main, location: http://10.0.2.2:5000/login, options: TurboVisitOptions(action=ADVANCE, snapshotHTML=null, response=null)]
11:20:02.980 D shouldNavigateToLocation .......... [session: main, location: http://10.0.2.2:5000/login, shouldNavigate: true, currentFragment: WebFragment]
11:20:02.981 D navigate .......................... [session: main, location: http://10.0.2.2:5000/login, options: TurboVisitOptions(action=ADVANCE, snapshotHTML=null, response=null), currentContext: DEFAULT, newContext: MODAL, presentation: PUSH, currentFragment: WebFragment]
11:20:02.981 D navigateToModalContext ............ [session: main, location: http://10.0.2.2:5000/login, currentFragment: WebFragment]
11:20:03.001 D navigateToLocation ................ [session: main, location: http://10.0.2.2:5000/login, uri: turbo://fragment/web/modal/sheet, currentFragment: WebFragment]
11:20:03.005 I com.pitloon.pitloon_android:7782d705: onRequestHide at ORIGIN_CLIENT_HIDE_SOFT_INPUT reason HIDE_SOFT_INPUT
11:20:03.022 D fragment.onViewCreated ............ [session: main, location: http://10.0.2.2:5000/login, fragment: WebBottomSheetFragment]
11:20:03.029 D fragment.onStart .................. [session: main, location: http://10.0.2.2:5000/login, fragment: WebBottomSheetFragment]
11:20:03.040 E Unable to match the desired swap behavior.
11:20:03.058 D visitLocation ..................... [session: main, location: http://10.0.2.2:5000/login, options: TurboVisitOptions(action=ADVANCE, snapshotHTML=null, response=null), restorationIdentifier: ]
11:20:03.059 D visitStarted ...................... [session: main, location: http://10.0.2.2:5000/login, visitIdentifier: 8656a6eb-c40d-48d4-ada6-47dae8ba2b9a, visitHasCachedSnapshot: true, visitIsPageRefresh: false]
11:20:03.063 D visitRequestStarted ............... [session: main, visitIdentifier: 8656a6eb-c40d-48d4-ada6-47dae8ba2b9a]
11:20:03.124 D visitRendered ..................... [session: main, visitIdentifier: 8656a6eb-c40d-48d4-ada6-47dae8ba2b9a]
11:20:03.129 D visitRequestFinished .............. [session: main, visitIdentifier: 8656a6eb-c40d-48d4-ada6-47dae8ba2b9a]
11:20:03.206 D visitRequestCompleted ............. [session: main, visitIdentifier: 8656a6eb-c40d-48d4-ada6-47dae8ba2b9a]
11:20:03.218 D visitVisualStateComplete .......... [session: main, visitIdentifier: 8656a6eb-c40d-48d4-ada6-47dae8ba2b9a]
11:20:03.245 D visitRendered ..................... [session: main, visitIdentifier: 8656a6eb-c40d-48d4-ada6-47dae8ba2b9a]
11:20:03.246 D visitCompleted .................... [session: main, visitIdentifier: 8656a6eb-c40d-48d4-ada6-47dae8ba2b9a, restorationIdentifier: 8c66e203-ec0b-4e31-ae5b-eba45289cec3]
11:20:03.264 D visitVisualStateComplete .......... [session: main, visitIdentifier: 8656a6eb-c40d-48d4-ada6-47dae8ba2b9a]
11:20:04.666 D app_time_stats: avg=101.21ms min=2.55ms max=1383.02ms count=15
11:20:04.963 D visitProposedToLocation ........... [session: main, location: http://10.0.2.2:5000/signup, options: TurboVisitOptions(action=ADVANCE, snapshotHTML=null, response=null)]
11:20:04.978 D shouldNavigateToLocation .......... [session: main, location: http://10.0.2.2:5000/signup, shouldNavigate: true, currentFragment: WebBottomSheetFragment]
11:20:04.979 D navigate .......................... [session: main, location: http://10.0.2.2:5000/signup, options: TurboVisitOptions(action=ADVANCE, snapshotHTML=null, response=null), currentContext: MODAL, newContext: MODAL, presentation: PUSH, currentFragment: WebBottomSheetFragment]
11:20:04.979 D navigateWithinContext ............. [session: main, location: http://10.0.2.2:5000/signup, presentation: PUSH, currentFragment: WebBottomSheetFragment]
11:20:04.999 D navigateToLocation ................ [session: main, location: http://10.0.2.2:5000/signup, uri: turbo://fragment/web/modal/sheet, currentFragment: WebBottomSheetFragment]
11:20:05.002 I com.pitloon.pitloon_android:d5fe1238: onRequestHide at ORIGIN_CLIENT_HIDE_SOFT_INPUT reason HIDE_SOFT_INPUT
11:20:05.020 D fragment.onViewCreated ............ [session: main, location: http://10.0.2.2:5000/signup, fragment: WebBottomSheetFragment]
11:20:05.023 D fragment.onStart .................. [session: main, location: http://10.0.2.2:5000/signup, fragment: WebBottomSheetFragment]
11:20:05.036 E Unable to match the desired swap behavior.
11:20:05.050 D visitLocation ..................... [session: main, location: http://10.0.2.2:5000/signup, options: TurboVisitOptions(action=ADVANCE, snapshotHTML=null, response=null), restorationIdentifier: ]
11:20:05.051 D visitStarted ...................... [session: main, location: http://10.0.2.2:5000/signup, visitIdentifier: 7922171e-5c58-4653-9192-29963e0795c8, visitHasCachedSnapshot: true, visitIsPageRefresh: false]
11:20:05.053 D visitRequestStarted ............... [session: main, visitIdentifier: 7922171e-5c58-4653-9192-29963e0795c8]
11:20:05.129 D visitRequestFinished .............. [session: main, visitIdentifier: 7922171e-5c58-4653-9192-29963e0795c8]
11:20:05.132 D visitRequestCompleted ............. [session: main, visitIdentifier: 7922171e-5c58-4653-9192-29963e0795c8]
11:20:05.151 D visitRendered ..................... [session: main, visitIdentifier: 7922171e-5c58-4653-9192-29963e0795c8]
11:20:05.198 D visitRendered ..................... [session: main, visitIdentifier: 7922171e-5c58-4653-9192-29963e0795c8]
11:20:05.199 D visitCompleted .................... [session: main, visitIdentifier: 7922171e-5c58-4653-9192-29963e0795c8, restorationIdentifier: e888e609-a899-431d-8c38-9359c089837a]
11:20:05.200 D visitVisualStateComplete .......... [session: main, visitIdentifier: 7922171e-5c58-4653-9192-29963e0795c8]
11:20:05.217 D visitVisualStateComplete .......... [session: main, visitIdentifier: 7922171e-5c58-4653-9192-29963e0795c8]
11:20:06.666 D app_time_stats: avg=117.24ms min=3.99ms max=1420.89ms count=13
11:20:06.893 W sendCancelIfRunning: isInProgress=falsecallback=com.google.android.material.motion.MaterialBackOrchestrator$Api34BackCallbackDelegate$1@20f1218
11:20:06.906 D endAllActiveAnimators on 0xb4000079272766b0 (RippleDrawable) with handle 0xb400007a972935d0
11:20:06.912 D fragment.onDialogCancel ........... [session: main, location: http://10.0.2.2:5000/signup, fragment: WebBottomSheetFragment]
11:20:06.913 D fragment.onStartAfterDialogCancel . [session: main, location: http://10.0.2.2:5000, fragment: WebFragment]
11:20:06.917 D fragment.onDialogDismiss .......... [session: main, location: http://10.0.2.2:5000/signup, fragment: WebBottomSheetFragment]
11:20:06.918 D app_time_stats: avg=1002.52ms min=8.99ms max=3903.88ms count=4
11:20:06.923 D visitLocation ..................... [session: main, location: http://10.0.2.2:5000, options: TurboVisitOptions(action=RESTORE, snapshotHTML=null, response=null), restorationIdentifier: 22a849d9-0d74-4c64-8ac8-50e517a4b269]
11:20:06.924 D visitStarted ...................... [session: main, location: http://10.0.2.2:5000/, visitIdentifier: da89e1b4-9dbc-4d9d-9e19-40a07b4a7918, visitHasCachedSnapshot: true, visitIsPageRefresh: false]
11:20:06.926 D fragment.onStop ................... [session: main, location: http://10.0.2.2:5000/signup, fragment: WebBottomSheetFragment]
11:20:06.968 D app_time_stats: avg=88.54ms min=9.55ms max=1752.58ms count=26
11:20:07.084 D visitRendered ..................... [session: main, visitIdentifier: da89e1b4-9dbc-4d9d-9e19-40a07b4a7918]
11:20:07.085 D visitCompleted .................... [session: main, visitIdentifier: da89e1b4-9dbc-4d9d-9e19-40a07b4a7918, restorationIdentifier: 22a849d9-0d74-4c64-8ac8-50e517a4b269]
11:20:07.099 D visitVisualStateComplete .......... [session: main, visitIdentifier: da89e1b4-9dbc-4d9d-9e19-40a07b4a7918]
11:20:08.542 D app_time_stats: avg=270.69ms min=13.22ms max=1426.22ms count=6