Files
co-lite/openspec/changes/add-custom-html-block/tasks.md
T
ngqileandClaude Opus 5.5 9a7b225827 feat(pages): HTML block type and hide-header option in the services
The counter accepts an HTML block (required, at most 200,000 characters, no
script check because it only runs sealed) and stores a hide-header flag on the
page. mobile-api passes the flag through on save and in the public page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfiCVCgCVJZq4NDEqZs
2026-12-02 17:46:32 +08:00

2.2 KiB

Tasks: add-custom-html-block

Design: design.md and docs/superpowers/specs/2026-12-02-custom-html-block-design.md. Every task is TDD. Work is serial in the main session, with a self-review per task.

1. Data and services

  • 1.1 SQL: sql/01-hide-header.sql (cms_page.hide_header), sql/99-rollback.sql; mirror 01 into local/seed/.
  • 1.2 services-counter:
    • the HTML block type: required, at most 200,000 characters, no script check;
    • hideHeader on the page model and DTO.
    • Verify: mvn -T 1C -B -pl solvway-services-counter -am verify
  • 1.3 mobile-api: hideHeader on AdminPageRequest and in the public page response.
    • Verify: mvn -T 1C -B -pl solvway-mobile-api -am verify

2. Portal

  • 2.1 Frame routes (public and preview) with the sandbox headers, the 404 rules and the height script.
    • The middleware skips them; routeGuard admits the public frame path.
    • Security code: read the whole diff.
  • 2.2 CmsBlocks:
    • the sandboxed iframe with height messages from its own frame only;
    • hideHeader hides the header and the title.
  • 2.3 Editor:
    • "Add Custom HTML", with a monospace text box, a counter and the forms note;
    • the "Hide page header" switch;
    • field errors at the HTML field.
  • 2.4 Labels in defaultMessages.ts with Chinese in zh_CN.seed.json, then npm run i18n:sql. sql/02-html-block-labels.sql holds only the new labels.
    • Verify (2.1 to 2.4): cd solvway-admin-portal && npx vitest run; echo VITEST=$? && npx tsc --noEmit && npm run lint

3. Release

  • 3.1 docs/deployment.md: the SQL rows and the frame routes. A Traefik or proxy layer must not add a CSP that overrides the frame's own policy.
  • 3.2 Live Playwright check on the local stack, at 1280 and 360 px:
    • paste the INS proof-of-concept HTML into the INS page, with "hide page header" on and the sign-up form below it;
    • it looks like the PoC signed out;
    • opening the frame address directly shows no Co-Lite cookies to the frame's script;
    • a draft frame is not found for visitors and previews for staff;
    • an over-limit paste is refused at its field.
  • 3.3 Whole-branch self-review (security: the sandbox headers, the middleware skip and the message handler), then the PR to main and the merge.