-
-
Notifications
You must be signed in to change notification settings - Fork 535
DataGrid: Fixes Toggleable for DetailRow #6050
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
base: rel-1.7
Are you sure you want to change the base?
DataGrid: Fixes Toggleable for DetailRow #6050
Conversation
The test doesn't pass, because it goes against the idea of
I am not sure what was the intention for Is there something behind such behavior @stsrki ? With |
Based on a name, yeah, it should not be able to toggle it. But I was not the original creator, so I'm not sure. @David-Moreira any chance you could remember this? |
Oh man, having to remember things developed centuries ago!! I.e Practical example :
So as you can see, by enabling or disabling the flag you can have slight variations of the behaviour and that's why it exists and also why it's important to have nice examples of these variations in the docs, because the more flags you have the harder it is to understand the different outcomes. Also the thing with evolving features, trying to keep old behaviours in, while allowing new behaviours... The behaviour I described is what I remember and might not be working exactly as I described, but I believe it should. #3008 - PR that introduces new mechanism for handling DetailRow Edit: Might be useful to read the release notes of these PRs, since the PRs themselves don't have alot of information unfortunately. |
PS: I was just looking briefly at the code of this PR, it seems that we'll might be loosing the behaviour that I explained and this will be a breaking change, but I'm not sure please check The new code seems to only call the SetRowDetail function ONLY if Toggeable is set to true, where before it would always call it, so I'm not 100% this logic is equivalent to the one before. Although I like the idea of the change to simplify SetRowDetail. It's of note that this is a public api and I beleive it's also a breaking change for whoever that might be using that "special" logic. Edit2: On a separate note regarding conventions I don't think we use new suffixes to represent arguments that mutate state. If we were to be explicit about it mutating no matter what, I think we've used "force" prefix before? Anyway that's up to you guys, just a kind suggestion regarding that particular suffix. |
@David-Moreira thank you very much for taking the time to help us!! |
Yes, thank you for the intervention.
That's actually true and it answers the original question: "How to prevent the closing of the Who would have thought that the answer would be "by returning Which means this PR is no longer needed—at least not for fixing the bug. What I don't like is the absolutely overengineered solution where one state is controlled in three different ways that interact with each other in unpredictable ways (unless you are the author of the code).
The only one that makes sense is the forced toggle—it does exactly what the name/argument suggests. I understand the overengineering came from stacking up features over time. It would require some breaking changes, but I can imagine a simple solution where variable naming makes sense and actually does what it’s supposed to do. I feel like I know the answer, but I’ll ask anyway: @stsrki Is it something worth fixing? |
Glad I could help.
While I am not the original author of the feature, I am indeed the author of the refactoring of this feature and the adaptations that came next. If you can come with a simpler solution that is clearer and complies with every feature without breaking things for users..., hey, it's always worth it in my opinion!! Of course, you and @stsrki are the one's that have to decide that. :) Again, glad I was helpful, just let me know if you need anything. |
Hm, that might have sounded like I was "bashing" you for knowing "what’s actually going on." It's quite the opposite — I'm glad you shared your knowledge and took the time to explain it to us.
Ha ha - No, I don't think so. It would have to be a breaking change. |
Converting to draft until we figure out what to do here. If it's a breaking change or behavior, then we will do it in the next release. If at all. |
Description
Closes #6049
SetRowDetail