Repository navigation
feat(core): measure preview stage layout and styles over the editing port - #8937
Merged
Merged
Conversation
Contributor
Edit accuracy: accurate 273 (base branch 271), smooth 68 of thoseThe gate passes. Newly passing (2)
Not banked yet, reported and not gated (bank a full-grid run's baseline.json) (2)
Quarantined, measured but not gated (0) |
vanceingalls
approved these changes
Nov 26, 2026
vanceingalls
left a comment
Collaborator
There was a problem hiding this comment.
No blocker at 0fef52b. Approving.
Checked what the brief asked about:
- Request is bounded on both sides.
parseStageMeasureParams(stageMeasure.ts:44-54) only takes empty params ormaxItemsas a safe integer in 1..2000.measurePreviewStagerefuses badmaxItemsbefore sending (previewStageMeasure.ts:112-117). The frame-side walk stops at the limit (stageMeasure.ts:53-56). - No hang.
previewRequestgoes throughclient.request, which defaults toEDITING_REQUEST_TIMEOUT_MS(5s, editingPort.ts:263). A timeout becomesnull. - Frame-supplied lists are bounded before iteration with
isMessageList:reply.itemsagainstlimit(previewStageMeasure.ts:121-125) andclipKeysagainstMAX_STAGE_CLIP_KEYS(line 52). Every string is length-bounded, numbers must be finite, extra fields are dropped. One reply per request, so no message flooding. - Read-only, and only on the editing port that is gated on the Studio preview mark. A test covers render pages.
- "fails without the fix:" line is in the body and names real tests at this head (stageMeasure.test.ts, previewStageMeasure.test.ts).
- All CI checks at this head finished with no failures.
Small nit, not blocking: the body names the test files, not the test titles.
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.
What changed
stage-measurerequest to the runtime editing port (packages/core/src/runtime/editing/stageMeasure.ts, wired intopackages/core/src/runtime/editingPort.tsandpackages/core/src/runtime/editingAgent.ts).document.bodyin document order up tomaxItems(hard-capped atMAX_STAGE_ITEMS = 2_000), skipping non-visual tags (SCRIPT,STYLE,TEMPLATE,NOSCRIPT,LINK,META).data-hf-id,id, tag, parent key, direct-child own text,fontSize,color,background,placed,visible, composition-scoped.clipkeys (clipKeys),hasElementChildren, direct-text range start (textStart),hasBackgroundImage, andtruncated.STUDIO_PREVIEW_MARK_META) and never connects on render pages.measurePreviewStageandreadStageMeasuredIteminpackages/studio/src/player/lib/previewStageMeasure.tsand exportedmeasurePreviewStage, limits, and result types frompackages/studio/src/index.ts.maxItemsbefore sending and validates and bounds every field of the frame reply (item count, finite box and text-start numbers, bounded strings, booleans, boundedclipKeys), returningnullif the frame is unavailable or any field is malformed.No visible change
This PR adds a read-only editing-port request and a library wrapper in
@hyperframes/studio(.tsfiles only; no.tsx,.css,.html, or binary files changed) with no visible UI change yet.What I measured
oxfmt --write+oxlinton all 9 added/modified files: 0 warnings, 0 errors.@hyperframes/core buildand@hyperframes/studio build: passed.fallow audit --base origin/main --fail-on-issues: 0 dead code, 0 complexity, 0 duplication issues.node scripts/verify-packed-manifests.mjs: all 15 packages verified publish-safe and withinscripts/package-size-budgets.json(252 packed exports resolved, 234 Node exports executed).packages/core:lint:runtime-preview-guardspassed,typecheck(includingtsconfig.runtime.json) passed, runtime contract and runtime fixture boundary checks passed; editing tests (stageMeasure.test.ts,editingPort.test.ts,editingAgent.test.ts) passed 3x with--sequence.shuffle(208/208 x3). Fullpackages/coretest suite: 354/355 files passed (7424/7425 tests; 1 unrelated host-umask failure insrc/cacheDir.test.ts).packages/studio:typecheckpassed; preview channel/element/stage-measure tests (previewStageMeasure.test.ts,previewElements.test.ts,previewChannel.test.ts) passed 3x with--sequence.shuffle(83/83 x3).packages/producer: 123/124 unit test files passed (1632/1633 tests; 1 unrelated MPEG-TSffprobecrash on this host incaptureHdrResources.test.ts).packages/engine:urlDownloader.runtimes.test.tspassed (2/2); fullpackages/enginesuite had 4 unrelated host MPEG-TSffprobe/ffmpegfailures and timed out at 300s under local cap before finishing all 223 files (CI runs the full matrix).maxItemscap instageMeasure.tsfailssrc/runtime/editing/stageMeasure.test.ts; disabling per-item validation inpreviewStageMeasure.tsfailssrc/player/lib/previewStageMeasure.test.ts.What I did NOT exercise
packages/engine223-file suite completion locally (left to CI due to host MPEG-TSffprobefailures and local runtime budget).