Repository navigation
feat(tutorial): protect what a stage sets up, and limit what it offers - #96
Merged
Merged
Conversation
…named The check finds a stage's pins by name, and a player who deleted one could only get it back by resetting the whole stage. The editor now takes nodes to protect: the context menu leaves them out of deleting and of creating a new component, and their pins cannot be renamed on the node or in the properties dialog. A stage protects its Input and Output nodes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A drop placed any component id it carried, so one dragged from another tab could name a component missing from this store, one that includes the edited component, or in a stage a part the stage does not offer, such as an Input that would then be protected. The side panel and the drop now share one check. Also drops comments that restated the code, and covers protecting nothing by default and protecting an Input next to a gate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Its pins can no longer be renamed, which leaves only its name, the stage's title, to change there. Components the player made keep the button. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Right-clicking a selection with a stage's Input or Output nodes now shows Delete with a note naming them: greyed out with "cannot be deleted" when nothing else can go, or "stay" when the rest of the selection is deleted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Menu items do not wrap, so a note naming many nodes would stretch the menu without end. The menu now has a maximum width and the note wraps within it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Grouping nodes into a new component turns them into a box that cannot be undone, which the first stages do not need. A stage now says whether it allows that, and the first two do not. Inside a component the player made, the stage also offers Input and Output nodes, so a stage that allows new components lets them get more pins. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Drops the properties dialog's protected pins, which it can no longer be opened for, and a condition that could not matter. One type now describes which components are offered, the context menu splits the selection in one pass, and the Delete item keeps the height of the others. The notes on kept nodes read better in English and use 、 in Japanese, like the other lists. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Also keeps the divider above Edit when only protected nodes are selected, which the editor's option allows for any node, not only Input and Output. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Deploying create-cpu-c8345196-9409-4cce-afc4-389f413ad8ee with
|
| Latest commit: |
485e3e1
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://c68f4476.create-cpu-c8345196-9409-4cce-afc4-389f413ad8ee.pages.dev |
| Branch Preview URL: | https://feat-protect-stage-pins.create-cpu-c8345196-9409-4cce-afc4-389f413ad8ee.pages.dev |
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
The tutorial's Check finds a stage's pins by name, and with no one at the booth to help, a player who deleted or renamed one could only recover by resetting the whole stage. This PR keeps what a stage sets up in place and narrows what a stage offers. Everything is an option of the editor; the free mode passes none, so it behaves as before.
isProtectedNode): a stage's own Input and Output nodes cannot be deleted or moved into a new component, and their pins cannot be renamed (the rename button on the node is hidden).hasProperties): the properties button is hidden on a stage's own component, as its pins are protected and its name is the stage's title. Components the player made keep it.canCreateComponents): each stage says whether "Create a new component..." is offered. The two current stages do not offer it, since grouping nodes into a box cannot be undone and they do not need it.isOffered+canPlaceComponent): the side panel and drops on the canvas now share one check. Before, a drop placed whatever id it carried, so a component dragged from another tab could be missing from this store, could include the edited component, or could be a part the stage does not offer. In a stage, the stage's parts and the player's own components are offered. Inside a component the player made, Input and Output are offered too, so a stage that allows new components lets the player give them pins.Not in this PR
Testing
npx vitest run(173 tests),npx tsc -p .andnpx biome check srcpass. New tests cover:🤖 Generated with Claude Code