-
Notifications
You must be signed in to change notification settings - Fork 45.6k
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
Conversation
1adc9e1
to
13ca3a9
Compare
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. |
@bvaughn You're right, what about just having {isSelected ? `[${element.children.length}]`: null} |
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 😄 |
@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? |
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? |
@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 |
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. |
@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 |
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. |
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 |
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. |
I appreciate too 👍🏻 |
I'm going to close this issue for now. We can re-open it later if feedback changes :) |
For knowing numbers of children by hover or select element