core: add root padding, responsive viewport, and layout diagnostics#121
core: add root padding, responsive viewport, and layout diagnostics#121RtlZeroMemory merged 5 commits intomainfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4caa60a2ba
ℹ️ 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".
| const next = enabled === undefined ? !debugLayoutEnabled : enabled === true; | ||
| if (next === debugLayoutEnabled) return debugLayoutEnabled; | ||
| debugLayoutEnabled = next; | ||
| requestRenderFromRenderer(); |
There was a problem hiding this comment.
Mark view dirty when toggling debug layout
debugLayout() only requests a render-only pass, but the overlay is added by wrapping viewFn in the commit path. Since submitFrame only calls viewFn when plan.commit is true, toggling this flag does not immediately show or hide the overlay and instead waits for some unrelated DIRTY_VIEW trigger. This makes the new API appear non-functional in steady-state screens.
Useful? React with 👍 / 👎.
| }); | ||
| return selected; | ||
| }, | ||
| useViewport: () => compositeRuntime.viewport, |
There was a problem hiding this comment.
Re-render composites when viewport-dependent hooks are used
The new useViewport hook value is exposed to composites, but commit skipping still only tracks app-state selector changes; resize events in the app loop mark layout dirty without forcing a commit. As a result, composites that branch on useViewport() keep rendering stale breakpoint/size output after terminal resize until another view-invalidating update occurs.
Useful? React with 👍 / 👎.
| if (kind === "row" && widthIsFull) { | ||
| delete normalizedConstraints.width; | ||
| if (normalizedConstraints.flex === undefined) normalizedConstraints.flex = 1; | ||
| } |
There was a problem hiding this comment.
Preserve axis semantics for
full size constraints
Converting row.width === "full" to flex: 1 changes meaning based on the parent stack axis, because flex is resolved in the parent main axis. For example, a row inside a column will gain vertical flex (height growth) instead of filling width, so full no longer means full width. This should stay as a width constraint (or % equivalent) rather than being rewritten to flex by child kind.
Useful? React with 👍 / 👎.
Summary
AppConfig.rootPadding) and apply it in layout root boundsAppConfig.breakpoints) and responsive value resolution in spacing/size validation pathsuseViewportapp.debugLayout(enabled?)with an in-app layout summary overlayspace-between|space-around|space-evenly)"full"size alias support in constraint validation/resolutionValidation