Improve delete site focus tab and selected site id - #2480
Conversation
- Update the logic to reset the selected tab to 'overview' only if the currently selected site no longer exists and a selection change has occurred. - Improve clarity in comments regarding selection changes and tab resets.
📊 Performance Test ResultsComparing 86a88f2 vs trunk site-editor
site-startup
Results are median values from multiple test runs. Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change |
There was a problem hiding this comment.
Thanks for suggesting this approach @sejas! I experimented with this approach earlier as well, and I found that it doesn't always work as expected when following these steps:
- Delete a site
- Don't switch site, but optionally switch tabs
- Observe that the selected site is updated to the first site, but the selected tab isn't updated to "Overview"
CleanShot.2026-01-27.at.09.49.36.mp4
I think this might be caused by the selectedSiteId being set from the SITE_EVENTS.DELETED event listener, and the tab state update being prevented from running.
|
@gcsecsey, thanks for reviewing the PR. I tested it again and I'm not able to reproduce your issue. delete-site-switch-to-overview-or-keep-navigation.mp4 |
|
Thanks for huddling about these PRs @sejas! I tested these changes on Windows x64 too because I was suspicious that something's off with my environment on Mac. I see the same issue when deleting a site, and staying on the same site: CleanShot.2026-01-27.at.11.28.32.mp4As we discussed on the huddle, it might be worth looking into unifying the deletion logic across |
|
Thank you @gcsecsey , let's go with your approach! |
Related issues
Proposed Changes
Testing Instructions
Pre-merge Checklist