Skip to content

feat: Reuse component IDs and preserve explicit XML line breaks - #2

Merged
u202F merged 1 commit into
mainfrom
feat/id-reserve
Sep 9, 2026
Merged

u202F merged 1 commit into
mainfrom
feat/id-reserve

Conversation

@u-00a0

@u-00a0 u-00a0 commented Sep 8, 2026

Copy link
Copy Markdown
Member

XML-to-JSON conversion currently replaces internal component IDs on every render, turning small edits into document-wide diffs. Add optional referenceJson rendering options that match existing widgets, tabs, documents, blocks, list items, table axes/cells, audio items and video elements before allocating new IDs. Exact content and unique local identities take priority; compatible edits retain IDs, while ambiguous additions receive fresh IDs. XML stays free of identity attributes.

Also preserve text newlines as closed <br></br> elements and parse explicit breaks back into inline newlines. Previously an empty <br> was ignored, concatenating archive text. The containing paragraph and its ID now remain intact. This prepares version 0.6.0; no package publication is part of this PR.

Validation:

  • pnpm check: typecheck, 64 tests and build pass.
  • Actual item 2338: all 24 widgets, 52 documents and 915 blocks retain IDs through conversion.
  • Laevat source → generated XML → Wiki JSON: all 14 basic-record newlines match the source, 136 closed breaks survive, and all 915 block IDs remain unchanged.
  • Regression coverage includes insertion/deletion/reordering, cross-container moves, duplicate content, local namespaces, table merges, collision retries, deep nesting, formatting and escaped markup.

The consuming extension was verified with 80 unit tests and a mocked Chromium E2E flow, including actual audio/quick-edit submission bodies. Full captured page data remains local; only a minimal public archive excerpt is included as a regression fixture.

@u202F
u202F merged commit 01153fe into main Sep 9, 2026
3 checks passed
@u202F u202F changed the title Reuse component IDs and preserve explicit XML line breaks feat: Reuse component IDs and preserve explicit XML line breaks Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants