refactor(core): size and filter viewports by canvas#10475
Open
ibgreen-openai wants to merge 5 commits into
Open
refactor(core): size and filter viewports by canvas#10475ibgreen-openai wants to merge 5 commits into
ibgreen-openai wants to merge 5 commits into
Conversation
This was referenced Jul 23, 2026
…anvas-view-layout
ibgreen
marked this pull request as ready for review
July 23, 2026 18:24
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b73e172efb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
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.
Goal
Teach the existing
ViewManagerto lay out and select views by presentation canvas without introducing a second canvas-size tracking system.Why this is needed
Deck.widthandDeck.heightdescribe the default canvas, but views assigned to different presentation canvases must use each canvas's own CSS-pixel dimensions. luma's existingCanvasContext/PresentationContextalready owns resize observation, CSS dimensions, device-pixel ratio, and drawing-buffer dimensions.This PR therefore adds only an optional internal
getCanvasContext(canvasId)callback.ViewManagerreadscontext.getCSSSize()when constructing viewports and controller viewports; it does not maintain a size map, size cache, resize observer, or duplicate drawing-buffer bookkeeping. The follow-up feature PR invalidates the existing viewport layout when luma reports a presentation-canvas resize.Changes
ViewManager.width/heightwhen no context lookup is supplied.{canvasId}) and combined canvas/pixel queries ({x, y, canvasId}).Review scope
Only
modules/core/src/lib/view-manager.tsand its existing unit test file. No new public Deck props, canvas lifecycle changes, widgets, presentation code, or parallel size tracking.Validation
yarn test-headless test/modules/core/lib/view-manager.spec.ts test/modules/core/lib/deck.spec.ts --retry 1 --silent— 32 passed.Stack