Repository navigation
Add a code playground component - #1170
Conversation
dd061b5 to
890c5e0
Compare
890c5e0 to
069c8fc
Compare
069c8fc to
fd519ec
Compare
270aa63 to
125e25b
Compare
bmesuere
left a comment
There was a problem hiding this comment.
🤖 Reviewed this PR against its stack base. One reproducible issue is described inline. The additional regression check reproduces it with a real Python run. Validation of the complete stack at 530ba26: 334 existing tests passed; TypeScript checking, ESLint, and the app build passed.
125e25b to
6f235da
Compare
6f235da to
0e267e0
Compare
|
🤖 Rebase notes for #1194 (reviewed at 910fb15). The conflicts at this level come from #1168 and #1169; the notes there have the details.
|
|
🤖 Rebase notes for #1195 (reviewed at a5eedf7). The conflicts at this level come from #1169; the note there has the details. This one is about a design overlap, not a conflict.
|
|
🤖 todo (non-blocking): once #1196 is merged, the README has a host contract for Escape: Papyros calls
|
fe686e5 to
89c1195
Compare
|
🤖 Rebased onto main as 89c1195:
|
89c1195 to
2aa73de
Compare
|
🤖 Simplify pass after the rebase (now 2aa73de):
|
2aa73de to
8c08e2e
Compare
|
🤖 note: Dodona reworded its playground message to this on main (a boot failure can also be a device out of memory), and with this PR the playground shows Papyros's own string instead of Dodona's. The sandbox uses the same string, so it changes there too. |
8c08e2e to
7c6741c
Compare
|
🤖 Minor findings. Plain review (no code-review skill) with a checkout of the PR head. Covers the full PR against its base #1168 (step 3 of the stack in dodona-edu/dodona#9402), compared with Dodona's original component at bfa2d95c4. Two inline comments: the status spinner ignores reduced motion (a regression from the original), and a default-instance playground drops its errors. Checked and fine:
Of the original tests, only "keeps transient status out of the toolbar" wasn't ported. The vitest suite wasn't run here: the installed Chromium build doesn't match the one this Playwright expects. Generated by Claude Code |
7c6741c to
4b838eb
Compare
|
🤖 note: Changed since the approval (4b838eb): fixes for three review-routine findings.
|
<p-code-playground> is a small runnable Python editor for inline code blocks, moved from Dodona's <dw-code-playground>: Run and Reset, inline input, and the output and errors rendered with the same helpers as p-output, and an output log that follows its end the way p-output does. Under reduced motion the status line leaves its spinner out, as p-run-state does. Every playground gets its own Papyros instance, on a runtime shared by every playground the host gave none, with Papyros's defaults (no error handler, default asset URLs, English); playgrounds that share a runtime boot Python once, when the first of them scrolls into view, and take turns running. Every run starts from an empty workspace. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
4b838eb to
bcad724
Compare
This pull request adds
<p-code-playground>: a small runnable editor for code blocks in Dodona's reading activities, moved from Dodona's<dw-code-playground>into Papyros. It is step 3 of 5; see #1168 for the overview.Stacked on #1168. Dodona side: dodona-edu/dodona#9304 replaces its component with a thin wrapper around this one.
How to review
Most of
CodePlayground.tsis a port of Dodona's component, reviewed in dodona-edu/dodona#8648 (including a WCAG pass). The useful view is the diff against that original:About 200 of its added lines are the styles, moved from Dodona's
code_playground.css.scssinto the component and switched from--d-*to the--md-sys-color-*tokens Dodona already maps.What changed in the port:
Papyrosinstance on a shared runtime (Let several Papyros instances share one runtime #1168), so Dodona's scheduler is gone: output comes from the instance's ownio, and "another playground is running" is read from the runtime.p-code, bound to the instance'srunner.code; errors and images render through the shared helpers from Share rendering and helpers between the sandbox components #1169; the status line showsrunner.stateMessage.playground/preload.ts).Kept as in Dodona: Run/Stop with
aria-disabled(never nativedisabled, which drops focus), the transcript asrole="log", focus moves, the reserved output height so the page doesn't jump, and scroll-follow only when already at the bottom (throughp-output'sFollowEndcontroller from #1169, so an image that gets its height late no longer stops it).Manual testing instructions
yarn vitest run --exclude '**/.claude/**'input()and tracebacks work.Screenshot (Dodona test page)
Checklist
CodePlayground.test.ts(ported from Dodona, plus the preload); full suite green locally (466)🤖 Generated with Claude Code