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

Position & Axis inputs in a row #389

Merged
merged 1 commit into from
Jul 29, 2024
Merged

Conversation

arjxn-py
Copy link
Member

I saw QuantStack/jupytergis#72 & QuantStack/jupytergis#74 & thought it might be good here as well. Feel free to close this if it's not :)

Before:
image
After:
image

credits: @martinRenou

Copy link
Contributor

Binder 👈 Launch a Binder on branch arjxn-py/JupyterCAD/right-panel

@arjxn-py
Copy link
Member Author

I also did wanted to add x, y & z input labels instead of description for Position & Axis but tbh I wasn't able to exactly determine where and how are we rendering this form. I did saw we're using ObjectPropertiesForm from formbuilder hence tried modifying:

<label htmlFor="">{key}</label>

And also tried updating schema accordingly in placement.json.
But no luck.

@martinRenou martinRenou added the enhancement New feature or request label Jul 29, 2024
Copy link
Member

@martinRenou martinRenou left a comment

Choose a reason for hiding this comment

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

Great thanks! ❤️

tbh I wasn't able to exactly determine where and how are we rendering this form

The form is rendered using https://github.com/rjsf-team/react-jsonschema-form and the https://github.com/deathbeds/jupyterlab-starters/tree/main/packages/jupyterlab-rjsf form renderer.
I don't know this code enough to know if/where we can define such labels. You're also right we have custom logic for rendering some inputs it seems, maybe @trungleduc would know?

Happy to merge this PR as-is for now though. Thanks!

@martinRenou martinRenou merged commit 0e44856 into jupytercad:main Jul 29, 2024
10 of 11 checks passed
@trungleduc
Copy link
Member

the position is defined as an array for float, we would need to convert it into an object of 3 keys x, y, z to render the label but I don't think it is worth the effort.

@arjxn-py arjxn-py deleted the right-panel branch July 29, 2024 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants