---
id: fragment.editor-region-actions.001
freshvibe_way_version: v8
date: 2026-07-31 (Phase 7 — page builder)
last_rewritten: 2026-07-31 (new fragment, Phase 7)
---

# editor-region-actions — region / group create + delete + rename (Phase 7 page-builder manual path)

## What it does

When the operator right-clicks a region tag (yellow/brown chip floating on the page), the chrome shows a context menu with these items:

- **Add region above** — inserts a new region above the right-clicked one
- **Add region below** — inserts a new region below
- **Add a group (column)** — inserts a single-column group container into the region
- **Add a group (3 columns)** — inserts a 3-column group container
- ── divider ──
- **Rename region…** — prompts for a new label, updates `displayLabel`
- ── divider ──
- **Delete region** (red, destructive) — confirms, then deletes the region and all its groups + modules

Every action writes through the store (per pact §3.14). The store does the scope check. The AI reimagine path (Phase 4) calls the SAME primitives.

## Why this is its own feature (cluster rule §3.9)

The region-actions fragment is a cluster of:
1. **Add region above/below** — `addRegionRelative(pageId, anchor, position)` shifts existing orders then creates
2. **Add group to region** — `addGroupToRegion(regionId, {config})` for column / 3-column layout
3. **Rename region** — `renameRegion(id, newLabel, pageId)` updates `displayLabel`
4. **Delete region** — `deleteRegion(id, pageId)` with confirm, cascades via `Store.removeRegion`
5. **Context menu UI** — `renderRegionContextMenu(container, {pageId, region, onAction})` is called by the existing context-menu fragment when the right-click target is a region

Removing any one of these breaks the page-builder manual path.

## Inputs (public API)

- `addRegionRelative(pageId, anchorRegion, position, regionDef?)` — add a region above or below an anchor
- `deleteRegion(regionId, pageId)` — delete a region (cascades to groups + modules)
- `renameRegion(regionId, newLabel, pageId)` — rename
- `addGroupToRegion(regionId, groupDef?)` — add a group container (column / row)
- `renderRegionContextMenu(container, {pageId, region, onAction?})` — render the context menu UI

## What this fragment does NOT do

- Does NOT add modules to a group — that's the editor-palette fragment's job
- Does NOT decide the region style (background, padding, etc.) — that's the region-editor fragment's job
- Does NOT edit an existing region — that's the region-editor fragment's job
- Does NOT do AI reimagine — that's a separate fragment (Phase 4)

## Manual + AI paths (per pact §3.11)

This fragment is the **manual path** for region/group/CRUD. The AI path is the AI composer (Phase 4, not yet built). Both call the same store primitives:
- Manual: operator right-clicks → context menu item → action
- AI: operator says "add a hero region above the footer" → AI parses scope → calls `addRegionRelative`

The context menu footer (TODO) will mention the AI path so the operator never wonders.

## Provenance

- Created 2026-07-31 12:40 BST by fvcms-website-mavis (session 415655444668635)
- Per operator directive 2026-07-31 12:32 BST
- Per cross-thread agreement (bulletin b221) with Hopfan App (id 22)
- Per pact §3.11 (manual+AI both) and §3.14 (store is source of truth)
- Depends on: `Store.createRegion`, `Store.removeRegion`, `Store.renameRegion`, `Store.createGroup` (added in this PR)
