-
Notifications
You must be signed in to change notification settings - Fork 31
A scratch pad for temporary DoenetML editing #2715
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces a Scratch Pad feature that allows users to experiment with DoenetML editing in a temporary, non-persistent workspace. Users can load example documents, edit DoenetML code, and optionally load existing content into the scratch pad for experimentation.
Key changes:
- Added a new
/scratchPadroute with a full-featured DoenetML editor that uses localStorage for temporary storage - Introduced server-side support for retrieving the default DoenetML version via a new API endpoint
- Added the ability to load documents into the Scratch Pad from the content menu, with restrictions for non-default DoenetML versions
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| server/src/types.ts | Added optional doenetmlVersion field to ContentDescription type |
| server/src/query/activity.ts | Extracted getDefaultDoenetmlVersion function and refactored existing code to use it |
| server/src/routes/infoRoutes.ts | Added /getDefaultDoenetmlVersion endpoint to expose default version info |
| server/src/test/activity.test.ts | Added test coverage for the new getDefaultDoenetmlVersion function |
| client/src/types.ts | Mirrored server-side type change for ContentDescription |
| client/src/paths/ScratchPad.tsx | Implemented main Scratch Pad component with DoenetML editor, example loading, and localStorage persistence |
| client/src/popups/AddContentToMenu.tsx | Added "Load into Scratch Pad" menu item with version compatibility checking |
| client/src/paths/SiteHeader.tsx | Added localStorage cleanup on logout to clear scratch pad data |
| client/src/paths/Home.tsx | Added promotional link to Scratch Pad on homepage |
| client/src/index.tsx | Registered Scratch Pad route in the application router |
| client/src/assets/scratchPadDefault.doenet | Welcome content with basic DoenetML examples |
| client/src/assets/multipleChoiceExamples.doenet | Comprehensive multiple-choice answer examples |
| client/src/assets/mathAnswerExamples.doenet | Mathematical answer component examples |
| client/src/assets/graphicalAnswerExamples.doenet | Graphical interaction and answer examples |
| client/package.json | Expanded wireit build file patterns to include TSX, JSX, and CSS files; removed .env.production reference |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This PR adds a scratch pad where one explore DoenetML in an editor even without being logged in.
Edits to the scratch pad are saved to local storage (and erased if one is logged in and then logs out). If one loads new DoenetML into the scratch pad, previous work in the scratch pad is erased. One can load in sample content from the scratch pad, and one can load activities DoenetML into the scratch pad from the activity viewer page.