devtools icon indicating copy to clipboard operation
devtools copied to clipboard

You can't copy the uri or any other information there in network tools

Open rafaelfernandesx opened this issue 1 year ago • 10 comments

<-- Please describe your problem here. Be sure to include repro steps. --> You can't copy the uri or any other information there in network tools image


DevTools version: 2.34.3 IDE: VSCode Connected Device: CPU / OS: arm64 (64 bit) ios Connected app type: Flutter native (debug build) Dart Version: 3.4.0 Flutter Version: 3.22.0 / stable Framework / Engine: 5dcb86f68f / f6344b75dc

rafaelfernandesx avatar Aug 12 '24 13:08 rafaelfernandesx

Could you try with latest stable Flutter version and therefore latest stable DevTools version?

julemand101 avatar Aug 12 '24 16:08 julemand101

Could you try with latest stable Flutter version and therefore latest stable DevTools version?

I updated but I still can't copy it

rafaelfernandesx avatar Aug 13 '24 18:08 rafaelfernandesx

Are you trying to copy from the Network profiler while embedded in VS Code? Also how are you trying to copy (ctrl / cmd + C, right-click + copy)?

CC @DanTup do we expect our post message workaround to be robust? If not, under what conditions is copying from VS code expected to be broken? is there anything we can do to push harder on VS Code here to fix the underlying issues?

kenzieschmoll avatar Aug 14 '24 21:08 kenzieschmoll

Are you trying to copy from the Network profiler while embedded in VS Code? Also how are you trying to copy (ctrl / cmd + C, right-click + copy)?

CC @DanTup do we expect our post message workaround to be robust? If not, under what conditions is copying from VS code expected to be broken? is there anything we can do to push harder on VS Code here to fix the underlying issues?

I've been trying both ways you mentioned, but to no avail.

rafaelfernandesx avatar Aug 15 '24 16:08 rafaelfernandesx

Facing same issue. Needs fix

Istiak-Ahmed78 avatar Aug 16 '24 08:08 Istiak-Ahmed78

CC @DanTup do we expect our post message workaround to be robust? If not, under what conditions is copying from VS code expected to be broken? is there anything we can do to push harder on VS Code here to fix the underlying issues?

The workaround is only for explicit calls to postMessage with command: "clipboard-write" (copyToClipboardVSCode()) which is used by the copy button in DevTools. Unfortunately keys like Cmd+C (and even Cmd+A) just don't seem to work at all in webviews in VS Code (although only for macOS, everything is fine for other OSes). Unfortunately I haven't been able to come up with any other workaround to capture the keypresses to try and do something ourselves (we basically never hear about the keypress, like something else has swallowed it).

The related VS Code issue is at https://github.com/microsoft/vscode/issues/129178 and I made a repro of the issue for it (without DevTools) at https://github.com/DanTup/vs-code-webview-copy-paste.

I think the best way to raise the priority for VS Code would be to get more 👍 's on https://github.com/microsoft/vscode/issues/129178. There are a lot of other issues that have been closed as a dupe of it, but it only has 41 so far.

There is also a slightly related issue in Flutter at https://github.com/flutter/flutter/issues/142040, where you can select text without it having focus, so pressing Ctrl+C can copy something different (or nothing). I don't know which of the two issues are affecting those posting above though (if not on macOS, probably the latter, but otherwise probably the VS Code issue).

DanTup avatar Aug 19 '24 11:08 DanTup

@elliette since this is a big complaint from our users, WDYT about adding copy buttons for each tab for a specific request/response?

  • Response tab has an existing Copy-to-clipboard button.
  • Request tab has an existing Copy-to-clipboard button, if there is a request body.
  • Headers tab does not. This tab has 3 collapsible sections (at least?) inside, displayed vertically: General, Response Headers, Request Headers. Maybe each section can get it's own copy button.
  • Overview tab does not.

srawlins avatar Oct 10 '25 19:10 srawlins

I would suggest we use the same copy button for all tabs which is displayed for the response / request tabs but make it more discoverable. Currently the UI is not great. I think if we got rid of the outline around the auto/text dropdown (which I also think should have a tooltip to make it more clear what it does), added a bit more padding between the dropdown and copy button, and turned it into an icon+text button 📋 Copy response that would help a lot with discoverability.

Image

Along with this, I think every item in each panel should have a copy button as well, aligned to the right of the screen. E.g.

Image

elliette avatar Oct 14 '25 18:10 elliette

I also think we should update the "copy" button in the table:

Image
  1. Add "Actions" to the column header
  2. Instead of the three-dots that show up when you hover make it an explicit dropdown
  3. Add more options (e.g. "Copy all"
  4. Make sure it works for socket requests too (does not show up for sockets)

elliette avatar Oct 14 '25 19:10 elliette

@elliette @srawlins I have a fix for Cmd+C when embedded in VS Code at https://github.com/flutter/devtools/pull/9472, but I haven't marked is as fixing this issue because I'm not sure if everything you might want to copy is selectable here, so you might still want to make changes.

DanTup avatar Oct 16 '25 15:10 DanTup