Add scrollable and loadable from file EditableSketches - #1469
Conversation
| value={codeString} | ||
| theme="light" | ||
| width="100%" | ||
| height="300px" |
There was a problem hiding this comment.
Do we want to make this optional/opt-in for long sketches?
There was a problem hiding this comment.
Ah yes thanks for the reminder! That's the intent. (For other testers/reviewers looking later: when I add missing tutorials they shouldn't have anything changed except some scrollable sketches where intended.)
There was a problem hiding this comment.
currently the height prop of EditableSketch component only resizes preview, we might need another prop to resize code height too...
aashu2006
left a comment
There was a problem hiding this comment.
hi @ksen0 , I tested locally with a long WEBGL sketch. The scrollable editor works well: code caps at 300px and scrolls, the page layout stays fine, edit and run works, and leaving out scrollable also changes nothing
also I feel there are two things to fix:
1. Fold gutter shows on every editor now (CodeEmbed/index.jsx:160). foldGutter: true is not gated on scrollable, so all tutorial and reference pages get the ▾ arrows
- foldGutter: true,
+ foldGutter: isScrollable,2. cssCode / bodyCode never reach the sketch (CodeEmbed/index.jsx:109-121). EditableSketch passes them to CodeEmbed, but CodeEmbed doesn't forward them to CodeFrame, so the CSS+HTML example loses both
<CodeFrame
jsCode={previewCodeString}
+ cssCode={props.cssCode}
+ htmlBodyCode={props.htmlBodyCode}I tried both fixes locally, and untouched pages match main again after the gutter fix
|
Thank you for catching that @aashu2006 , added. |
Currently the 2.0 switch is blocked by some .todo tutorials. These are blocked by incomplete migration, sometimes due to the presence of external links to sketches that cannot be updated to match 2.0. Currently they can't be copied directly into the body of the tutorial because they are very long. This PR introduces scrollable editable sketch support.
Addresses #1426 processing/p5.js#8870
WIP Docs
.../tutorials/sketches/TUTORIAL_NAME/SKETCH_NAMEexportat top of tutorial.mdxfile to load the data