Skip to content

chore(dev): gate react-scan overlay behind env flag#351

Open
1pitaph wants to merge 2 commits into
pascalorg:mainfrom
1pitaph:main
Open

chore(dev): gate react-scan overlay behind env flag#351
1pitaph wants to merge 2 commits into
pascalorg:mainfrom
1pitaph:main

Conversation

@1pitaph
Copy link
Copy Markdown

@1pitaph 1pitaph commented May 30, 2026

What does this PR do?

Removes the automatic react-scan CDN injection in development and makes the React render debugging overlay opt-in.

react-scan now only runs when NEXT_PUBLIC_REACT_SCAN=true is set in development. The opt-in flag is documented in .env.example, so local developers can enable it when debugging render performance without showing the overlay by default.

Also fixes sidebar collapse rendering instability in the editor:

  • Removes the sidebar collapse width transition.
  • Reads the latest sidebar store state when toggling, so rapid repeated clicks do not use stale collapsed state.
  • Forces the viewer canvas size to sync immediately after layout changes.
  • Ensures post-processing fallback renders use the active scene theme background instead of flashing black or white.

How to test

  1. Run bun dev without setting NEXT_PUBLIC_REACT_SCAN, open the editor, and verify the purple react-scan component overlay does not appear.
  2. Add NEXT_PUBLIC_REACT_SCAN=true to .env.local, restart bun dev, refresh the page, and verify the overlay appears.
  3. Remove the flag or set it to false, restart bun dev, and verify the overlay is disabled again.
  4. Open the editor and repeatedly click the sidebar collapse / expand button.
  5. Verify the viewer does not flash a white or black blank area during the resize.
  6. Verify the main 3D view does not enter the black / white corrupted rendering state after repeated toggles.

Screenshots / screen recording

N/A. This change removes a development-only debug overlay by default and fixes a transient interaction/rendering issue.

Checklist

  • I've tested this locally with bun dev
  • My code follows the existing code style (run bun check to verify)
  • I've updated relevant documentation (if applicable)
  • This PR targets the main branch

1pitaph added 2 commits May 30, 2026 21:03
Remove the automatic react-scan CDN injection in development and only
enable the local react-scan package when NEXT_PUBLIC_REACT_SCAN=true.
Document the opt-in flag in .env.example.
- remove sidebar collapse width transition per updated UX
- read latest sidebar store state when toggling to handle rapid clicks
- resize viewer canvas immediately after layout changes
- set themed clear color for post-processing fallback renders
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.

1 participant