Skip to content

[playground] fix: don't show compilation spinner when toggling dark mode#10392

Open
JennyPng wants to merge 2 commits intomicrosoft:mainfrom
JennyPng:modefix
Open

[playground] fix: don't show compilation spinner when toggling dark mode#10392
JennyPng wants to merge 2 commits intomicrosoft:mainfrom
JennyPng:modefix

Conversation

@JennyPng
Copy link
Copy Markdown
Member

@JennyPng JennyPng commented Apr 15, 2026

I noticed the playground compilation spinner appears when the dark mode toggle is clicked, which doesn't seem desirable

  • When the dark mode toggle fires, WebsitePlayground re-renders and recreates imports (from .filter()) and importConfig ({ useShim: true }) as new object references

  • These are dependencies of the useEffect in useStandalonePlaygroundContext in standalone.tsx, which re-runs the entire host creation and triggers the compile effect. So memoizing these to avoid that

  • change to base-layout is because I noticed if I have dark mode, when switching pages, it briefly flashes to light mode before switching back to dark mode

@microsoft-github-policy-service microsoft-github-policy-service bot added the meta:website TypeSpec.io updates label Apr 15, 2026
@azure-sdk
Copy link
Copy Markdown
Collaborator

azure-sdk commented Apr 15, 2026

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

@JennyPng JennyPng marked this pull request as ready for review April 15, 2026 19:48
@github-actions
Copy link
Copy Markdown
Contributor

No changes needing a change description found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

meta:website TypeSpec.io updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants