devtools-next icon indicating copy to clipboard operation
devtools-next copied to clipboard

Differentiate between `vue inspector` and `component tree inspector`

Open maxirozay opened this issue 2 years ago • 9 comments

I just updated all my vue/vite dependencies and installed vue-devtools 7.0.21. I'm on macOS Sonoma 14.4.

When I use the target button inside the components tab, the devtools is minimized, I can select a component on my website and it will open in the devtools. Everything works very well.

When I do the same with the main target button next to the vue icon, the devtools is not minimized, it doesn't do anything in the devtools and open the file with a broken vim in vscode (I can't use vim commands, whatever I do will insert some characters). Basically it does the same as the "open in editor" button does.

Also if I click again on the target it doesn't stop the component selection so it doesn't seem like it's a toggle like its title suggest.

Shouldn't the 2 target button have the same behavior (especially the fact that the devtool is hidden to select the component)? When the component is opened in the editor is it possible to open the file directly in vscode instead of creating a vim session in the current terminal?

maxirozay avatar Mar 26 '24 09:03 maxirozay

Do you mean the open in editor feature? You can follow the documentation to configure it.

webfansplz avatar Mar 26 '24 12:03 webfansplz

I mean the main target button next to the vue icon at the bottom (you can also see it when the devtools is minimized), it act like the open in editor button from the components tab and not like the target button in the component tab. So I guess yes it's this feature and it's on purpose which is useful but then why not also hide the devtools when you click on it ?

Thank you for the doc. I installed the code command and the VUE_EDITOR=code env. They both work, I restarted everything and it still open the file with vim inside my vscode terminal. I get the following warnings before it opens vim.

Vim: Warning: Output is not to a terminal
[0] Vim: Warning: Input is not from a terminal

maxirozay avatar Mar 26 '24 14:03 maxirozay

IMO those two buttons should have different icons since they have different behaviors.

image

xuzuodong avatar Mar 29 '24 02:03 xuzuodong

Agree with that, PR welcome.

alexzhang1030 avatar May 07 '24 01:05 alexzhang1030

It can be an "edit" pen.

<svg
  xmlns="http://www.w3.org/2000/svg" style="height: 1.1em; width: 1.1em; opacity:0.5;"
  :style="vueInspectorEnabled ? 'opacity:1;color:#00dc82;' : ''" viewBox="0 0 24 24"
>
  <g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2">
    <path d="M4 16 L18 2 L22 6 L8 20 L2 22Z" />
  </g>
</svg>

This one may be a bit too simplistic. If you have a specific icon I can make a PR.

maxirozay avatar May 07 '24 09:05 maxirozay

You can choose one from iconify, then use it by unocss-icon-preset.

Commonly it will be class="i-<icon-name>", like this class="i-carbon-moon"

alexzhang1030 avatar May 08 '24 03:05 alexzhang1030

In the overlay package there's no unocss package installed and the target icon is the svg that I edited and pasted in my previous comment. I can copy an icon from iconify to replace the current svg.

maxirozay avatar May 08 '24 07:05 maxirozay

In the overlay package there's no unocss package installed and the target icon is the svg that I edited and pasted in my previous comment. I can copy an icon from iconify to replace the current svg.

Oh, then svg will be good

alexzhang1030 avatar May 08 '24 08:05 alexzhang1030

I made a PR with the this icon, I can use another one if there's better.

maxirozay avatar May 08 '24 08:05 maxirozay

Closed via #372

alexzhang1030 avatar Jun 16 '24 13:06 alexzhang1030