Skip to content

Keep editor mounted and focus Run after first save - #1691

Merged
jamiebenstead merged 2 commits into
mainfrom
1668-save-triggers-full-page-refresh-and-loses-focus
Oct 20, 2026
Merged

jamiebenstead merged 2 commits into
mainfrom
1668-save-triggers-full-page-refresh-and-loses-focus

Conversation

@jamiebenstead

Copy link
Copy Markdown
Contributor

closes https://github.com/RaspberryPiFoundation/digital-editor-issues/issues/1668

Changes

  • EditorSlice: remix and save no longer set loading = "idle", so the
    editor stays mounted. The remix response already contains the full
    project.
  • WebComponentLoader: switches to the new project ID when saving
    succeeds and the ID changes.
  • useProject: skips the fetch when the save has just returned the
    project.
  • RunnerControls: moves focus to Run after a manual save, because the
    Save button disappears once the user owns the project.

The first save of someone else's project creates a remix. The remix
reducer set loading to "idle", which unmounted the editor and loaded
the project again. To the user this looked like a page refresh, and
focus was reset.

Remove the "idle" reset, because the remix response already contains
the full project. WebComponentLoader now switches to the new project
ID when saving succeeds and the ID changes. useProject skips the
fetch when the stored project already matches the requested ID and
the save and load both succeeded.

The Save button disappears once the user owns the project, so focus
now moves to Run.
Copilot AI balanced review requested due to automatic review settings October 16, 2026 12:07

Copilot AI left a comment

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

Copilot AI left a comment

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

@jamiebenstead

Copy link
Copy Markdown
Contributor Author

@macroscope-app review

@macroscopeapp

macroscopeapp Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Manual reviews triggered for commit 081d8af:

All prior checks · these links stay valid even if you push more commits.

@macroscopeapp

macroscopeapp Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Review triggered; results will be posted as check runs.

@macroscopeapp

macroscopeapp Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs Human Approval

Macroscope's review found this PR requires human approval — The PR changes the shared save/load lifecycle so the editor remains mounted, avoids a project reload, adopts new identifiers, and moves focus after manual saves. These are intentional and tested, but they materially alter existing cross-component runtime behavior and merit human review.

Needs human approval because:

  • automatic approval is not enabled for this workspace

Notes:

  • Diff unchanged. Approvability was decided on eligibility alone.

Enable approvability here. You can add or adjust custom eligibility rules. Learn more.

@zetter-rpf
zetter-rpf requested a review from cocomarine October 19, 2026 08:49

@cocomarine cocomarine left a comment

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.

LGTM

@jamiebenstead
jamiebenstead merged commit 39dca8b into main Oct 20, 2026
13 checks passed
@jamiebenstead
jamiebenstead deleted the 1668-save-triggers-full-page-refresh-and-loses-focus branch October 20, 2026 08:43

This branch was successfully deployed

1 active deployment
previews/1691/merge — 081d8afe Deployed Oct 16, 2026 by jamiebenstead via deploy-branch / build-deploy #6920
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.

3 participants