[wip] Add toggle for showing preview unshuffled in radio editor#3245
Draft
[wip] Add toggle for showing preview unshuffled in radio editor#3245
Conversation
…-progressive-disclosure
…io editor, first try The Edit tab sidebar preview now defaults to showing choices unshuffled, even when Randomize is enabled. A new "Shuffle preview" toggle lets content creators opt into seeing the shuffled order in the sidebar. The Preview tab continues to always respect the Randomize setting.
…ces toggle for radio widgets in the content editor
…d update CLAUDE.md" This reverts commit e6df507.
Contributor
🗄️ Schema Change: No Changes ✅ |
Contributor
🛠️ Item Splitting: No Changes ✅ |
Contributor
|
Size Change: +441 B (+0.09%) Total Size: 485 kB
ℹ️ View Unchanged
|
Contributor
npm Snapshot: PublishedGood news!! We've packaged up the latest commit from this PR (3c7e5bd) and published it to npm. You Example: pnpm add @khanacademy/perseus@PR3245If you are working in Khan Academy's frontend, you can run the below command. ./dev/tools/bump_perseus_version.ts -t PR3245If you are working in Khan Academy's webapp, you can run the below command. ./dev/tools/bump_perseus_version.js -t PR3245 |
…isclosure branch This branch was based off a branch with some additional documentation for Claude and some changes to its CLAUDE.md. Those files are not yet landed, so removed those. Missed this changeset.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Problem
Content creators found the Edit tab sidebar preview unhelpful when choices were shuffled — it was hard to map shuffled preview choices back to the editor fields they were authoring.
Solution
Added a "Shuffle preview" toggle to the Radio widget editor that controls whether the Edit tab sidebar preview shows choices in shuffled or unshuffled order. The toggle defaults to off (unshuffled), giving creators a predictable editing experience. The Preview tab always respects the
randomizesetting and is unaffected by this toggle.Architecture
The toggle state is editor-only and ephemeral — it is not persisted to content data. It flows through the existing
onChange/serializepipeline as a marker field (_showShuffledPreview), which is:serializeForPreview()to control whether the sidebar preview shuffles choicesserialize()(the save path) andgetSnapshotBeforeUpdate(the JSON mode path) via a shared helper to ensure it never reaches stored contentNo changes were made to the core shuffle logic or the widget rendering layer — all changes are confined to the editor.
Co-authored by Claude Opus 4.6
Issue: LEMS-3710
Test plan: