Edit multiple steps - #1582
Draft
zetter-rpf wants to merge 5 commits into
Draft
Conversation
Sidebar decided whether to show the instructions menu option by reading state.instructions.project.steps directly, rather than through selectInstructionSteps. That state is only populated when steps are loaded pre-authored (e.g. by WebComponentLoader); for a single-page project whose instructions are a markdown string in editor.project.instructions, it stays empty, so Sidebar concluded there were no instructions and hid the panel entirely. This change points Sidebar at selectInstructionSteps, the same derived source InstructionsPanel and ProgressBar already use, so all three agree on whether instructions exist. Also hardened the selector itself with optional chaining on state.instructions, since several existing tests render Sidebar/Project/MobileProject without an instructions slice in their mock store at all. Added a regression test reproducing the exact scenario (markdown string instructions, default permitOverride) and confirmed it fails without the Sidebar fix and passes with it.
Authors could only edit instructions as one big markdown string, with no way to create or delete steps. The edit tab now targets the currently-open step's markdown_content, and Add step/Remove step buttons (below the pager, always visible while editing so authors can grow past a single step) insert or remove steps relative to the current position. Removing the last step falls back to the existing empty state rather than needing special-case handling. This moves the saved shape of project.instructions from a single string to an array of step objects once any editing happens; the read side already supported this via selectInstructionSteps.
INSTRUCTIONS.md zipped project.instructions verbatim, assuming a single markdown string. Now that editing produces an array of step objects, join each step's markdown_content so downloaded projects still get a readable INSTRUCTIONS.md.
Adds spec-wc-instructions.cy.js: loads a project with existing multi-step markdown instructions (owned by the logged-in user so autosave is active), adds a step and edits it, then asserts the autosaved PUT body contains the full instructions array with the new step positioned after the one that was open — the actual contract the project saver now needs to uphold. Verified locally by running Cypress inside the docker-compose app container (installed Xvfb + GTK there for headless Electron), since the host's cached Cypress binary wasn't runnable in this environment.
zetter-rpf
temporarily deployed
to
previews/1582/merge
August 7, 2026 15:25 — with
GitHub Actions
Inactive
Neither field is read anywhere for markdown steps (quiz is only meaningful as the separate quiz-questions object in state.instructions.quiz, and title is never read at all). New steps now only carry markdown_content.
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.
No description provided.