Skip to content

Fix playground settings leaking between components - #51

Merged
DavidHDev merged 1 commit into
DavidHDev:mainfrom
arjayby:fix/playground-settings-switching-components
Nov 8, 2026
Merged

DavidHDev merged 1 commit into
DavidHDev:mainfrom
arjayby:fix/playground-settings-switching-components

Conversation

@arjayby

@arjayby arjayby commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Switching playground components previously retained the outgoing component's URL settings. For example, setting Liquid's radius to 1.5 and switching to Particle Reveal carried over that value, below Particle Reveal's minimum radius of 60.

This change resets the outgoing controls in the same nuqs batch as component selection, including queued edits. Selecting the current component preserves its settings, and unrelated URL parameters remain unchanged.

Numeric control values from URLs now clamp to their configured range. Blank, malformed, and nonfinite values fall back to the control's default.

Reproduction

  1. Open the playground and select Liquid.
  2. Set Radius to 1.5.
  3. Switch to Particle Reveal.
  4. Before: the radius carries over. After: Particle Reveal starts at its default radius of 500.

Recordings

Before

before-compressed.mp4

After

after-compressed.mp4

Type of change

  • Bug fix
  • New component
  • Component improvement
  • Docs / site
  • Other

Checklist

  • npx tsc --noEmit passes
  • npm run lint passes
  • npm run build passes
  • Tested in Chrome (with the html-in-canvas flag, if relevant)
  • Tested the WebGL overlay fallback (flag off / Safari / Firefox), if a component changed

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.

2 participants