Skip to content

Exit scene live mode when leaving the editor - #53837

Open
MindFreeze wants to merge 2 commits into
devfrom
exit-scene-live-mode-on-leave
Open

Exit scene live mode when leaving the editor#53837
MindFreeze wants to merge 2 commits into
devfrom
exit-scene-live-mode-on-leave

Conversation

@MindFreeze

Copy link
Copy Markdown
Member

Proposed change

Leaving the scene editor while live editing only unsubscribed from state_changed. Devices stayed in the live-activated state. The back button already restored stored states; other ways of leaving (sidebar, switching scenes after #53826 remounts the editor) did not.

This calls _exitLiveMode on disconnect so stored pre-live states are applied again. It skips that restore when document.hidden is true, so the five-minute hidden-tab panel suspend does not undo live mode.

Stacked on #53826.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • I understand the code I am submitting and can explain how it works.
  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • I have followed the perfect PR recommendations
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

If user exposed functionality or configuration variables are added/changed:

To help with the load of incoming pull requests:

@github-actions github-actions Bot added the Tests: Unit Related to Vitest unit tests label Aug 27, 2026

@piitaya piitaya left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure the test are really necessary. Otherwise, I agree on the fix.

@marcinbauer-ohf

Copy link
Copy Markdown
Member

@MindFreeze since you're working on this flow, could you please take a look at this? #53694
It's a long standing bug that pains a lot of Android users 🥺

@github-actions github-actions Bot removed the Tests: Unit Related to Vitest unit tests label Aug 27, 2026
Base automatically changed from remount-editor-on-item-switch to dev August 27, 2026 15:04
Leaving the page previously only unsubscribed, so live-activated
device states stayed behind. Restore stored states unless the tab
is hidden for panel suspend.
@bramkragten
bramkragten force-pushed the exit-scene-live-mode-on-leave branch from 020e774 to 7347aac Compare August 27, 2026 15:04
};

private _goBack(): void {
if (this._mode === "live") {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Go back now triggers applyScene twice right?
So goBack should now or remove this if with apply or swap it to exitLiveMode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants