Skip to content

#214 Fix root left padding when value is primitive #215

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 11, 2025

Conversation

CarlosNZ
Copy link
Owner

Fix #214

@CarlosNZ CarlosNZ requested a review from Copilot July 11, 2025 05:25
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes incorrect left padding on root-level primitive value nodes by only applying indentation when a node has a parent.

  • Add conditional check on parentData to skip indentation at the root.
  • Updated inline style to use 0 when parentData is null.
Comments suppressed due to low confidence (1)

src/ValueNodeWrapper.tsx:349

  • Consider adding a unit test or snapshot test to cover the case where parentData is null to ensure the root node receives no left padding.
        marginLeft: parentData !== null ? `${indent / 2}em` : 0,

@CarlosNZ CarlosNZ merged commit 2cd2be3 into main Jul 11, 2025
@CarlosNZ CarlosNZ deleted the 214-fix-root-padding-when-data-type-changes branch July 11, 2025 05:27
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.

Left spacing/padding of rootName changes depending on whether content is object or primitive
1 participant