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
2.2 KiB
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 intolocal/seed/. - 1.2 services-counter:
- the
HTMLblock type: required, at most 200,000 characters, no script check; hideHeaderon the page model and DTO.- Verify:
mvn -T 1C -B -pl solvway-services-counter -am verify
- the
- 1.3 mobile-api:
hideHeaderonAdminPageRequestand in the public page response.- Verify:
mvn -T 1C -B -pl solvway-mobile-api -am verify
- 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;
routeGuardadmits the public frame path. - Security code: read the whole diff.
- The middleware skips them;
- 2.2
CmsBlocks:- the sandboxed iframe with height messages from its own frame only;
hideHeaderhides 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.tswith Chinese inzh_CN.seed.json, thennpm run i18n:sql.sql/02-html-block-labels.sqlholds 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
- Verify (2.1 to 2.4):
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.