codesandbox / codesandbox/codesandbox-client
Existing embed URL now uses new DevBox embed after commit changes, and old layout options do not apply
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 13.6k
- Forks
- 2.4k
- Avg merge
- 6d 19h
- Merged PRs (30d)
- 2
Description
🐛 bug report
Preflight Checklist
- I have read the [Contributing Guidelines][contributing] for this project.
- I agree to follow the [Code of Conduct][code_of_conduct] that this project
adheres to. - I have searched the issue tracker for an issue that matches the one I want
to file, without success.
Description of the problem
We use CSB embeds in the Redux docs, and especially in the tutorials. We embed specific Github commits from the tutorial example repos, to show progress at the end of each page. Example:
- Repo URL: https://github.com/reduxjs/redux-essentials-example-app/tree/master
- Repo tag : https://github.com/reduxjs/redux-essentials-example-app/tree/checkpoint-1-postAdded
The example code has been stable for a couple years, and the sandboxes have worked great.
However, I just force-pushed some updates to rewrite the build setup for this example repo, and also force-pushed changes to the tags.
Now, the previous sandbox embeds have been replaced with the new DevBox embeds, and the new DevBox embeds do not seem to apply any of the layout query params in the embed URLs.
It looks like CSB is auto-rewriting the old embed URLs to point to the new embed system automatically.
I can see from the old and new embed docs that the new embeds are a WIP:
- https://codesandbox.io/docs/learn/legacy-sandboxes/embedding
- https://codesandbox.io/docs/learn/devboxes/embedding
So in that sense I can see that yes, the new embeds don't have layout params.
However, this to me is a bug and unexpected behavior.
My assumption is that CSB was caching the existing sandbox setup because the Github commits hadn't changed in years. My guess is that once I force-pushed new commits, CSB auto-updated the embed setup to now use the new embed system.
How has this issue affected you? What are you trying to accomplish?
I specifically want the Redux docs CSB embeds to:
- Have the file editor layout on the left and the preview on the right
- Only run the preview on-click
The old embed setup still does this correctly in our "Fundamentals" tutorial embeds, like this one:
However, the new embed layout is vertically-stacked, has a waste of space in the upper half, doesn't show the source code at all, and can barely show any of the example app on the bottom:
To Reproduce
See docs and sandbox/embed links above
Link to sandbox: link (optional)
Your Environment
N/A
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the legacy and DevBoxes embedding documentation and reproduce the behavior using the Redux tutorial embed URLs in the report. Compare the old layout query parameters with the rewritten DevBox embed, then verify that the editor is on the left, the preview is on the right, and the preview runs only on click.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100