Skip to content

Conversation

@NPX2218
Copy link

@NPX2218 NPX2218 commented Jan 20, 2026

Adds a reset button to live code playgrounds that restores edited code to its original state. The button appears in the playground header alongside the Live Editor label.

Closes #10711

Pre-flight checklist

  • I have read the Contributing Guidelines on pull requests.
  • If this is a code change: I have written unit tests and/or added dogfooding pages to fully verify the new behavior.
  • If this is a new API or substantial change: the PR has an accompanying issue (closes #0000) and the maintainers have approved on my working plan.

Motivation

Live code playgrounds allow users to edit example code interactively, but there was no way to restore the original code without refreshing the entire page. This PR adds a reset button that allows users to easily restore edited code to its initial state, improving the user experience when experimenting with code examples.

As a student at Northeastern University where we use Docusaurus for course documentation, I wanted to contribute to a tool I actively use. This feature would benefit students and developers who learn by experimenting with code examples in live playgrounds.

Test Plan

Tested locally by creating a live code playground and verifying:

  1. Editing code in the playground
  2. Clicking the Reset button
  3. Code restoring to original state

Added dogfooding test page for manual verification.

Test links

Related issues/PRs

Closes #10711

Adds a reset button to live code playgrounds that restores edited code
to its original state. The button appears in the playground header
alongside the Live Editor label.

Closes facebook#10711
@meta-cla
Copy link

meta-cla bot commented Jan 20, 2026

Hi @NPX2218!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@netlify
Copy link

netlify bot commented Jan 20, 2026

[V2]

Built without sensitive environment variables

Name Link
🔨 Latest commit 953c986
🔍 Latest deploy log https://app.netlify.com/projects/docusaurus-2/deploys/696ec7f64e8bb8000845d965
😎 Deploy Preview https://deploy-preview-11675--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@meta-cla
Copy link

meta-cla bot commented Jan 20, 2026

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@meta-cla meta-cla bot added the CLA Signed Signed Facebook CLA label Jan 20, 2026
@miaromero6401-bot
Copy link

miaromero6401-bot commented Jan 20, 2026 via email

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

Labels

CLA Signed Signed Facebook CLA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Reset Button" option

2 participants