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
Support reparenting views during drag and drop without destroying and recreating them #100147
Comments
@jrieken made it moveable, can you verify it functions as expected when moved |
To Verify:
|
@jrieken can you please take a look at why the view is not preserving its state? I have made the view moveable and it seems to work but I don't think the view is handling rehydration properly. |
I don't know why it wouldn't keep its state. What's the API contract on a view? Is more than reparenting happening? |
Oh, wow. Debugged this. The view is disposed and re-created... That's unexpected because the refactor preview view has no way to "globally" infer its input. The view gets opened and set with input which it then expects to hold until refactoring is done... |
@sbatten What is the design here? Should all views keep their state externally so that they can get disposed and re-created? Is there other views from which I can do monkey-see-monkey-do? |
For most of our tree views, they get to keep state with the Tree Registry. Something that has state but doesn't benefit from that is Search. Search writes state so that the fields will remain upon re-creation, but it doesn't keep the search results state. @sandy081 and I talked about having some eventing for views to serialize and deserialize their state when moved, but it hasn't been a major issue as most views aren't that stateful it seems (at least not in any way different from their initial hydration steps). at present, views are on their own to preserve state. |
This is really unexpected and big challenge for the refactor preview because it works as "passive" view. What I mean is that it doesn't have a source from where to display data. There is a part that calls |
Discussed with @jrieken and it seems this view cannot be recreated using state as it is passive as Joh mentioned. This is similar to tree view that keeps its UI piece in the model and just re-attach it on view creation. I would suggest to pull this concept to views framework and let the consumers use this. In short this is reparenting views. |
Version: 1.46.0
Commit: a5d1cc2
Date: 2020-06-10T08:59:04.923Z
Electron: 7.3.1
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Linux x64 5.3.0-59-generic
Steps to Reproduce:
1.trigger the refactoring preview window;
2.drag it to wherever you like ---- oops, cannot drag them
and yes it can be reproduced on the Insider version
Does this issue occur when all extensions are disabled?: Yes/No
Yes
The text was updated successfully, but these errors were encountered: