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

Feature: Copy data displayed in tree node. #697

Open
travrob1 opened this issue Jan 15, 2021 · 4 comments
Open

Feature: Copy data displayed in tree node. #697

travrob1 opened this issue Jan 15, 2021 · 4 comments

Comments

@travrob1
Copy link

I have some redux stores with massive amounts of data. I am able to find the data i need easy enough via the tree view with collapsing and expanding the tree nodes. However, once i have found what i want, i can NOT easily 'copy' that data. If i want to copy, then i need to go into the raw view, but due to the amount of data it becomes a real challenge to find that data i want. I have learned that i can 'pin' data in the tree view, which then makes it easier to search the raw view and get the data i need but still challening. It would be so fantastic if there were another button next to the 'pin' button. that would copy the data.

@markerikson
Copy link

Totally agree that would be useful, or possibly a right-click "Copy" context menu.

Would love to see a PR for this!

@Methuselah96
Copy link
Member

Definitely sounds useful. PRs are welcome.

@puzzlemeter
Copy link

Hello, I am new to this project.
Recently, I changed my job and start learning React&Redux and learning how-to develop browser extension.
(I have experiences with Vue.js. But, actually I was mainly a backend developer using ruby and PHP.)
I don't have react experienced colleagues, so I think this project is awesome to me to dive deep.

In brief, I tried to work on it and looks it works.

redux-devtools2

But there are three questions that I am not sure whether I did it properly.

  1. Is there any preferred clipboard library for the whole project.
  2. Whether I write the function in a correct way.
  3. I didn't made it with a context menu. Any plan about shared context menu components in the future.

Hope can get some ideas. Details below.

First, I read the react-devtools-shared's code and choose clipboard-polyfill as clipboard library.
However, I also find the library react-copy-to-clipboard, looks light and friendly to react.
So, it comes to my first question.

Second, I have not catch up all the structure of this project. Simply add a handler in ActionPreview.tsx.

Third, actually, I didn't use context menu, just add a (copy) beside the (pin).
I tried to do it at the beginning. But I found the project have not yet made any shared context menu components.
Similar to the second question, if I am going to add a context menu, I need to decide where to place the components.
Once it made, may have impact on the whole project.
As a new comer, a little hard to me to make a decision.

@markerikson
Copy link

Hey there, thanks for taking a look at this!

While I'm not the maintainer for the DevTools, I do maintain Redux itself. My suggestion would be to go ahead and put together a complete prototype, and I do think having a context menu pop up when clicking a state item would be the right design choice.

For now, I'd say just pick what you think is the best place for any new files to go, and then file a PR once you've got a first iteration ready to try out. Then we can review it and see if there's a better way to organize things.

FWIW, that's basically what I did when I submitted a PR a couple years ago to add the "action stack trace" feature:

zalmoxisus/remotedev-app#43

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants