Skip to content

add UI to toggle loop protection via <!-- noprotect -->#4108

Merged
raclim merged 5 commits into
processing:developfrom
skyash-dev:feature/loop-protection-toggle
Jun 9, 2026
Merged

add UI to toggle loop protection via <!-- noprotect -->#4108
raclim merged 5 commits into
processing:developfrom
skyash-dev:feature/loop-protection-toggle

Conversation

@skyash-dev

@skyash-dev skyash-dev commented May 6, 2026

Copy link
Copy Markdown
Contributor

Issue:

Fixes #4081

Adds a UI control for enabling/disabling loop protection from Preferences.
This implementation treats <!-- noprotect --> in index.html as the source of truth:

  • turning loop protection off inserts <!-- noprotect --> in index.html
  • which turns off loop protection globally (i.e. does not insert loop protection code in all the sketches).
  • turning it on removes the comment
  • the toggle state is derived from the index.html

Demo:

image

Changes:

  • added loop protection toggle UI in Preferences
  • derive loop protection state from index.html
  • update index.html noprotect comment when toggled
  • keep toggle and <!-- noprotect --> comment in sync
  • added unit test

I have verified that this pull request:

  • has no linting errors (npm run lint)
  • has no test errors (npm run test)
  • has no typecheck errors (npm run typecheck)
  • is from a uniquely-named feature branch and is up to date with the develop branch.
  • is descriptively named and links to an issue number, i.e. Fixes #123
  • meets the standards outlined in the accessibility guidelines

@welcome

welcome Bot commented May 6, 2026

Copy link
Copy Markdown

🎉 Thanks for opening this pull request! Please check out our contributing guidelines if you haven't already.

Comment thread client/modules/IDE/components/Preferences/index.jsx Outdated
Comment thread client/modules/IDE/utils/loopProtection.js Outdated
Comment thread client/styles/components/_overlay.scss
@skyash-dev

skyash-dev commented May 14, 2026

Copy link
Copy Markdown
Contributor Author

toggle padding/margins feel off, making the outlines appear uncentered. can i create a commit in this pr itself?

actual:
image

improved:
image

@davepagurek

Copy link
Copy Markdown
Contributor

I think we're good to go ahead with the comment living in index.html -- possibly a bit unexpected for users of other tools, but then it's in one spot, and people mostly will use the UI anyway.

For padding/margins, maybe make a separate issue/PR? It's always a little weird doing design updates since often these are fairly subjective and could use a bit of feedback, so we don't need to block this PR on those updates.

@skyash-dev skyash-dev force-pushed the feature/loop-protection-toggle branch from 66329bf to 32acd1e Compare May 22, 2026 08:55
@skyash-dev skyash-dev changed the title add UI to toggle loop protection via // noprotect add UI to toggle loop protection via <!-- noprotect --> May 25, 2026
@skyash-dev skyash-dev marked this pull request as draft June 5, 2026 06:02
@skyash-dev skyash-dev closed this Jun 5, 2026
@skyash-dev skyash-dev deleted the feature/loop-protection-toggle branch June 5, 2026 16:24
@skyash-dev skyash-dev restored the feature/loop-protection-toggle branch June 5, 2026 16:31
@skyash-dev skyash-dev reopened this Jun 5, 2026
@skyash-dev skyash-dev marked this pull request as ready for review June 5, 2026 17:07

@raclim raclim left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This overall seems okay to me, will merge this in!

Thanks so much @skyash-dev and @davepagurek for your efforts on this!

@raclim raclim merged commit 10b2cec into processing:develop Jun 9, 2026
2 checks passed
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.

Add UI to toggle on/off loop protection comment

4 participants