Skip to content

Pick the editor landing tab from the team that owns the instance or device - #8755

Merged
cstns merged 2 commits into
mainfrom
fix/editor-landing-tab-owning-team
Oct 6, 2026
Merged

cstns merged 2 commits into
mainfrom
fix/editor-landing-tab-owning-team

Conversation

@cstns

@cstns cstns commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

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/expert and 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 useEditorLandingTab composable 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/overview on 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.

…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
@cstns cstns self-assigned this Oct 5, 2026
@cstns
cstns deployed to staging October 5, 2026 09:46 — with GitHub Actions Active
@cstns
cstns requested review from hardillb and n-lark October 5, 2026 09:51
@codecov

codecov Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.35%. Comparing base (bfaaa30) to head (9267313).
⚠️ Report is 1 commits behind head on main.

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           
Flag Coverage Δ
backend 78.35% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@hardillb

hardillb commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Quick local test looks good.

I'll let @n-lark review it technically

@cstns
cstns enabled auto-merge (squash) October 6, 2026 07:50
@cstns
cstns deployed to staging October 6, 2026 07:54 — with GitHub Actions Active
@cstns
cstns merged commit 76455ed into main Oct 6, 2026
28 checks passed
@cstns
cstns deleted the fix/editor-landing-tab-owning-team branch October 6, 2026 08:11
@cstns
cstns deployed to staging October 6, 2026 08:11 — with GitHub Actions Active

This branch was successfully deployed

1 active deployment
staging — 92673139 Deployed Oct 6, 2026 by cstns via Remove application #12174
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Opening a device embedded editor shows expert even when team level disable it ticked

3 participants