leva icon indicating copy to clipboard operation
leva copied to clipboard

Customize what is going to be copied / Copy everything together

Open italodeandra opened this issue 4 years ago • 10 comments

As requested by @dbismut on #189 I'm creating this PR so we can benefit from the CI.

italodeandra avatar Apr 05 '21 17:04 italodeandra

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/pmndrs/leva/84XQ6Pqgfth6sZZg2XjJVtW3aa7h
✅ Preview: https://leva-git-fork-italodeandra-master-pmndrs.vercel.app

vercel[bot] avatar Apr 05 '21 17:04 vercel[bot]

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 7a63d43ab991cdb7b991471ab8ecfd5c1baa4704:

Sandbox Source
leva-minimal Configuration
leva-busy Configuration
leva-scroll Configuration
leva-advanced-panels Configuration
leva-ui Configuration
leva-theme Configuration
leva-transient Configuration
leva-plugin-plot Configuration
leva-plugin-bezier Configuration
leva-plugin-spring Configuration

codesandbox-ci[bot] avatar Apr 05 '21 17:04 codesandbox-ci[bot]

⚠️ No Changeset found

Latest commit: 7a63d43ab991cdb7b991471ab8ecfd5c1baa4704

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

changeset-bot[bot] avatar Apr 06 '21 12:04 changeset-bot[bot]

I've just updated from master since I've upgraded deps and I don't want to run a yarn install every time I'm switching branch 😇

dbismut avatar Apr 06 '21 12:04 dbismut

Hey, I think the PR is nice. API wise, I would try to simplify things a bit:

  • Remove hideCopyButton
  • Move copy into titleBar.copy

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).

dbismut avatar Apr 06 '21 12:04 dbismut

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.

italodeandra avatar Apr 09 '21 13:04 italodeandra

@dbismut I was planning on finishing the changes for this PR today. But here are some question I had on your previous comment.

  • Remove hideCopyButton

Why remove the hideCopyButton?

  • Move copy into titleBar.copy

You mean make titleBar a new object and keep copy inside of it instead of having copy at root?

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.

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 avatar Apr 30 '21 17:04 italodeandra

@italodeandra Hey sorry for stalling this, I'm currently focused on react-use-gesture, I'll make sure to review this next week!

dbismut avatar May 01 '21 07:05 dbismut

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 leva states.

Also happy to help with what's left for this ticket if needed.

RodrigoHamuy avatar Aug 22 '22 09:08 RodrigoHamuy

Hi @RodrigoHamuy,

I'm not using leva at the moment. You can continue with this PR if you want. Let me know if you need any help.

italodeandra avatar Aug 22 '22 12:08 italodeandra