justinpark opened a new pull request, #29108:
URL: https://github.com/apache/superset/pull/29108

   ### SUMMARY
   Following up #24539 
   This commit modifies the `setActiveQueryEditor` function to asynchronously 
handle the process of switching active a queryEditor in localStorage in the 
same way as in non-persistent mode and periodically post active state to 
persistence via AutoSync's `updateCurrentSqlEditor`.
   
   This commit made the following changes:
   - Modified the process to remove the step of switching the activeQueryEditor 
based on the persistent mode in `switchQueryEditor`, and instead changed it to 
fetchQueryEditor to clearly fetch the persistent queryEditor record from the api
   - In persistence mode, changing the active tab will no longer block the 
query editor data until it is fetched. Instead, the tab will change and a 
loading state will be displayed [see the following screenshots]
   - `setActiveQueryEditor` has been modified to always apply to localStorage 
in the same way as in non-persistence mode
   - EditorAutoSync will execute `updateCurrentSqlEditor` periodically and then 
set `lastUpdatedActiveTab` on success
   - Add the logic of storing localStorage tabHistory for persistence mode 
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   **In a state of network delay**
   
   Before:
   
   
https://github.com/apache/superset/assets/1392866/c9af31fd-d830-4b0a-98e3-28ba0a664d40
   
   After:
   
   
https://github.com/apache/superset/assets/1392866/95b21cc6-5b02-4bf5-85bf-b0684aa11c3b
   
   ### TESTING INSTRUCTIONS
   set SQLLAB_BACKEND_PERSISTENCE on
   go to sqllab and then switch each tab quickly
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org
For additional commands, e-mail: notifications-h...@superset.apache.org

Reply via email to