Skip to content

Conversation

@dqnykamp
Copy link
Member

@dqnykamp dqnykamp commented Dec 20, 2025

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.

Copy link

Copilot AI left a 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 /scratchPad route 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.

@dqnykamp dqnykamp marked this pull request as ready for review December 24, 2025 01:44
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.

1 participant