From e650f89dd11a485bf0e0d29c8747016c8c6f8836 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Tue, 15 Oct 2019 16:38:31 -0700 Subject: [PATCH] Add external step UX tip --- docs/data_entry_flow_index.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/data_entry_flow_index.md b/docs/data_entry_flow_index.md index b1651221..0b58ba8c 100644 --- a/docs/data_entry_flow_index.md +++ b/docs/data_entry_flow_index.md @@ -246,6 +246,10 @@ class ExampleConfigFlow(data_entry_flow.FlowHandler): ) ``` +Avoid doing work based on the external step data before you return an `async_mark_external_step_done`. Instead, do the work in the step that you refer to as `next_step_id` when marking the external step done. This will give the user a better user experience by showing a spinner in the UI while the work is done. + +If you do the work inside the authorize callback, the user will stare at a blank screen until that all of a sudden closes because the data has forwarded. If you do the work before marking the external step as done, the user will still see the form with the "Open external website" button while the background work is being done. That too is undesirable. + Example code to mark an external step as done: ```python