Skip to content
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

[editor][client] render array objects in settings properly #902

Merged
merged 1 commit into from
Jan 12, 2024

Conversation

Ankush-lastmile
Copy link
Member

@Ankush-lastmile Ankush-lastmile commented Jan 12, 2024

[editor][client] render array objects in settings properly

Upon loading the OpenAI function calling aiconfig, the editor client does not render the function data. This is because the functions are an array, and the client does not initialize array data.

In this diff, if the Settings data is an array with an initial value, properly set/intiailize and render the array data (inside SettingsPropertyRenderer)

Also updated the object renderer/settings to render json editor for an unspecified Json

Testplan

Load the function calling aiconfig and open the model settings drawer. Notice the functions get rendered.

Modified function call information inside the json editor. Tested the save was successful.

testplan.mov

@Ankush-lastmile Ankush-lastmile changed the title [editor][client] {wip} render array objects in settings properly [editor][client] render array objects in settings properly Jan 12, 2024
@Ankush-lastmile Ankush-lastmile marked this pull request as ready for review January 12, 2024 18:02
Copy link
Contributor

@rholinshead rholinshead left a comment

Choose a reason for hiding this comment

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

Accepting to unblock, but can you also test that changing a setting and saving the config properly persists these generic json settings?

And before landing let's try and get that width sorted out. Please ping me if you can't get it and I can play around with it a bit as well

@Ankush-lastmile
Copy link
Member Author

rebase, updated json editor for model settings to be 350px wide.

Unfortunately getting a weird side effect where updating the json editor inside settings now adds to it than updating.

edit.the.json.editor.inside.mov

@Ankush-lastmile
Copy link
Member Author

fixed some spacing

Upon loading the OpenAI function calling aiconfig, the editor client does not render the function data. This is because the functions are an array, and the client does not initialize array data.

In this diff, if the Settings data is an array with an initial value, properly set/intiailize and render the array data (inside SettingsPropertyRenderer)

Also updated the object renderer/settings to render json editor for an unspecified Json

## Testplan

Load the function calling aiconfig and open the model settings drawer. Notice the functions get rendered.

![testplan](https://github.com/lastmile-ai/aiconfig/assets/141073967/db69dd24-c792-43c1-9341-84eb235c007b)
@Ankush-lastmile
Copy link
Member Author

Unfortunately getting a weird side effect where updating the json editor inside settings now adds to it than updating.

Fixed this by

  1. Initialize itemValues first with propertyValue
  2. Then Initialize itemControls with the resultant itemValues

This way the JSX keys lineup.

Also removed the TODO comment

Copy link
Contributor

@rholinshead rholinshead left a comment

Choose a reason for hiding this comment

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

@Ankush-lastmile Ankush-lastmile merged commit cafd392 into main Jan 12, 2024
2 checks passed
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.

2 participants