Skip to content

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

Open
skyash-dev wants to merge 3 commits into
processing:developfrom
skyash-dev:feature/loop-protection-toggle
Open

add UI to toggle loop protection via <!-- noprotect -->#4108
skyash-dev wants to merge 3 commits into
processing:developfrom
skyash-dev:feature/loop-protection-toggle

Conversation

@skyash-dev
Copy link
Copy Markdown

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

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
Copy link
Copy Markdown

welcome Bot commented May 6, 2026

🎉 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
Copy link
Copy Markdown
Author

skyash-dev commented May 14, 2026

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
Copy link
Copy Markdown
Author

hi @davepagurek!
you should check out the latest changes. i moved the loop protection directive to index.html

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

3 participants