This repository was archived by the owner on Aug 6, 2026. It is now read-only.
Conversation
A new "html" canvas template lets the agent generate standalone HTML documents (reports, specs, one-pagers) alongside freeform React canvases, published through the same desktop-file-system canvas flow. Documents render in a null-origin sandboxed iframe with a locked-down CSP and an injected annotation shim; teammates can comment by selecting text, picking an element, or on the whole page, with numbered pins and a side-panel thread view backed by PostHog's comments API. Generated-By: PostHog Code Task-Id: b6ef557f-b02a-45d6-9128-577e1fbad8b1
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
|
React Doctor found no issues in the changed files. 🎉 Reviewed by React Doctor for commit |
| const doc = buildHtmlArtifactDocument(html); | ||
| const stripped = doc | ||
| .replace(/<meta http-equiv="Content-Security-Policy"[^>]*>/, "") | ||
| .replace(/<script>[\s\S]*<\/script>/, ""); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Problem
Agents can already build freeform React canvases in Channels, but there's no way to generate a plain document artifact — a report, spec, or one-pager — and no way for teammates to leave feedback anchored to specific parts of a canvas. Inspired by puemos/peek.
Changes
html): the agent authors a complete standalone HTML page (self-contained inline CSS/JS, PostHog numbers baked in at generation time via MCP) and publishes it through the existingdesktop-file-system-canvas-partial-updateflow. Versions, undo/redo, fork, share links, the Artifacts tab, and the dashboards grid all work unchanged.sandbox="allow-scripts"iframe (HtmlArtifactFrame, no warm pool) with an injected CSP that blocks all network egress.scope: "code_canvas", anchor JSON initem_context, replies viasource_comment, soft delete) — first wiring of that generated-client surface — so every project member sees them via polling. Side panel gains a Comments tab with threads, replies, and delete-own.How did you test this?
pnpm --filter @posthog/core test -- --run(2504 tests) andvitest run src/features/canvasinpackages/ui(170 tests), including new suites for the protocol schemas, comment threading/orphan parsing, shim algorithms (text-quote capture/resolution, CSS-path round-trips in jsdom), CSP/shim document splicing, and the HTML generation-prompt branch.pnpm --filter @posthog/{core,api-client,ui,code,web} typecheckandbiome lintall clean.Automatic notifications
Created with PostHog Code