Skip to content

fix: auto-collapse playground menu on mobile (#2430)#2431

Merged
reynaldichernando merged 2 commits intoHeyPuter:mainfrom
sanjeevafk:main
Feb 6, 2026
Merged

fix: auto-collapse playground menu on mobile (#2430)#2431
reynaldichernando merged 2 commits intoHeyPuter:mainfrom
sanjeevafk:main

Conversation

@sanjeevafk
Copy link
Copy Markdown
Contributor

This PR improves the user experience of the Puter.js Playground on mobile devices. Previously, when a user selected an example from the sidebar menu in mobile view, the menu would remain open and cover the editor, requiring the user to manually click the toggle button to close it.

The sidebar now automatically collapses once a link is clicked, allowing the user to see the selected example immediately.

Changes

  • UX Improvement: Added a check in app.js to automatically collapse the sidebar when a .sidebar-item is clicked if the window width is 768px or less.

  • Code Polish:

    • Added /* global */ comments to avoid linting errors for external libraries like Monaco and Clarity.

    • Simplified popstate handling by using window.location.reload() instead of re-assigning window.location.href.

    • Removed an unused variable (code) in app.js.

demo vid of the changes made

demo.mp4

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Feb 6, 2026

CLA assistant check
All committers have signed the CLA.

Comment thread src/docs/src/playground/assets/js/app.js Outdated
@reynaldichernando
Copy link
Copy Markdown
Member

hi @voidcommit-afk , i left a small comment, but otherwise this PR is good!
could you help take a look at the comment, and afterwards we can merge this

@sanjeevafk
Copy link
Copy Markdown
Contributor Author

hi @reynaldichernando
done, removed the said line! thanks for catching it

@reynaldichernando reynaldichernando merged commit 06fe07e into HeyPuter:main Feb 6, 2026
1 check 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.

3 participants