docs: finish-the-engine plan — Tier 3 divergences + remaining Tier 2 (#696)#711
Draft
jedrazb wants to merge 11 commits into
Draft
docs: finish-the-engine plan — Tier 3 divergences + remaining Tier 2 (#696)#711jedrazb wants to merge 11 commits into
jedrazb wants to merge 11 commits into
Conversation
Author the engine-spine-tier2 OpenSpec change: proposal, design (engine class + EngineHost DI seams, divergence resolutions, forced 5-step sequence), 6 capability specs, and tasks. Grounded in a file:line map of the layout pipeline, PM view lifecycle, transaction loop, and load/save seam in both adapters. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Fold in eng-review findings (timing-equivalence requirement+test, visual-baseline repair pre-req, Vue scheduler consumer audit, Vue DocumentAgent prereq) and the outside-voice premise challenge. Spike (SPIKE.md) resolves run()'s real input contract (derives geometry from document; getPageSize/getMargins already core) and finds load/save is a source-of-truth inversion, not a sequence lift. Recommendation: ship the clean half (layout+scheduler+loop) first; views+session is a second decision gated on #89. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Move getColumns/columnWidthForSection/computePerBlockWidths/twipsToPixels from React's internals/columnLayout into core layout-bridge/sectionGeometry alongside the existing getPageSize/getMargins/resolveHeaderFooter. React delegates; this is the geometry-resolution layer the Tier 2 engine derives from sectionProperties. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The 6-step layout compute (PM doc → flow blocks → measure → HF resolve → margin extension → layoutDocument + footnote stabilization → footnote render items) moves out of React's useLayoutPipeline into a pure, framework-neutral core function. React now calls computeLayout and keeps only the DOM paint + scroll/events (where the framework timing lives). measureBlocks is the one injected seam (each adapter passes its caching measurer). Behavior-preserving; Vue migrates onto the same function next. Part of the #696 Tier 2 engine spine (clean half: layout compute). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Vue's inline compute pass (which lacked column / per-block-width support) is replaced by the same core computeLayout React now uses, keeping only the paint (renderPages + container styling + SDT focus). Vue gains column layout and per-section measurement for free; behavior-identical for single-column docs. Part of the #696 Tier 2 engine spine (clean half: layout compute). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Lift React's rAF-coalescing layout scheduler into core/editor/layoutScheduler (createLayoutScheduler). React wires to it via a runRef so the stable scheduler always calls the latest pipeline; Vue routes its body doc-change relayout through it too, so a burst of keystrokes lays out once per frame instead of synchronously per keystroke. The selection overlay still waits via LayoutSelectionGate. scheduleFrame is injectable so headless/test hosts run synchronously. HF relayout stays synchronous in both (unchanged). Part of the #696 Tier 2 engine spine (clean half: scheduler). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…n edit Lift React's UPDATED_SCROLL strip (and its drift canary) into core/editor/scrollFlag and apply it in Vue's body dispatchTransaction too. Vue's hidden off-screen editor previously had no strip, so an edit could yank an ancestor's scroll to the caret; it now matches React. The dispatch orchestration itself stays adapter-side (the reactivity models differ). Part of the #696 Tier 2 engine spine (clean half: transaction loop). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ncel) - Lift the duplicated blockLookup build into core layout-painter (buildBlockLookup); both adapters call it. - Cancel the layout scheduler in Vue destroyEditorView so a reload can't repaint the old document against the new one's geometry. - Fix stale step-count in computeLayout docblock. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…plan Scope the work after the #710 clean half: the silent React/Vue divergences surfaced by routing both through one computeLayout (HF resolution, Vue render- option gaps, intentional comment/overlay divergences, column-width engine limitation), each with a canonical resolution + parity fixture; plus the deferred Tier 2 half (view lifecycle, and the load/save source-of-truth inversion gated on #89). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
All contributors have signed the CLA ✍️ ✅ Posted by the CLA bot. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Draft. Scopes the work after the #710 clean half so the engine unification can be finished. Stacked on #710 (base
feat/engine-spine-tier2); this PR's diff is only the OpenSpec planning.Tier 3 — resolve the silent divergences
Routing both adapters through one
computeLayout(in #710) surfaced places where React and Vue render/behave differently for the same document with no test catching it. Theengine-divergence-tier3change records a canonical resolution + a parity fixture for each:final ?? initialsection props but gatestitlePgfrominitial(internally inconsistent); Vue usesinitialfor both. Canonical: resolve and gate from the same section, validated against Word with a multi-section fixture.headerDistance/footerDistance/pageBordersthatcomputeLayoutreturns; canonical is Vue passes the full set (page borders + authored HF distances render in Vue).resolvedCommentIds(Vue has no comment sidebar) and the [Bug] Vue: image selection overlay stays on the old page after the image is pushed to the next page #670 overlayscrollTopoffset are deliberate; document + assert them so they can't silently flip.equalWidth="0"with explicit per-column widths renders equal in both adapters, and mid-documentseparator/equalWidthis dropped. Pre-existing engine limitation now reachable from Vue; decide fix vs document (leaning fix).Remaining Tier 2 — the harder half
rIdHF EditorView create/teardown/writeback behind amountView/destroyViewseam.useHistory/agent/comment-extraction and Vue'sdocument.valuebecoming subscribers. Only worth it if the vanilla-JS package (Add vanilla JS package (@eigenpal/docx-editor-js) #89) is wanted.Open questions for reviewers
See
openspec/changes/engine-divergence-tier3/(proposal, design, spec, tasks).🤖 Generated with Claude Code
Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.