-
Notifications
You must be signed in to change notification settings - Fork 204
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
Customize what is going to be copied / Copy everything together #193
base: main
Are you sure you want to change the base?
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/pmndrs/leva/84XQ6Pqgfth6sZZg2XjJVtW3aa7h |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 7a63d43:
|
hideCopyButton?: boolean | ||
/** | ||
* Change what will be copied when clicking the global copy button | ||
*/ | ||
copy?: (values: unknown) => string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder whether it might sense to group those options similar to the titleBar options?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought of that, but hideCopyButton
works for both Input and Title Bar copy button.
But perhaps I could move copy
into titleBar
? What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any thoughts on this? I was planning on finishing the changes for this PR today.
|
I've just updated from master since I've upgraded deps and I don't want to run a |
Hey, I think the PR is nice. API wise, I would try to simplify things a bit:
The one drawback is that you won't be able to have the global copy while hiding the label copy buttons, but I think that's minor (cc @gsimone @n1ru4l let me know what you think). Regarding the default global copy function, it's a bit inconsistent with the default copy function, since the default one uses input keys, when the default copy function would use input paths (in leva these are two different things, as the path includes folders and subfolders dotted paths). Not a major deal but I thought it was worth mentioning. In terms of aesthetics, I would reduce the size of title bar icons as they look pretty huge now (at one point we'll add undo / redo buttons so we'll need more space eventually). |
Hi @dbismut, I'm open for making the changes but I think I'm not the best person for it. This PR was meant as a POC actually. |
@dbismut I was planning on finishing the changes for this PR today. But here are some question I had on your previous comment.
Why remove the
You mean make
Can you explain to me what is wrong so I can fix it? Because my knowledge of the codebase is very low. I don't even use path on my use-cases. |
@italodeandra Hey sorry for stalling this, I'm currently focused on react-use-gesture, I'll make sure to review this next week! |
Hey @italodeandra @dbismut , any updates with this? I would love to see this happening, and also add a button to paste those values so that you can easily share Also happy to help with what's left for this ticket if needed. |
Hi @RodrigoHamuy, I'm not using |
As requested by @dbismut on #189 I'm creating this PR so we can benefit from the CI.