Add embed route for puzzles with zen mode enforced #11968
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In response to #11337 , @JBaker05 and I created a route, controller, and view for embedding puzzles. Much of the controller and view was recycled from the controller and view for the existing puzzles page. After this, we developed a way to enforce zen mode for this route so that many of the extraneous elements that one would not want to see on the embedded version of this page will not be visible. The following is a screen recording of how the iframe behaves locally:
https://user-images.githubusercontent.com/59403072/204429083-0452b0be-91e1-4dc1-a871-ded2dd5b9919.mov
We are looking for some feedback on the work we have done so far, particularly with regards to the route, controller, and view for the embed endpoint. Moreover, we understand that while this works locally, we will need to set the x-frame-options of this route to SAMEORIGIN in order for this to work in production. Additionally, while zen mode masks many of the extraneous elements, it might not be the preferred method for handling this, so we would appreciate guidance in the form of a general plan and/or code pointers on how to handle this more robustly by modifying CSS and/or TS files. For instance, such a method could remove the black bars at the top and bottom of the view as seen in the above recording.