diff --git a/docs/deployment.md b/docs/deployment.md
index 2bb638e..337e77e 100644
--- a/docs/deployment.md
+++ b/docs/deployment.md
@@ -154,6 +154,7 @@ Run the three in order before the new services-system, gateway and mobile-api go
| `openspec/changes/archive/2026-12-03-add-custom-html-block/sql/02-html-block-labels.sql` | Adds the Custom HTML block labels in English and Chinese. Same rule as `05-page-labels.sql`: only where `add-zh-cn-messages/sql/03` already ran. |
| `openspec/changes/archive/2026-12-03-add-lead-notifications/sql/01-notification-columns.sql` | Turns the unused `service-system`.`notification` table into the staff bell: converts it to utf8mb4 and adds the recipient, company, type, link, collapse and read columns and two indexes. DDL. |
| `openspec/changes/archive/2026-12-03-add-lead-notifications/sql/02-notification-labels.sql` | Adds the bell's labels in English and Chinese. Same rule as `05-page-labels.sql`: only where `add-zh-cn-messages/sql/03` already ran. |
+| `openspec/changes/add-page-anchor-links/sql/01-anchor-labels.sql` | Adds the "Link name" labels and updates the link hint and the bad-link message, in English and Chinese. Same rule as `05-page-labels.sql`: only where `add-zh-cn-messages/sql/03` already ran. No DDL: link names live in the page's blocks JSON. |
Run them in order before the new services-counter, services-system and mobile-api go live: the new services read the new columns on every event lead and company query. `01` to `03` need a user that may alter tables. `99-rollback.sql` in the same folder removes the module and drops the two tables and the columns, which deletes every page, image, page address and campaign tag.
@@ -429,7 +430,7 @@ data:
- An image removed from a page stays stored; nothing deletes unused images.
- The editor warns about unsaved edits only on reload or close, not when staff click another link in the back office.
- A standing enquiries event (section 12) appears in event lists and dashboards like any event.
- - Links accept only `https://`, `mailto:`, `tel:` or a path starting with `/`. A same-page `#anchor` link (for example a hero button that jumps to the form) is refused; use the page's own path instead.
+ - Links accept only `https://`, `mailto:`, `tel:`, a path starting with `/`, or `#` plus a block's link name.
## 11. Connecting WhatsApp (Meta)
@@ -459,6 +460,7 @@ Marketing builds public pages under **Events → Pages**. Each page has blocks (
2. **Branding.** A super admin sets each company's logo and accent colour under **Companies → Branding**. Buttons on the company's pages use the accent colour, with black or white text, whichever is easier to read. Without them the page shows the company name and the default blue.
3. **Standing enquiries event.** A sign-up form always belongs to an event. For general enquiries, each company creates one event, for example "INS website enquiries", with a far-off end date and its sales team, and picks it in the form block. Sign-ups from a landing page are never marked as attended, so this event does not inflate attendance. Name it clearly: it shows in event lists and dashboards.
4. **The INS page.** The INS proof of concept (`ins-landing-page`, never deployed) is content, not code: rebuild it by hand in the editor after deploy. Its test leads are not imported.
+ - **Jump to the form.** To make a button jump to the sign-up form, give the form block a link name, for example `signup`, and link the button to `#signup`. Links inside a Custom HTML block work the same way: on the INS page, change the HTML's `#consult` links to `#signup`. A `#name` link inside the HTML that matches an `id` in that same HTML (such as `#top`) scrolls to that spot instead.
5. **Check.** Publish a page, open its address signed out, sign up through its form with `?utm_source=test` on the address, and check that the event lead shows source **Web page**, the page address and the campaign. Delete that test lead afterwards.
A form stops taking sign-ups when its event is disabled, its end date has passed (Malaysia time), or the company has no privacy notice; the page then says sign-up is closed and still shows its other blocks. Sign-ups share the QR pages' rate limits.
diff --git a/docs/superpowers/specs/2026-12-03-page-anchor-links-design.md b/docs/superpowers/specs/2026-12-03-page-anchor-links-design.md
new file mode 100644
index 0000000..78073f4
--- /dev/null
+++ b/docs/superpowers/specs/2026-12-03-page-anchor-links-design.md
@@ -0,0 +1,33 @@
+# Same-page anchor links on landing pages — design
+
+Approved by the owner on 2026-12-03 (small change).
+
+## Why
+
+Marketing wants a button near the top of a landing page to jump to the sign-up form further down. Today the editor, the portal and services-counter all refuse a `#anchor` link, and blocks carry no `id` to jump to. On the INS "hotel-technology" page (a Custom HTML block followed by a FORM block), the pasted HTML's own `#consult` and `#top` links do nothing: the sealed frame is sized to its full height, so it never scrolls itself, and as an opaque-origin frame it may not scroll the page around it.
+
+## Goals
+
+- Staff can name any block and link to it with `#name` from a button, from rich text, or from inside a Custom HTML block.
+- In-frame links to an `id` inside the same Custom HTML block work again.
+
+## Non-goals
+
+- No automatic ids (`block-3`): they break when blocks are reordered.
+- No change to how the sealed frame is sandboxed. The frame gets no new grants.
+
+## Approaches
+
+1. **An optional link name per block (chosen).** One new optional field, unique per page, stored in the existing blocks JSON. Works for every block type and survives reordering.
+2. Automatic positional ids (`block-3`). No editor change, but links break silently when blocks move.
+3. A fixed `id="form"` on the FORM block only. Covers the main case, but not other blocks or `#top`.
+
+## Design
+
+- **Link name.** Each block has an optional "Link name": lowercase letters, digits and `-`, starting with a letter or digit and not with `reg-` (the sign-up form's field ids), at most 40 characters, unique on the page. services-counter checks it. The public page renders it as the block's `id`.
+- **`#name` links.** Button links and rich-text links also accept `#` followed by a name of that pattern. The same rule is in services-counter, the portal's `isSafeLink`, the rich-text editor and the public sanitiser.
+- **Frame bridge.** The frame document's injected script, which already reports its height, also catches clicks on `#name` links inside the frame and posts the name and, when the frame holds an element with that `id`, the element's offset. The page acts on such a message only from its own frame and only for a name of the pattern. It scrolls to the frame's top plus that offset when the frame has the target; otherwise to a block on the page with that link name; otherwise it does nothing. The frame link's default action is prevented, so the frame never navigates.
+
+## Left to the builder
+
+Field placement in the editor, label wording, and smooth vs instant scrolling.
diff --git a/local/seed/04-zh-cn-messages.sql b/local/seed/04-zh-cn-messages.sql
index e736308..a887b3f 100644
--- a/local/seed/04-zh-cn-messages.sql
+++ b/local/seed/04-zh-cn-messages.sql
@@ -1607,8 +1607,8 @@ INSERT INTO message (code, content, area) SELECT 'PagesDivider', JSON_OBJECT('en
UPDATE message SET content = JSON_SET(COALESCE(content, JSON_OBJECT()), '$.zh_CN', '分隔线') WHERE LOWER(code) = LOWER('PagesDivider') AND area = 'A';
INSERT INTO message (code, content, area) SELECT 'PagesLink', JSON_OBJECT('en_US', 'Link', 'zh_CN', '链接'), 'A' FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM message WHERE LOWER(code) = LOWER('PagesLink') AND area = 'A');
UPDATE message SET content = JSON_SET(COALESCE(content, JSON_OBJECT()), '$.zh_CN', '链接') WHERE LOWER(code) = LOWER('PagesLink') AND area = 'A';
-INSERT INTO message (code, content, area) SELECT 'PagesLinkPrompt', JSON_OBJECT('en_US', 'Link address (https://, mailto:, tel: or /)', 'zh_CN', '链接地址(https://、mailto:、tel: 或 /)'), 'A' FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM message WHERE LOWER(code) = LOWER('PagesLinkPrompt') AND area = 'A');
-UPDATE message SET content = JSON_SET(COALESCE(content, JSON_OBJECT()), '$.zh_CN', '链接地址(https://、mailto:、tel: 或 /)') WHERE LOWER(code) = LOWER('PagesLinkPrompt') AND area = 'A';
+INSERT INTO message (code, content, area) SELECT 'PagesLinkPrompt', JSON_OBJECT('en_US', 'Link address (https://, mailto:, tel:, / or #name)', 'zh_CN', '链接地址(https://、mailto:、tel:、/ 或 #名称)'), 'A' FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM message WHERE LOWER(code) = LOWER('PagesLinkPrompt') AND area = 'A');
+UPDATE message SET content = JSON_SET(COALESCE(content, JSON_OBJECT()), '$.zh_CN', '链接地址(https://、mailto:、tel:、/ 或 #名称)') WHERE LOWER(code) = LOWER('PagesLinkPrompt') AND area = 'A';
INSERT INTO message (code, content, area) SELECT 'PagesClearFormatting', JSON_OBJECT('en_US', 'Clear formatting', 'zh_CN', '清除格式'), 'A' FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM message WHERE LOWER(code) = LOWER('PagesClearFormatting') AND area = 'A');
UPDATE message SET content = JSON_SET(COALESCE(content, JSON_OBJECT()), '$.zh_CN', '清除格式') WHERE LOWER(code) = LOWER('PagesClearFormatting') AND area = 'A';
INSERT INTO message (code, content, area) SELECT 'PagesTooManyBlocks', JSON_OBJECT('en_US', 'A page can have at most 30 blocks.', 'zh_CN', '每个网页最多 30 个区块。'), 'A' FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM message WHERE LOWER(code) = LOWER('PagesTooManyBlocks') AND area = 'A');
@@ -1625,8 +1625,16 @@ INSERT INTO message (code, content, area) SELECT 'PagesFaqCount', JSON_OBJECT('e
UPDATE message SET content = JSON_SET(COALESCE(content, JSON_OBJECT()), '$.zh_CN', '请添加 1 至 30 个问题。') WHERE LOWER(code) = LOWER('PagesFaqCount') AND area = 'A';
INSERT INTO message (code, content, area) SELECT 'PagesButtonPair', JSON_OBJECT('en_US', 'Fill in both the button label and the button link, or neither.', 'zh_CN', '按钮文字和按钮链接需同时填写或同时留空。'), 'A' FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM message WHERE LOWER(code) = LOWER('PagesButtonPair') AND area = 'A');
UPDATE message SET content = JSON_SET(COALESCE(content, JSON_OBJECT()), '$.zh_CN', '按钮文字和按钮链接需同时填写或同时留空。') WHERE LOWER(code) = LOWER('PagesButtonPair') AND area = 'A';
-INSERT INTO message (code, content, area) SELECT 'PagesBadLink', JSON_OBJECT('en_US', 'Use a link that starts with https://, mailto:, tel: or /.', 'zh_CN', '链接须以 https://、mailto:、tel: 或 / 开头。'), 'A' FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM message WHERE LOWER(code) = LOWER('PagesBadLink') AND area = 'A');
-UPDATE message SET content = JSON_SET(COALESCE(content, JSON_OBJECT()), '$.zh_CN', '链接须以 https://、mailto:、tel: 或 / 开头。') WHERE LOWER(code) = LOWER('PagesBadLink') AND area = 'A';
+INSERT INTO message (code, content, area) SELECT 'PagesBadLink', JSON_OBJECT('en_US', 'Use a link that starts with https://, mailto:, tel:, / or #.', 'zh_CN', '链接须以 https://、mailto:、tel:、/ 或 # 开头。'), 'A' FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM message WHERE LOWER(code) = LOWER('PagesBadLink') AND area = 'A');
+UPDATE message SET content = JSON_SET(COALESCE(content, JSON_OBJECT()), '$.zh_CN', '链接须以 https://、mailto:、tel:、/ 或 # 开头。') WHERE LOWER(code) = LOWER('PagesBadLink') AND area = 'A';
+INSERT INTO message (code, content, area) SELECT 'PagesAnchor', JSON_OBJECT('en_US', 'Link name (optional)', 'zh_CN', '链接名称(可选)'), 'A' FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM message WHERE LOWER(code) = LOWER('PagesAnchor') AND area = 'A');
+UPDATE message SET content = JSON_SET(COALESCE(content, JSON_OBJECT()), '$.zh_CN', '链接名称(可选)') WHERE LOWER(code) = LOWER('PagesAnchor') AND area = 'A';
+INSERT INTO message (code, content, area) SELECT 'PagesAnchorHint', JSON_OBJECT('en_US', 'Link to this block with #name, for example #signup. Lowercase letters, digits and - only.', 'zh_CN', '用 #名称 链接到此区块,例如 #signup。仅限小写字母、数字和 -。'), 'A' FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM message WHERE LOWER(code) = LOWER('PagesAnchorHint') AND area = 'A');
+UPDATE message SET content = JSON_SET(COALESCE(content, JSON_OBJECT()), '$.zh_CN', '用 #名称 链接到此区块,例如 #signup。仅限小写字母、数字和 -。') WHERE LOWER(code) = LOWER('PagesAnchorHint') AND area = 'A';
+INSERT INTO message (code, content, area) SELECT 'PagesBadAnchor', JSON_OBJECT('en_US', 'Use lowercase letters, digits and - (up to 40), starting with a letter or digit and not with reg-.', 'zh_CN', '请使用小写字母、数字和 -(最多 40 个),以字母或数字开头,且不能以 reg- 开头。'), 'A' FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM message WHERE LOWER(code) = LOWER('PagesBadAnchor') AND area = 'A');
+UPDATE message SET content = JSON_SET(COALESCE(content, JSON_OBJECT()), '$.zh_CN', '请使用小写字母、数字和 -(最多 40 个),以字母或数字开头,且不能以 reg- 开头。') WHERE LOWER(code) = LOWER('PagesBadAnchor') AND area = 'A';
+INSERT INTO message (code, content, area) SELECT 'PagesAnchorTaken', JSON_OBJECT('en_US', 'Another block on this page already has this link name.', 'zh_CN', '本页已有其他区块使用此链接名称。'), 'A' FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM message WHERE LOWER(code) = LOWER('PagesAnchorTaken') AND area = 'A');
+UPDATE message SET content = JSON_SET(COALESCE(content, JSON_OBJECT()), '$.zh_CN', '本页已有其他区块使用此链接名称。') WHERE LOWER(code) = LOWER('PagesAnchorTaken') AND area = 'A';
INSERT INTO message (code, content, area) SELECT 'PagesScript', JSON_OBJECT('en_US', 'Scripts and event handlers are not allowed.', 'zh_CN', '不允许使用脚本或事件处理程序。'), 'A' FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM message WHERE LOWER(code) = LOWER('PagesScript') AND area = 'A');
UPDATE message SET content = JSON_SET(COALESCE(content, JSON_OBJECT()), '$.zh_CN', '不允许使用脚本或事件处理程序。') WHERE LOWER(code) = LOWER('PagesScript') AND area = 'A';
INSERT INTO message (code, content, area) SELECT 'PagesBadImage', JSON_OBJECT('en_US', 'Upload the image again.', 'zh_CN', '请重新上传图片。'), 'A' FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM message WHERE LOWER(code) = LOWER('PagesBadImage') AND area = 'A');
diff --git a/openspec/changes/add-page-anchor-links/.openspec.yaml b/openspec/changes/add-page-anchor-links/.openspec.yaml
new file mode 100644
index 0000000..2a83988
--- /dev/null
+++ b/openspec/changes/add-page-anchor-links/.openspec.yaml
@@ -0,0 +1,2 @@
+schema: spec-driven
+created: 2026-12-03
diff --git a/openspec/changes/add-page-anchor-links/design.md b/openspec/changes/add-page-anchor-links/design.md
new file mode 100644
index 0000000..c296722
--- /dev/null
+++ b/openspec/changes/add-page-anchor-links/design.md
@@ -0,0 +1,27 @@
+## Context
+
+See `docs/superpowers/specs/2026-12-03-page-anchor-links-design.md`. Blocks are one JSON column on `cms_page`; services-counter validates them; mobile-api passes them through as maps; the portal renders them. Custom HTML runs in an opaque-origin frame (`allow-scripts allow-popups allow-popups-to-escape-sandbox`) whose injected script already posts height reports, which `HtmlFrame` accepts only from its own `contentWindow`.
+
+## Goals / Non-Goals
+
+**Goals:** named block targets; `#name` links from buttons, rich text and Custom HTML.
+
+**Non-Goals:** automatic ids; any new frame permission; scroll offsets for a sticky header (the public page has none).
+
+## Decisions
+
+1. **Field `anchor` on the block**, pattern `^(?!reg-)[a-z0-9][a-z0-9-]{0,39}$`, unique per page. `reg-` is reserved because the sign-up form renders its fields with literal `reg-*` ids. Stored in the blocks JSON, so no DDL. Refusal codes: `PagesBadAnchor`, `PagesAnchorTaken`.
+2. **Link rule.** `#` plus the same pattern is a safe link everywhere a link is checked: `CmsBlockValidator.safeLink`, `isSafeLink`, the editor's `SAFE_LINK`, and the sanitiser (sanitize-html already keeps scheme-less hrefs; a test pins it).
+3. **Ids.** The block wrapper in `CmsBlocks` gets `id={anchor}` for every type, the HTML frame included. Rendered only when the name matches the pattern, so rows written another way cannot inject odd ids.
+4. **Frame bridge.** The injected script adds one click listener: for `a[href^="#"]` with a valid name it prevents the default and posts `{type:"colite-frame-anchor", name, y}`, where `y` is the in-frame element's document offset or `null`. `HtmlFrame` checks the source window as for heights, validates the message in a pure `frameAnchor()` helper, then scrolls the window to `frame top + y`, or to `document.getElementById(name)`, else ignores it. Smooth scroll.
+5. **Messages are data only.** The page never navigates or evaluates anything from a frame message; it only scrolls.
+
+## Risks / Trade-offs
+
+- A frame script could post anchor requests at will → it can only scroll its own page, which it could already make tall. Accepted.
+- A link name equal to an id the portal already uses on that page (e.g. `main`) would clash → the sign-up form's field ids all start with `reg-`, which link names may not; other ids on the page come from `useId` and cannot match the pattern. The staff preview runs inside the back-office shell, whose ids are not checked against link names.
+- Pages saved by an older release lose link names → only on rollback; noted in the proposal.
+
+## Migration Plan
+
+Deploy services-counter and the portal; run `sql/01-anchor-labels.sql`. Rollback: previous images and `sql/99-rollback.sql`.
diff --git a/openspec/changes/add-page-anchor-links/proposal.md b/openspec/changes/add-page-anchor-links/proposal.md
new file mode 100644
index 0000000..42adf92
--- /dev/null
+++ b/openspec/changes/add-page-anchor-links/proposal.md
@@ -0,0 +1,28 @@
+## Why
+
+Landing pages cannot link within themselves. Buttons and rich-text links refuse `#anchor`, blocks have no id to jump to, and links inside a Custom HTML block do nothing because the sealed frame never scrolls and may not scroll the page. The INS page's "Get My Free Consultation" button therefore cannot take visitors to the sign-up form. Design: `docs/superpowers/specs/2026-12-03-page-anchor-links-design.md`.
+
+## What Changes
+
+- Each block gets an optional link name, unique on the page, rendered as the block's id.
+- Button and rich-text links accept `#name`.
+- The Custom HTML frame reports clicks on `#name` links to the page, which scrolls to the target inside the frame or to the named block.
+- New and changed editor labels in English and Chinese.
+
+## Capabilities
+
+### New Capabilities
+
+None.
+
+### Modified Capabilities
+
+- `landing-pages`: same-page links and block link names.
+
+## Impact
+
+- services-counter: `CmsBlock` gains `anchor`; `CmsBlockValidator` checks it and accepts `#name` links. No DDL: blocks are stored as JSON.
+- mobile-api: none (blocks pass through as maps).
+- Portal: `cmsPages.ts` (`isSafeLink`, model), `RichTextEditor.tsx`, `pageHtml.ts`, `frameHtml.ts` (script and message parsing), `HtmlFrame.tsx`, `CmsBlocks.tsx` (ids), `BlockFields.tsx` (field), labels.
+- SQL: `sql/01-anchor-labels.sql` and `sql/99-rollback.sql` (labels only).
+- Older releases ignore the new field on read, and a page saved by an older release loses its link names.
diff --git a/openspec/changes/add-page-anchor-links/specs/landing-pages/spec.md b/openspec/changes/add-page-anchor-links/specs/landing-pages/spec.md
new file mode 100644
index 0000000..a046696
--- /dev/null
+++ b/openspec/changes/add-page-anchor-links/specs/landing-pages/spec.md
@@ -0,0 +1,78 @@
+## MODIFIED Requirements
+
+### Requirement: Page Content Cannot Run Scripts
+
+A button SHALL have both a label and a link or neither. The link SHALL start with a single `/`, `https://`, `mailto:`, `tel:`, or `#` plus a valid block link name. A save SHALL be refused when RICH_TEXT or IMAGE_TEXT HTML holds a `script` element, an `on*` attribute or a `javascript:` URL. The public page SHALL also sanitise that HTML against an allow-list. HTML blocks are exempt: they only run sealed.
+
+#### Scenario: Script link on a button
+
+- **WHEN** a page is saved with a HERO button link `javascript:alert(1)`
+- **THEN** the save is refused on field `blocks[0].buttonUrl`
+
+#### Scenario: Script in rich text
+
+- **WHEN** a page is saved with rich text holding ` {t("PagesAnchorHint")}`
+- **THEN** the save is refused on that block's HTML field
+
+#### Scenario: Script in an HTML block
+
+- **WHEN** a page is saved with an HTML block holding ``
+- **THEN** the save succeeds
+
+#### Scenario: Same-page button link
+
+- **WHEN** a page is saved with a HERO button link `#signup`
+- **THEN** the save succeeds
+
+#### Scenario: Malformed same-page link
+
+- **WHEN** a page is saved with a HERO button link `#Sign Up`
+- **THEN** the save is refused on field `blocks[0].buttonUrl`
+
+## ADDED Requirements
+
+### Requirement: Block Link Names
+
+Any block MAY carry a link name. A link name SHALL be 1 to 40 characters of lowercase letters, digits and `-`, starting with a letter or digit, SHALL NOT start with `reg-` (the sign-up form's own field ids), and SHALL be unique within the page. A save breaking either rule SHALL be refused on that block's link-name field, writing nothing. The public page and the staff preview SHALL give the block that name as its element id, so a `#name` link scrolls to it.
+
+#### Scenario: Hero button jumps to the form
+
+- **GIVEN** a published page whose FORM block has the link name `signup` and whose HERO button links to `#signup`
+- **WHEN** a visitor clicks the button
+- **THEN** the page scrolls to the form
+
+#### Scenario: Duplicate link name
+
+- **WHEN** a page is saved with two blocks named `signup`
+- **THEN** the save is refused on field `blocks[1].anchor` and nothing is written
+
+#### Scenario: Reserved link name
+
+- **WHEN** a page is saved with a block named `reg-email`
+- **THEN** the save is refused on field `blocks[0].anchor` and nothing is written
+
+#### Scenario: Bad link name
+
+- **WHEN** a page is saved with a block named `Sign Up`
+- **THEN** the save is refused on field `blocks[0].anchor` and nothing is written
+
+### Requirement: Same-Page Links From A Custom HTML Frame
+
+A click on a `#name` link inside a Custom HTML block SHALL scroll the page, without navigating the frame. The target SHALL be the element with that id inside the same frame when there is one, otherwise the block on the page with that link name, otherwise nothing happens. The page SHALL act only on such requests from its own frames and only for names of the link-name pattern. The frame SHALL gain no new sandbox permissions.
+
+#### Scenario: Link to the form below the frame
+
+- **GIVEN** a published page with an HTML block holding `` and a FORM block named `signup`
+- **WHEN** a visitor clicks that link
+- **THEN** the page scrolls to the form
+
+#### Scenario: Link inside the frame
+
+- **GIVEN** a published HTML block whose content holds `` near its bottom and an element with id `top` at its start
+- **WHEN** a visitor scrolls down and clicks that link
+- **THEN** the page scrolls back to the start of the frame
+
+#### Scenario: Another window asks to scroll
+
+- **WHEN** a different window posts a same-page link request to the page
+- **THEN** the page does not scroll
diff --git a/openspec/changes/add-page-anchor-links/sql/01-anchor-labels.sql b/openspec/changes/add-page-anchor-links/sql/01-anchor-labels.sql
new file mode 100644
index 0000000..4b47b8d
--- /dev/null
+++ b/openspec/changes/add-page-anchor-links/sql/01-anchor-labels.sql
@@ -0,0 +1,18 @@
+-- The labels added or changed by add-page-anchor-links, cut from the output of `npm run i18n:sql`. Run it only in an environment that already ran add-zh-cn-messages/sql/03-zh-cn-messages.sql; otherwise run that 03 file, which includes these labels.
+SET NAMES utf8mb4;
+USE `service-system`;
+INSERT INTO message (code, content, area) SELECT 'PagesLinkPrompt', JSON_OBJECT('en_US', 'Link address (https://, mailto:, tel:, / or #name)', 'zh_CN', '链接地址(https://、mailto:、tel:、/ 或 #名称)'), 'A' FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM message WHERE LOWER(code) = LOWER('PagesLinkPrompt') AND area = 'A');
+UPDATE message SET content = JSON_SET(COALESCE(content, JSON_OBJECT()), '$.zh_CN', '链接地址(https://、mailto:、tel:、/ 或 #名称)') WHERE LOWER(code) = LOWER('PagesLinkPrompt') AND area = 'A';
+INSERT INTO message (code, content, area) SELECT 'PagesBadLink', JSON_OBJECT('en_US', 'Use a link that starts with https://, mailto:, tel:, / or #.', 'zh_CN', '链接须以 https://、mailto:、tel:、/ 或 # 开头。'), 'A' FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM message WHERE LOWER(code) = LOWER('PagesBadLink') AND area = 'A');
+UPDATE message SET content = JSON_SET(COALESCE(content, JSON_OBJECT()), '$.zh_CN', '链接须以 https://、mailto:、tel:、/ 或 # 开头。') WHERE LOWER(code) = LOWER('PagesBadLink') AND area = 'A';
+INSERT INTO message (code, content, area) SELECT 'PagesAnchor', JSON_OBJECT('en_US', 'Link name (optional)', 'zh_CN', '链接名称(可选)'), 'A' FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM message WHERE LOWER(code) = LOWER('PagesAnchor') AND area = 'A');
+UPDATE message SET content = JSON_SET(COALESCE(content, JSON_OBJECT()), '$.zh_CN', '链接名称(可选)') WHERE LOWER(code) = LOWER('PagesAnchor') AND area = 'A';
+INSERT INTO message (code, content, area) SELECT 'PagesAnchorHint', JSON_OBJECT('en_US', 'Link to this block with #name, for example #signup. Lowercase letters, digits and - only.', 'zh_CN', '用 #名称 链接到此区块,例如 #signup。仅限小写字母、数字和 -。'), 'A' FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM message WHERE LOWER(code) = LOWER('PagesAnchorHint') AND area = 'A');
+UPDATE message SET content = JSON_SET(COALESCE(content, JSON_OBJECT()), '$.zh_CN', '用 #名称 链接到此区块,例如 #signup。仅限小写字母、数字和 -。') WHERE LOWER(code) = LOWER('PagesAnchorHint') AND area = 'A';
+INSERT INTO message (code, content, area) SELECT 'PagesBadAnchor', JSON_OBJECT('en_US', 'Use lowercase letters, digits and - (up to 40), starting with a letter or digit and not with reg-.', 'zh_CN', '请使用小写字母、数字和 -(最多 40 个),以字母或数字开头,且不能以 reg- 开头。'), 'A' FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM message WHERE LOWER(code) = LOWER('PagesBadAnchor') AND area = 'A');
+UPDATE message SET content = JSON_SET(COALESCE(content, JSON_OBJECT()), '$.zh_CN', '请使用小写字母、数字和 -(最多 40 个),以字母或数字开头,且不能以 reg- 开头。') WHERE LOWER(code) = LOWER('PagesBadAnchor') AND area = 'A';
+INSERT INTO message (code, content, area) SELECT 'PagesAnchorTaken', JSON_OBJECT('en_US', 'Another block on this page already has this link name.', 'zh_CN', '本页已有其他区块使用此链接名称。'), 'A' FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM message WHERE LOWER(code) = LOWER('PagesAnchorTaken') AND area = 'A');
+UPDATE message SET content = JSON_SET(COALESCE(content, JSON_OBJECT()), '$.zh_CN', '本页已有其他区块使用此链接名称。') WHERE LOWER(code) = LOWER('PagesAnchorTaken') AND area = 'A';
+-- PagesLinkPrompt and PagesBadLink already exist: their English changes too.
+UPDATE message SET content = JSON_SET(COALESCE(content, JSON_OBJECT()), '$.en_US', 'Link address (https://, mailto:, tel:, / or #name)') WHERE LOWER(code) = LOWER('PagesLinkPrompt') AND area = 'A';
+UPDATE message SET content = JSON_SET(COALESCE(content, JSON_OBJECT()), '$.en_US', 'Use a link that starts with https://, mailto:, tel:, / or #.') WHERE LOWER(code) = LOWER('PagesBadLink') AND area = 'A';
diff --git a/openspec/changes/add-page-anchor-links/sql/99-rollback.sql b/openspec/changes/add-page-anchor-links/sql/99-rollback.sql
new file mode 100644
index 0000000..489b064
--- /dev/null
+++ b/openspec/changes/add-page-anchor-links/sql/99-rollback.sql
@@ -0,0 +1,8 @@
+-- Co-Lite change add-page-anchor-links: rollback of the labels. Blocks keep their link names in the JSON; the previous
+-- release ignores them on read, and a page saved by it loses them. Pages with #name links must be edited before
+-- they are saved under the previous release, which refuses such links.
+SET NAMES utf8mb4;
+USE `service-system`;
+DELETE FROM message WHERE code IN ('PagesAnchor', 'PagesAnchorHint', 'PagesBadAnchor', 'PagesAnchorTaken') AND area = 'A';
+UPDATE message SET content = JSON_SET(content, '$.en_US', 'Link address (https://, mailto:, tel: or /)', '$.zh_CN', '链接地址(https://、mailto:、tel: 或 /)') WHERE LOWER(code) = LOWER('PagesLinkPrompt') AND area = 'A';
+UPDATE message SET content = JSON_SET(content, '$.en_US', 'Use a link that starts with https://, mailto:, tel: or /.', '$.zh_CN', '链接须以 https://、mailto:、tel: 或 / 开头。') WHERE LOWER(code) = LOWER('PagesBadLink') AND area = 'A';
diff --git a/openspec/changes/add-page-anchor-links/tasks.md b/openspec/changes/add-page-anchor-links/tasks.md
new file mode 100644
index 0000000..c97dbfa
--- /dev/null
+++ b/openspec/changes/add-page-anchor-links/tasks.md
@@ -0,0 +1,20 @@
+# Tasks: add-page-anchor-links
+
+Design: `design.md`. Every task is TDD. Work is serial in the main session, with a self-review per task.
+
+## 1. services-counter
+
+- [x] 1.1 `CmsBlock.anchor`; `CmsBlockValidator`: link-name pattern and uniqueness (`PagesBadAnchor`, `PagesAnchorTaken` on `blocks[i].anchor`), `#name` accepted by `safeLink`.
+ - Verify: `mvn -T 1C -B -pl solvway-services-counter -am verify`
+
+## 2. Portal
+
+- [x] 2.1 Link rules: `isSafeLink`, the rich-text editor's `SAFE_LINK`, a sanitiser test that `#name` hrefs survive; block ids in `CmsBlocks` (pattern-checked).
+- [x] 2.2 Frame bridge: click listener in the frame script, `frameAnchor()` message check, `HtmlFrame` scroll (own frame only).
+- [x] 2.3 Editor: "Link name" field per block with field errors; label changes in `defaultMessages.ts` and `zh_CN.seed.json`, then `npm run i18n:sql`; `sql/01-anchor-labels.sql` (new labels, plus English and Chinese updates of `PagesBadLink` and `PagesLinkPrompt`) and `sql/99-rollback.sql`.
+ - Verify (2.1 to 2.3): `cd solvway-admin-portal && npx vitest run; echo VITEST=$? && npx tsc --noEmit && npm run lint`
+
+## 3. Release
+
+- [x] 3.1 `docs/deployment.md`: SQL rows, drop the `#anchor` known gap, add the INS page note (name the FORM block `signup`, change the HTML's `#consult` to `#signup`).
+- [x] 3.2 Live check (Playwright) on a local portal: hero button to a named form block; Custom HTML `#name` to the form and `#top` inside the frame; refusals for a bad and a duplicate link name; 1280 and 360 px.
diff --git a/solvway-admin-portal/app/components/pages/BlockFields.tsx b/solvway-admin-portal/app/components/pages/BlockFields.tsx
index bcab692..69d16fb 100644
--- a/solvway-admin-portal/app/components/pages/BlockFields.tsx
+++ b/solvway-admin-portal/app/components/pages/BlockFields.tsx
@@ -12,7 +12,7 @@ import { RichTextEditor } from "./RichTextEditor";
// One block of the page editor, ported from babyboo's BlockFields: a fieldset with move/remove and its type's fields.
-/** Field paths (relative to the block) each type shows inline; any other error shows at the block's top. */
+/** Field paths (relative to the block) each type shows inline; any other error shows at the block's top. Every type also shows "anchor". */
const INLINE: Record
Hi
" }], +}; + +beforeEach(() => { + vi.clearAllMocks(); + memoryRouter.reset("/pages/5"); + mocks.useAdminAuth.mockReturnValue({ isSuper: false, companyCode: "INS" }); + mocks.useCompanyScope.mockReturnValue({ companyId: undefined, companies: [{ id: 2, code: "INS", name: "INS", status: "A" }], codeOf: (id?: number) => (id === 2 ? "INS" : "") }); + mocks.listAdminEvents.mockResolvedValue({ items: [], total: 0 }); + mocks.getPage.mockResolvedValue(stored); + mocks.savePage.mockImplementation(async (id: number | undefined, body: object) => ({ ...stored, ...body, id: id ?? 7 })); +}); + +describe("PageEditor: link names", () => { + it("shows and saves each block's link name, dropping a blank one", async () => { + const user = userEvent.setup(); + render(Hi
", anchor: "signup" }]); + }); + + it("shows a refused link name at its field", async () => { + mocks.savePage.mockRejectedValue(new ApiError("x", 422, { code: "PagesAnchorTaken", details: { field: "blocks[1].anchor" } })); + const user = userEvent.setup(); + render(