Skip to content
This repository has been archived by the owner on May 25, 2021. It is now read-only.

feature: show component name when selected with mouse #641

Closed
born2net opened this issue Sep 12, 2016 · 5 comments
Closed

feature: show component name when selected with mouse #641

born2net opened this issue Sep 12, 2016 · 5 comments
Assignees
Milestone

Comments

@born2net
Copy link

born2net commented Sep 12, 2016

Hi guys,
great job on this project!
one thing that is most desired is the ability to select a component with the mouse, and have Augury show you the component name (props etc would be nice, but component name would be most useful).

Is this available? or missing feature?
I would imagine it would be the first feature to be added as I am working on a VERY large scale ng2 app with hundreds of components and it's hard for me (and new devs) to know which component is which, this would be a tremendous help!

I know you can navigate the tree in the Augury console, but being able to do it on the UI (kind of like what google has with mouse selection on HTML elements) would be awesome!

(see below for the google equivalent arrow icon for HTML)
capture

Angular 2 Kitchen sink: http://ng2.javascriptninja.io
and source@ https://github.com/born2net/ng2Boilerplate
Regards,

Sean

@xorgy
Copy link
Contributor

xorgy commented Sep 12, 2016

This is an excellent idea and we're looking in to it.

@born2net
Copy link
Author

born2net commented Sep 12, 2016

GREAT tx...
FYI, what I have done as a workaround in my is to add to each template:
<small class="debug">{{me}}</small>
and in controller I do:

this['me'] = Lib.GetCompSelector(this.constructor)

and GetCompSelector is:

static GetCompSelector(i_constructor){
        var annotations = Reflect.getMetadata('annotations', i_constructor);
        var componentMetadata = annotations.find(annotation => {
            return (annotation instanceof ComponentMetadata);
        });
        return componentMetadata.selector;
    }

and the end result is what you see here:

capture

and I can simply disable it in release mode via CSS.

Angular 2 Kitchen sink: http://ng2.javascriptninja.io
and source@ https://github.com/born2net/ng2Boilerplate
Regards,

Sean

@born2net
Copy link
Author

just wondering if any news on this..
tx as always...

@mobinni
Copy link
Contributor

mobinni commented Nov 11, 2016

@born2net I started researching this feature request, and started with a base implementation. Once we discuss it with the team further I'll be able to give you an update.

@born2net
Copy link
Author

Great, appreciate it!!!!

mobinni pushed a commit that referenced this issue Nov 21, 2016
* Potential feature request to select element components off the DOM

* work in progress, waiting on feedback from Steven for certain issues

* Figured out how to highlight components based on hover, however clearing the is still something that needs to be figured out. For now the highlight recursively is added, so every hover a new layer of highlight is added (bug) - Talked to sumit about it, we're planning a knowledge transfer next week

* initial working version complete. On hover the element gets highlighted in the DOM, on click the element will be selected in augury

* Added css hot-reloading, finished feature to DOM select attributes and link them to Augury panel.

* Potential feature request to select element components off the DOM

work in progress, waiting on feedback from Steven for certain issues

Remove CircleCI upload to S3 (#780)

* Figured out how to highlight components based on hover, however clearing the is still something that needs to be figured out. For now the highlight recursively is added, so every hover a new layer of highlight is added (bug) - Talked to sumit about it, we're planning a knowledge transfer next week

* initial working version complete. On hover the element gets highlighted in the DOM, on click the element will be selected in augury

* Added css hot-reloading, finished feature to DOM select attributes and link them to Augury panel.

* fixed highligher tests

* remove unnecessary console.logs and semi-colon

* fixed colour issue dark mode

* fixed issue with element selection not triggering tab selection on current element, now when you start the selection procedure and you are on another tab you will be redirected to the component tree for your selection to be shown

* fix debug element error

* added new selection icon

* finished refactoring based on suggestions from @clbond

* code cleanup, reduced side effects in code
@mobinni mobinni closed this as completed Nov 24, 2016
@mobinni mobinni added this to the 1.2.6 milestone Nov 28, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants