Pick the editor landing tab from the team that owns the instance or device - #8755
Merged
Merged
Conversation
…evice The immersive editor routes decide between the Expert and Overview tab in a route redirect, which runs before the instance or device is loaded. At that point the active team is whatever the session last had, or nothing at all, so a team with AI disabled could still land on the Expert tab. Re-check the landing tab once the entity and its owning team are loaded. Move off Expert when that team has it disabled, or onto it when the redirect only picked Overview because the owning team was not known yet. Closes #8749
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8755 +/- ##
=======================================
Coverage 78.35% 78.35%
=======================================
Files 474 474
Lines 25639 25639
Branches 6827 6827
=======================================
Hits 20089 20089
Misses 5550 5550
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
|
Quick local test looks good. I'll let @n-lark review it technically |
n-lark
approved these changes
Oct 5, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #8749
The editor routes pick the landing tab (Expert or Overview) inside the route
redirect, which runs before the instance or device has been fetched. So the check uses whatever team the session last had, or no team at all in a fresh tab. The Expert flags are opt-out, so no team means "enabled" and you land on Expert. By the time the right team loads, the nav hides the Expert tab but the router is already on/editor/expertand the panel stays open.The backend already blocks Expert for these teams, so this is only about where the UI lands.
I added a small
useEditorLandingTabcomposable that both editor pages call once the entity and its team are loaded. If you're on Expert and the owning team has it off, it moves you to Overview. If the redirect put you on Overview only because the team wasn't known yet and the owning team has Expert on, it moves you to Expert. Going to/editor/overviewon purpose is left alone. Only the team that owns the instance or device counts.This is really a symptom of the app not having a predictable way of hydrating itself. The route redirect runs before anything has loaded the instance, its team or the feature flags, so it has to guess from whatever is in the store. Loading the entity first and then correcting the route is the local workaround. The proper fix is the "Hydrate-Before-Route" pattern from #6519, tracked in #6520: the router waits for the team context and feature flags to be in the store before any route logic or component setup runs, at which point this composable goes away and the redirect can just read the right team.