content: tree reparent — move-into section + promote (812/812)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 41s
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 41s
insert/move were top-level only; a block could never move into/out of a section. content/move-into (relocate to a section child at index, tree-wide) + content/promote (lift nested block to top level, subtree intact). Pure tree transforms like the rest of move.sx; cycle-safe (rejects moving a block into its own descendant). +13 tests. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -19,7 +19,7 @@ injected adapter, not core.
|
||||
|
||||
## Status (rolling)
|
||||
|
||||
`bash lib/content/conformance.sh` → **799/799** (Phases 1–4 COMPLETE + ~34 extensions, hardened: HTML/SX escaping, Markdown render + import/export incl. tables & frontmatter (full round-trip), CvRDT flat + nested-tree + durable replication, tree-aware validation, snapshot cache, doc metadata, plain-text render, nested block trees + deep editing + flatten + relative reorder, doc stats + summary + multi-doc index, table + callout + media blocks, HTML page wrapper + SEO page, doc composition + id-remap, portable data + wire serialization, block query + transforms + find/replace, TOC + anchored headings + outline, normalization)
|
||||
`bash lib/content/conformance.sh` → **812/812** (Phases 1–4 COMPLETE + ~34 extensions, hardened: HTML/SX escaping, Markdown render + import/export incl. tables & frontmatter (full round-trip), CvRDT flat + nested-tree + durable replication, tree-aware validation, snapshot cache, doc metadata, plain-text render, nested block trees + deep editing + flatten + relative reorder, doc stats + summary + multi-doc index, table + callout + media blocks, HTML page wrapper + SEO page, doc composition + id-remap, portable data + wire serialization, block query + transforms + find/replace, TOC + anchored headings + outline, normalization)
|
||||
|
||||
## Ground rules
|
||||
|
||||
@@ -106,6 +106,7 @@ lib/content/api.sx ── (content/edit) (content/render) (content/history) ─
|
||||
- [x] document outline (`outline.sx`: content/outline, nested heading tree)
|
||||
- [x] document flatten (`flatten.sx`: content/flatten, un-nest sections; inverse of wrap-section)
|
||||
- [x] relative reorder (`move.sx`: content/move-before/after/to-front/to-back by id)
|
||||
- [x] tree reparent (`move.sx`: content/move-into a section + content/promote out to top level; tree-wide, cycle-safe)
|
||||
- [x] document normalization (`normalize.sx`: content/normalize, drop empty blocks/sections)
|
||||
- [x] document sanitization (`sanitize.sx`: content/sanitize, drop invalid blocks tree-wide; validate's enforcement partner)
|
||||
- [x] global find/replace (`find-replace.sx`: content/find-replace across text-bearing blocks)
|
||||
@@ -136,6 +137,19 @@ lib/content/api.sx ── (content/edit) (content/render) (content/history) ─
|
||||
|
||||
## Progress log
|
||||
|
||||
- 2026-06-07 — Feature: tree reparent in move.sx. Until now insert/move were
|
||||
positional and top-level only, so a block could never be moved *into* a section
|
||||
or *out* of one — a real gap for editing nested documents. Added
|
||||
`content/move-into doc id section-id i` (relocate a block, from anywhere in the
|
||||
tree, to be a child of a section at index i) and `content/promote doc id`
|
||||
(lift a nested block out to the end of the top level; a moved section keeps its
|
||||
whole subtree). Both are pure tree transforms (consistent with the existing
|
||||
move family — not new op-log ops) built on doc-find-deep / ct-find-id /
|
||||
ct-remove-id / ct-replace-id. **Cycle-safe**: move-into no-ops when target is
|
||||
the block itself or sits inside the block's own subtree, so a section can never
|
||||
become its own ancestor. +13 move tests (into/promote/across-sections/empty-
|
||||
shell/whole-section-subtree/cycle-guard/missing-id no-ops). 812/812.
|
||||
|
||||
- 2026-06-07 — Feature: `content/sanitize` — the enforcement counterpart to
|
||||
`validate`. validate *reports* id/field issues; sanitize *removes* the
|
||||
offending blocks (tree-wide) so federated/imported input that failed
|
||||
|
||||
Reference in New Issue
Block a user