Repository navigation
Conversation
…e preview, built from one lesson.md The skill ships a page template in assets/ and a build that checks the lesson and fills the template; the agent publishes the page as an html drop. A script of a data type, such as the lesson's Markdown, no longer counts toward the publish link check.
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
In progress Pull request repair is claimed. Final answersSession Waiting for review checks before the next pass. Session Waiting for review checks before the next pass. Session Waiting for review checks before the next pass. Session Waiting for review checks before the next pass. |
There was a problem hiding this comment.
Important
Please address the preview and lesson navigation defects before merging. Valid lesson source can render a blank page, ordinary module code can produce the wrong result, and the screenshot build can pass before a preview fails.
Approach: Reusing an existing HTML drop is the right publishing model; the lesson runner needs to preserve the behavior of the code it teaches or explicitly reject what it cannot run.
Reviewed changes across the authoring, browser, and publishing paths:
- Authoring and build: Markdown steps, inherited files, line links, single-page generation, and screenshot validation.
- Reader experience: Guide navigation, CodeMirror and textarea editing, sandboxed previews, console output, and browser storage.
- Drop integration: Skill discovery, HTML publishing, link validation, and comment focus in the viewer frame.
All 27 targeted tests and pnpm run doctor passed. I reproduced the runtime findings in Chromium using generated lessons and the existing viewer-frame runtime.
gpt-6.2-sol(high) | 𝕏
| // The same page an agent without Node fills by hand: each part goes in its slot. | ||
| const esc = (s) => | ||
| String(s).replace(/[&<>"]/g, (c) => ({ "&": "&", "<": "<", ">": ">", '"': """ })[c]); | ||
| const script = (text) => text.replace(/<\/script/gi, "<\\/script"); |
There was a problem hiding this comment.
P1 — Class: lesson source does not round-trip through the HTML template. A lesson that teaches HTML escaping can contain "<!--" followed by "<script>" in a fenced JS file. The build succeeds, but Chromium consumes the lesson’s closing tag and the ca-lesson slot, leaving a blank page; a source regex containing a literal <\/script> also loses its backslash on decode.
Technical details
# Preserve lesson source at the template boundary
## Affected sites
- `skills/code-along/scripts/build.mjs:45–52` — escaping only closing script sequences does not prevent the HTML tokenizer from entering a double-escaped script state.
- `skills/code-along/assets/app.js:835` — decoding cannot distinguish an original backslash from one the builder added.
- `skills/code-along/SKILL.md:78` — the manual fill instructions use the same non-reversible convention.
## Required outcome
- The browser must recover the literal source without relying on HTML script parsing of arbitrary Markdown text. Use a reversible representation that cannot emit a literal `<` in the slot, and cover the built and manual paths in browser tests.| let out = `${indent}const ${m} = await __import(${JSON.stringify(spec)});`; | ||
| if (def) out += `const ${def} = ${m}.default;`; | ||
| if (rest && rest.startsWith("{")) | ||
| out += `const { ${bindings(rest.slice(1, -1)) |
There was a problem hiding this comment.
P1 — Class: the preview changes standard ES module behavior. If a.js exports let count = 0 and increment(), a module that imports both and calls increment() still reads 0 in this preview instead of 1. I also verified that a module’s DOMContentLoaded handler never fires here, and the transformer rewrites import-looking text inside template literals.
Technical details
# Preserve module behavior, or reject unsupported modules explicitly
## Affected sites
- `skills/code-along/assets/app.js:104–171` — regex replacements are not syntax-aware; named/default imports are snapshots, and same-line declarations such as `const a = 1; export { a };` are not transformed.
- `skills/code-along/assets/app.js:215–250` — a cached dependency returns its exports immediately, even if evaluation is pending or rejected.
- `skills/code-along/assets/app.js:252–266` — evaluation starts inside `DOMContentLoaded`, too late for normal deferred module setup.
## Required outcome
- Code copied from a supported browser module should behave the same in the lesson, or unsupported constructs should fail explicitly rather than teach an incorrect result. Prefer native module behavior where the serving model permits it; if the single-file/CSP tradeoff requires a subset, document and enforce that subset. Test live bindings and DOM initialization in a browser.|
|
||
| function previewDocument(files) { | ||
| const page = "index.html"; | ||
| const scripts = Object.fromEntries(Object.entries(files).filter(([path]) => !path.endsWith(".html"))); |
There was a problem hiding this comment.
P1 — Class: virtual fetch omits HTML lesson files. With partial.html in the step’s file tree, fetch("./partial.html") falls through to the network rather than returning its contents, contrary to the documented file-fetch support. Keep HTML files in the map used by virtual fetch, even if the module loader treats them separately.
| timeout: 15000, | ||
| }) | ||
| .catch(() => problems.push(`${view.name}: step "${step.title}": the preview didn't load in 15 s`)); | ||
| await page.waitForTimeout(400); |
There was a problem hiding this comment.
P1 — Class: screenshot validation ends before preview entry evaluation. --shots returned success for a preview whose entry awaited 2.5 seconds and then threw. The iframe is marked ready before that entry finishes, so the screenshots and the check for errors can both miss the failed preview.
Technical details
# Validate the current preview run before taking screenshots
## Affected sites
- `skills/code-along/assets/app.js:254–258,598–608` — the queue awaits each entry, but the lesson uses iframe `load` as its ready signal and does not distinguish messages from successive runs.
- `skills/code-along/scripts/build.mjs:121–130` — validation checks the first 400ms after iframe load, and only reads preview errors for the light run.
## Required outcome
- Wait for completion or failure of the current run’s initial module evaluation, with a timeout, before capturing that step; check each captured variant. A slow rejection must fail the build, not be masked by a fixed delay.| link.rel = "noopener noreferrer"; | ||
| } | ||
| } | ||
| for (const table of body.querySelectorAll("table")) table.replaceWith(h("div", { class: "ca-table" }, table.cloneNode(true))); |
There was a problem hiding this comment.
P1 — Class: table rendering removes file-link handlers. A valid [b.js](b.js#L1) link in a guide table navigates away from the lesson instead of selecting the file: cloneNode(true) keeps the href and file-chip markup but drops the listener registered above. Wrap the existing table node rather than cloning it.
| shell.toggleAttribute("data-no-preview", !hasPreview); | ||
| renderTree(); | ||
| // Keep the open file when the step changes nothing; otherwise open the file the step is about. | ||
| openFile(s.files[state.file] && !s.changed.length ? state.file : s.active); |
There was a problem hiding this comment.
P1 — Class: read-only steps ignore the guide’s default file. If step 1 opens a.js and step 2 links first to inherited b.js without rewriting any files, Next keeps a.js open, even though the parser sets s.active to b.js. Honor an explicit guide file on step entry; only keep the previous file when the new step specifies none.
| // ---------- start | ||
|
|
||
| setTab("preview"); | ||
| const fromHash = steps.findIndex((s) => `#${s.id}` === location.hash); |
There was a problem hiding this comment.
P1 — Class: step lookup compares encoded URL fragments with decoded IDs. A step titled 次の手順 works when reached with Next, but reloading its generated URL takes the reader back to step 1 and overwrites the fragment. Normalize the fragment consistently on both startup and hashchange (line 649), and test a non-ASCII heading.
| if (index < 0 || index >= steps.length) return; | ||
| state.step = index; | ||
| const s = step(); | ||
| articles.forEach((article, i) => (article.hidden = i !== index)); |
There was a problem hiding this comment.
P1 — Class: opening a comment does not reveal its lesson step. A text comment on “Pick the form” opens its thread from a shared comment link, but the lesson stays on step 1 and the quoted text isn’t visible. I verified that the existing viewer focus message does not reveal the hidden article.
Technical details
# Reveal the owning step when following a comment
## Affected sites
- `skills/code-along/assets/app.js:345–354,441–478` — step articles are hidden outside the selected step and only lesson navigation reveals them.
- `app/components/DropViewer.vue:1038–1088` — HTML comment links send a `focus` message without restoring step state.
- `shared/plan-runtime.ts:928–942,2097–2102` — hidden text ranges have no rectangles; focus scrolls to an existing pin without revealing the anchor first.
## Required outcome
- With a comment on step 2, opening the thread from the sidebar or a fresh comment link must reveal the actual anchor on step 2. Add a test using Drop’s HTML viewer frame rather than only testing standalone step navigation.| } catch {} | ||
| const saveEdits = () => { | ||
| try { | ||
| localStorage.setItem(storeKey, JSON.stringify(edits)); |
There was a problem hiding this comment.
P1 — Class: opaque Drop frames silently discard edits on reload. On a default self-hosted Drop without DROP_CONTENT_ORIGIN, localStorage.setItem() appears to work because Drop installs an in-memory shim, but a refresh discards the changes. The direct HTML landing frame also uses the shim, so the promise that edits stay until Reset does not hold on those paths.
Technical details
# Reflect the actual storage capability
## Affected sites
- `skills/code-along/assets/app.js:317–325` — the page treats temporary and persistent storage alike and suppresses write failures.
- `skills/code-along/SKILL.md:9` — describes protection until Reset without noting the opaque frame limitation.
- `shared/plan-runtime.ts:2210–2225` and `shared/html-landing.ts:5` — default/landing frame storage is recreated on reload by design.
## Required outcome
- Persist edits where the supported host provides durable storage, and surface a clear temporary-edits notice where it does not. Document the limitation rather than weakening the sandbox.| const html = text.replace(/<!--[\s\S]*?-->/g, "") | ||
| const html = text | ||
| .replace(/<!--[\s\S]*?-->/g, "") | ||
| .replace(/<script\b[^>]*\btype=["']?([^"'\s>]+)[^>]*>[\s\S]*?<\/script>/gi, (tag, type: string) => |
There was a problem hiding this comment.
P1 — Class: the data-script filter drops executable tags and misses actual data tags. An ordinary <script data-type="text/markdown" src="missing.js"></script> or <script type="text/jscript" src="missing.js"></script> no longer warns about the missing script, while a real type = "text/markdown" block still produces false warnings. Match the actual type attribute with HTML’s spacing rules and preserve the executable script types the browser recognizes.

Adds the
code-alongskill. An agent writes onelesson.md, and the skill's template turns it into one HTML page: the guide in steps on one side, and a file tree, an editor and a preview that reruns as you type on the other. The agent publishes it as anhtmldrop, so it gets versions and comments like any drop. There's no new Drop type.It covers three asks:
<details>What's in it
skills/code-along/assets/: the template, in four files with slots.page.htmlholds them.style.cssuses neutral shadcn tokens with Geist, in light and dark.lesson.jsparses the lesson.app.jsruns the steps, the tree, the editor, the preview, the console and Reset.index.htmlin anallow-scriptsframe. It supports relative imports between the lesson's files and bare imports from esm.sh.localStorageuntil they press Reset.scripts/build.mjschecks the lesson with the page's own parser. It stops on a link to a missing file, an unclosed fence or a step with no files, then fills the template. With--shots, it screenshots every step in light and dark, and the first step on a phone.shared/project-bundle.ts: the publish link check now skips<script>blocks of a data type. The lesson's Markdown sits in atext/markdownscript, and its paths showed up as false "isn't in the app" warnings.content/docs/agents.md, a pointer invitehub-drop, the skill catalog test, and a doctor and knip entry for the example lesson and the CDN imports.Checked
test/skills/code-along.test.mjs: the build fills the slots and escapes</script. Step files carry over and the right file opens. Every lesson error stops the build. Line links work.Three test lessons built and run in headless Chromium, under Drop's HTML CSP and content sandbox:
In all three, the editor loads, the previews run, edits survive a reload, Reset restores the step, and there are no page errors.
Not checked: comments on a hidden step inside the real Drop viewer.
🤖 Generated with Claude Code