aframevr / aframe-inspector

:mag: Visual inspector tool for A-Frame. Hit *<ctrl> + <alt> + i* on any A-Frame scene.
https://aframe.io/aframe-inspector/examples/
MIT License
655 stars 203 forks source link

Fixes #56 Copy entity HTML to clipboard #188

Closed fernandojsg closed 8 years ago

fernandojsg commented 8 years ago

Added copy to clipboard icon on the entity panel. It will copy the HTML for the current component and its children.

screenshot 2016-07-10 15 05 41

Icons and style to-be-defined to match the same style for the component's icons (https://github.com/aframevr/aframe-editor/issues/10)

dmarcos commented 8 years ago

If the copy icon is on common it seems that you're going to only copy the common section

dmarcos commented 8 years ago

The icon / label should be better placed on the entity on the scenegraph

ngokevin commented 8 years ago

Advantage on the component panel is to keep the entity copy action in the same place as component copy action. As well as separating management of scene structure (scene graph) from scene data (components panel).

But I agree the current placement makes it seem like you can only copy the common components.

ngokevin commented 8 years ago

Code looks good. Just need to address the UX.

Possible solutions:

dmarcos commented 8 years ago

Renaming common to entity is misleading. All the components below belong to the entity as well. A third solution:

We could make the attributes panel title (and maybe rename to entity) larger to accommodate the copy button. That would break the consistency though with the scenegraph title.

dmarcos commented 8 years ago

As a side note. I think we still need to visually differentiate the commons section from the rest of the components. Commons looks like any other component

dmarcos commented 8 years ago

A fourth solution: We can put the copy button next to the <a-entity> label

ngokevin commented 8 years ago

Third solution addendum, we can make both headers bigger. They do look sort of cramped anyways.

fernandojsg commented 8 years ago

I like the third solution too, I'll make a mockup and we could discuss about it.

fernandojsg commented 8 years ago

What do you think about something like this (Adding the copy to clipboard icon as the third proposed solution by @dmarcos)? I was thinking that probably we could remove the <a-entity> from common and put it in the panel title, so instead of having, like in the screenshot, entitywe could have <a-entity>, <a-box>, <a-entity #box>...

screenshot 2016-07-15 20 26 45
dmarcos commented 8 years ago

The top padding / margin of the titles looks too dark in comparison with the lines that separate the component titles. They should be consistent. component title

fernandojsg commented 8 years ago

@dmarcos I just fixed that, although the menu bar will be remove in the next PR :D

fernandojsg commented 8 years ago

Updated with the last changes regarding the top menu. I've moved the <a-entity> attribute from Common to the title of the sidebar.

screenshot 2016-08-01 18 42 00
fernandojsg commented 8 years ago

@dmarcos @ngokevin what do you think about the new style? ^

dmarcos commented 8 years ago

Maybe the question mark for the docs is too big. We sould make it match the line height of the component title

dmarcos commented 8 years ago

Should we make <a-entity> title larger and increase the contrast? We probably need to emphasize that it's the title for the whole components panel

fernandojsg commented 8 years ago

@dmarcos yep, I'll decrease the size of the icon for help. Re the title, I've made it white and a little bigger, something like this you mean?

screenshot 2016-08-03 01 47 09
fernandojsg commented 8 years ago

Maybe a different color of the title background to make a bigger contrast?

fernandojsg commented 8 years ago

@dmarcos @ngokevin what do you think about adding this functionality as is and then we could create another PR just for style the icons and sidebar title style?

ngokevin commented 8 years ago

I get: <a-entity id="greenBox" geometry="primitive: box" material="color: #0f0" position="4 2 4" rotation="" scale="" visible=""></a-entity>

Should we trim the null values for default components?

ngokevin commented 8 years ago

r+wc adjusting style in another PR sounds good.

fernandojsg commented 8 years ago

@ngokevin do you mean converting this

<a-entity id="greenBox" geometry="primitive: box" material="color: #0f0" position="4 2 4" rotation="" scale="" visible=""></a-entity>

into

<a-entity id="greenBox" geometry="primitive: box" material="color: #0f0" position="4 2 4" rotation scale visible></a-entity>

or directly removing them as they're already default components included in any entity?

<a-entity id="greenBox" geometry="primitive: box" material="color: #0f0" position="4 2 4"></a-entity>
ngokevin commented 8 years ago

I would polish it so it is ready to paste into people's code editors, meaning to remove superfluous stuff that don't matter like rotation="". So yeah, I'd say remove them.

fernandojsg commented 8 years ago

@ngokevin I've implemented removing the default attributes if they've default value, thanks for the idea. the result copy to the clipboard it's more clear now.