Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EFUzfiCVCgCVJZq4NDEqZs
2.8 KiB
2.8 KiB
Proposal
Why
Marketing staff want to design a landing page with an AI tool and paste the result in, so a page can look like a designed site instead of only the built-in blocks. The INS page is the first case: rebuilt from blocks, it does not match the design of the INS proof of concept (~/Projects/ins-landing-page). On 2026-12-02 the owner chose to show pasted HTML in a sealed frame (option 1). Design approved 2026-12-02: docs/superpowers/specs/2026-12-02-custom-html-block-design.md.
What Changes
- New block type
HTML(Custom HTML).- Staff with
BO_PAGESpaste HTML, at most 200,000 characters per block. - Scripts are allowed in this block only. Every other block keeps refusing scripts.
- Staff with
- Sealed frame.
- The public page shows each HTML block in an
<iframe sandbox>loaded from its own address:/p/<company>/<slug>/frame/<block>. - That response carries a
sandboxContent-Security-Policy, so the pasted HTML runs with an opaque origin even when the address is opened directly. It cannot reach cookies, Co-Lite APIs, the page around it or top-level navigation, and its forms do not submit. - Only Co-Lite pages may frame it (
frame-ancestors 'self'). - Staff preview a draft through a signed-in twin:
/pages/<id>/preview/frame/<block>.
- The public page shows each HTML block in an
- Frame height: a small script is added to the served HTML. It reports the document height, so the frame grows to fit.
- Hide page header: a page option that hides the company header and the page title, so a page made of pasted HTML looks exactly as designed.
- Editor:
- "Add Custom HTML" with a monospace text box and a character counter;
- a note that forms in the pasted HTML don't send;
- the "Hide page header" switch.
Capabilities
New Capabilities
None.
Modified Capabilities
landing-pages:- the block types gain
HTML, with its limit; - the scripts rule exempts it;
- a new requirement covers how it is served sealed and sized;
- the page gains the "hide header" option;
- the editor gains the Custom HTML block and the switch.
- the block types gain
Impact
- services-counter:
CmsBlockValidatoracceptsHTML(200,000 characters, no script check);cms_pagegets ahide_headercolumn and the page DTO carries it.
- SQL:
sql/01-hide-header.sql(DDL),sql/02-html-block-labels.sql(labels) andsql/99-rollback.sql. Mirror 01 intolocal/seed/. - mobile-api: the admin page request and the public page response carry
hideHeader. Blocks already pass through unchanged. - Portal:
- two frame route handlers;
middleware.tsleaves the frame routes without the nonce policy;routeGuardadmits the public frame path;CmsBlocksrenders the frame and honourshideHeader;- the editor;
- labels, with Chinese.
- Gateway: unchanged.
- Dependencies: none.