Skip to content

Conversation

CarlosNZ
Copy link
Owner

@CarlosNZ CarlosNZ commented Oct 1, 2025

Fix #62

@CarlosNZ CarlosNZ requested a review from Copilot October 1, 2025 10:37
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 implements support for 1-indexed arrays by adding an arrayIndexFromOne option that allows array indices to be displayed starting from 1 instead of 0.

  • Adds a new arrayIndexFromOne boolean prop to the JsonEditor component with a default value of false
  • Updates the KeyDisplay component to handle numeric array indices and offset them by 1 when the option is enabled
  • Adds a demo checkbox to test the new functionality

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/types.ts Adds arrayIndexFromOne prop to interfaces
src/JsonEditor.tsx Adds default value and passes the prop through
src/ValueNodeWrapper.tsx Extracts and passes the prop to KeyDisplay
src/CollectionNode.tsx Extracts and passes the prop to KeyDisplay
src/KeyDisplay.tsx Implements the 1-indexing logic for numeric keys
demo/src/App.tsx Adds demo UI for testing the feature
README.md Documents the new prop and adds changelog entry

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@CarlosNZ CarlosNZ requested a review from Copilot October 1, 2025 10:40
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

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@CarlosNZ CarlosNZ requested a review from Copilot October 1, 2025 10:42
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

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@CarlosNZ CarlosNZ merged commit ceef7b0 into main Oct 1, 2025
@CarlosNZ CarlosNZ deleted the 62-1-indexed-arrays branch October 1, 2025 10:43
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.

Option for 1-indexed arrays

1 participant