Skip to content

core: add root padding, responsive viewport, and layout diagnostics#121

Merged
RtlZeroMemory merged 5 commits intomainfrom
pr/p-core-layout-responsive
Feb 21, 2026
Merged

core: add root padding, responsive viewport, and layout diagnostics#121
RtlZeroMemory merged 5 commits intomainfrom
pr/p-core-layout-responsive

Conversation

@RtlZeroMemory
Copy link
Copy Markdown
Owner

Summary

  • add root viewport padding support (AppConfig.rootPadding) and apply it in layout root bounds
  • add responsive breakpoint support (AppConfig.breakpoints) and responsive value resolution in spacing/size validation paths
  • expose viewport snapshot to composite widgets via useViewport
  • add dev-mode layout diagnostics for min-size overflow, zero-size resolved rects, and collapsed scroll viewports
  • add app.debugLayout(enabled?) with an in-app layout summary overlay
  • accept CSS justify aliases (space-between|space-around|space-evenly)
  • add "full" size alias support in constraint validation/resolution
  • document new debug/layout stack capabilities

Validation

  • npm run typecheck
  • npm run test:packages

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread packages/core/src/app/createApp.ts Outdated
const next = enabled === undefined ? !debugLayoutEnabled : enabled === true;
if (next === debugLayoutEnabled) return debugLayoutEnabled;
debugLayoutEnabled = next;
requestRenderFromRenderer();
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment thread packages/core/src/runtime/commit.ts Outdated
});
return selected;
},
useViewport: () => compositeRuntime.viewport,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment on lines +595 to +598
if (kind === "row" && widthIsFull) {
delete normalizedConstraints.width;
if (normalizedConstraints.flex === undefined) normalizedConstraints.flex = 1;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@RtlZeroMemory RtlZeroMemory merged commit ad24d3a into main Feb 21, 2026
18 checks passed
@RtlZeroMemory RtlZeroMemory deleted the pr/p-core-layout-responsive branch February 21, 2026 06:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant