[11/16] refactor(painter): remove blockLookup β painter reads only resolved data#2828
Conversation
84f6ae2 to
d7e10ba
Compare
ead112c to
2d2ce0d
Compare
2d2ce0d to
11ca970
Compare
Codecov Reportβ All modified and coverable lines are covered by tests. π’ Thoughts on this report? Let us know! |
|
π This PR is included in superdoc v1.28.0-next.12 The release is available on GitHub release |
|
π This PR is included in superdoc-cli v0.8.0-next.12 The release is available on GitHub release |
|
π This PR is included in superdoc-sdk v1.6.0-next.48 |
|
π This PR is included in superdoc v1.29.0 The release is available on GitHub release |
|
π This PR is included in @superdoc-dev/mcp v0.3.0-next.1 The release is available on GitHub release |
|
π This PR is included in superdoc-sdk v1.8.0-next.1 |
|
π This PR is included in esign v2.6.0 The release is available on GitHub release |
|
π This PR is included in template-builder v1.7.0 The release is available on GitHub release |
|
π This PR is included in superdoc-cli v0.8.0 The release is available on GitHub release |
|
π This PR is included in superdoc-sdk v1.8.0 |
|
π This PR is included in @superdoc-dev/mcp v0.3.0 The release is available on GitHub release |
What this PR does
Removes the
blockLookup: Map<string, BlockLookupEntry>fromDomPainter. After the previous refactors (#2810β#2827), every piece of data the painter reads at paint time is available on the resolved layout. The lookup map and the bridge fields that fed it (blocks,measures,headerBlocks,headerMeasures,footerBlocks,footerMeasuresonDomPainterInput) are now dead β this PR deletes them.Finishes the promise of SD-2563: painter is now a "dumb" rendering stage that consumes fully-resolved
ResolvedLayoutand produces DOM. No upstream lookups, no fallback paths, no mixed-data bridges.Key changes
DomPainterInputshape shrinks to{ resolvedLayout, sourceLayout }β body/header/footer block-measure pairs removed.DomPainter.#updateBlockLookup,#normalizeOptionalBlockMeasurePair,#resolveBlockAndMeasure,#resolveBlock,#buildBlockLookupall deleted.isHeaderWordArtWatermarknow takes the drawing block from itsResolvedDrawingIteminstead of looking it up byblockId.hasFragmentGeometryChanged(added to main by fix: rebuild fragment on geometry changeΒ #2842) preserved as a standalone helper β it was semantically independent ofblockLookup.createDomPainterlegacy layout-only input path no longer synthesizes header/footer lookups.PresentationEditor.#paintLayoutstops gathering header/footer blocks+measures into the paint input.BlockLookupβgroup-analysisreads resolved paragraph borders directly.index.test.ts: "rejects resolved-layout-only paint inputβ¦", "uses resolved block versionsβ¦", "uses resolved continuesFromPrevβ¦";PresentationEditor.test.ts: "passes body blocks and measures to the painterβ¦") β each asserted fields that no longer exist onDomPainterInput.Diff shape
Verification
Ran against commit on the rebase worktree before push:
pnpm type-check(tsc -b across all packages)pnpm build(full workspace)pnpm --filter @superdoc/painter-dom buildpnpm --filter @superdoc/painter-dom testpnpm --filter @superdoc/pm-adapter testpnpm --filter super-editor test -- --run presentation-editorRebase history
ERR_PNPM_OUTDATED_LOCKFILEon the stacked base and renderer drift from main's#2842(hasFragmentGeometryChanged). Resolved by resetting to the new [10/16] refactor(painter): deliver resolved items to decoration provider callbackΒ #2827 tip and cherry-picking the single PR 11 commit.main. Branch still carried the pre-squash PR 10 cherry-pick (d7e10ba7f), which conflicted with the squashed PR 10 in main (9c6ccb0bc) β same content, different SHAs. Fixed by resetting to freshorigin/mainand cherry-picking only the PR 11 commit. Main's new commits#2922(tracked changes in headers/footers) and#2796(image rendering) auto-merged cleanly against PR 11.PR Stack (SD-2563: Dumb Painter Refactor)
Status legend: β merged to
mainΒ· π closed when merged into stack parent, not inmainyet (need to re-open stacked on top of this once it lands) Β· π this PRAfter this lands
The downstream PRs (#2829, #2845, #2853, #2906, #2909) need to be reopened as a new stack on top of
mainto finish SD-2563. None of them currently live inmainβ they only merged into their respective stack parents, which never flowed through.