feat(theme-live-codeblock): add reset button to live code playground#11675
feat(theme-live-codeblock): add reset button to live code playground#11675NPX2218 wants to merge 2 commits intofacebook:mainfrom
Conversation
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
|
Hi @NPX2218! Thank you for your pull request and welcome to our community. Action RequiredIn 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. ProcessIn 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 If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
✅ [V2]Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
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
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:
Added dogfooding test page for manual verification.
Test links
Related issues/PRs
Closes #10711