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

DevTools: Show numbers of children by hover or select element #21836

Closed

Conversation

behnammodi
Copy link
Contributor

@behnammodi behnammodi commented Jul 8, 2021

For knowing numbers of children by hover or select element

Screen Shot 2021-07-09 at 01 12 18

@behnammodi behnammodi changed the title DevTools: Show numbers of children after hover on element DevTools: Show numbers of children by hover on element Jul 8, 2021
@behnammodi behnammodi changed the title DevTools: Show numbers of children by hover on element DevTools: Show numbers of children by hover or select on element Jul 8, 2021
@behnammodi behnammodi changed the title DevTools: Show numbers of children by hover or select on element DevTools: Show numbers of children by hover or select element Jul 8, 2021
@bvaughn
Copy link
Contributor

bvaughn commented Jul 13, 2021

Out of curiosity, what's the motivation for this feature? I think adding a hover action that changes what's displayed in a row would open up some edge cases (for DevTools automatic tab sizing) that I'd like to avoid unless there's a strong reason.

@behnammodi
Copy link
Contributor Author

@bvaughn You're right, what about just having select instead of hover? I mean:

 {isSelected ? `[${element.children.length}]`: null}

@bvaughn
Copy link
Contributor

bvaughn commented Jul 13, 2021

Same concern would apply there, really. Changing the text in a row would impact the measured width, which could impact our calculated tab sizes– causing things to shift when you click. Not the end of the world, but doesn't seem like a great user experience unless there's a really compelling need for this information. I don't think this is something I've seen anyone asking for. This is why I was curious what your motivation for doing this was 😄

@behnammodi
Copy link
Contributor Author

behnammodi commented Jul 13, 2021

@bvaughn 😃, I know your concern, I'm working on a big project so that is very helpful for me to understand which node has how many children. Also, I think we can show this number inside Tooltip, do you agree?

@bvaughn
Copy link
Contributor

bvaughn commented Jul 13, 2021

I've never seen this feature requested before and I'm still not sure I understand how it's useful. Can you give me an example of how you would use the number of children when debugging a React app?

@behnammodi
Copy link
Contributor Author

@bvaughn Imagine you use a package as 3rd party, and this package render a list by some behavior and interaction, you need to know how many children rendered at moment, so this feature can help you to understand it

@bvaughn
Copy link
Contributor

bvaughn commented Jul 14, 2021

this package render a list by some behavior and interaction, you need to know how many children rendered at moment

I think the part I have misgivings about is...whether this use case is common enough to warrant a top-level feature like this. Seems like it's not something I find myself wondering often.

@behnammodi
Copy link
Contributor Author

@bvaughn I understood, I know this is a specific feature and may it not useful for all, but showing the length of children inside a Tooltip may not have any side effect

@bvaughn
Copy link
Contributor

bvaughn commented Jul 14, 2021

I think every change (even ones like this) have an effect. For example, showing a number on hover (even in a tooltip) might confuse people. That's why I'm trying to determine if a change has a common use case.

@behnammodi
Copy link
Contributor Author

Exactly, but sometimes developers don’t ask for a new feature and try to resolve themselves problems in another way, I mean we have to release some features and analyze it that is useful or not

@bvaughn
Copy link
Contributor

bvaughn commented Jul 14, 2021

Some feature decisions just come down to being judgement calls.

Seems like we don't see eye to eye on this one, unfortunately, but I don't think it's a common enough use case to be added to the main Components tab UI. I may change my mind in the future if I see it come up again in issues or other feedback.

I appreciate your talking about it though, and sharing your use case and thoughts about it.

@behnammodi
Copy link
Contributor Author

I appreciate too 👍🏻

@bvaughn
Copy link
Contributor

bvaughn commented Jul 14, 2021

I'm going to close this issue for now. We can re-open it later if feedback changes :)

@bvaughn bvaughn closed this Jul 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants