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

Support reparenting views during drag and drop without destroying and recreating them #100147

Open
NewtMa opened this issue Jun 15, 2020 · 12 comments
Assignees
Labels
feature-request Request for new features or functionality ux User experience issues workbench-views Workbench view issues workspace-edit
Milestone

Comments

@NewtMa
Copy link

NewtMa commented Jun 15, 2020

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

@sbatten sbatten added the workbench-views Workbench view issues label Jun 15, 2020
@sbatten sbatten added this to the June 2020 milestone Jun 15, 2020
@sbatten sbatten added the bug Issue identified by VS Code Team member as probable bug label Jun 15, 2020
@sbatten
Copy link
Member

sbatten commented Jun 15, 2020

@jrieken made it moveable, can you verify it functions as expected when moved

@sbatten
Copy link
Member

sbatten commented Jul 1, 2020

To Verify:

  1. Trigger Refactor Preview
  2. Try to move it to a new location
  3. Verify this works

@bpasero
Copy link
Member

bpasero commented Jul 2, 2020

I find it weird:

  • I can move the references view but when dropped into the sidebar, it does not get active
  • the contents are lost (my refactoring preview)

recording

@bpasero bpasero reopened this Jul 2, 2020
@bpasero bpasero added the verification-found Issue verification failed label Jul 2, 2020
@sbatten sbatten modified the milestones: June 2020, July 2020 Jul 2, 2020
@sbatten sbatten removed the verification-found Issue verification failed label Jul 2, 2020
@jrieken jrieken removed their assignment Jul 3, 2020
@sbatten
Copy link
Member

sbatten commented Jul 6, 2020

@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.

@jrieken
Copy link
Member

jrieken commented Jul 6, 2020

I don't know why it wouldn't keep its state. What's the API contract on a view? Is more than reparenting happening?

@jrieken
Copy link
Member

jrieken commented Jul 6, 2020

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...

@jrieken
Copy link
Member

jrieken commented Jul 6, 2020

@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?

@sbatten
Copy link
Member

sbatten commented Jul 6, 2020

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.

@jrieken
Copy link
Member

jrieken commented Jul 7, 2020

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 setInput on the view which then returns a promise with the approved or modified code action. This is very similar to a dialog or quick pick and the whole model is very transient, the view is only part of an operation and then hides itself. I don't see how dispose/re-create fits into this. How should this be communicated to the actual driver of the view? Must that listen to view dispose and re-create events?

@jrieken jrieken added feature-request Request for new features or functionality and removed bug Issue identified by VS Code Team member as probable bug labels Jul 7, 2020
@jrieken jrieken removed this from the July 2020 milestone Jul 7, 2020
@jrieken jrieken added ux User experience issues workspace-edit labels Jul 7, 2020
@jrieken
Copy link
Member

jrieken commented Jul 7, 2020

@sbatten I have reverted d41bbd3 and I have made this a feature request. Given the dispose/re-create approach this requires serious reworkings of the refactor view

@jrieken jrieken closed this as completed in 03a93a1 Jul 7, 2020
@jrieken jrieken reopened this Jul 7, 2020
@sandy081
Copy link
Member

sandy081 commented Jul 7, 2020

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.

@sandy081 sandy081 self-assigned this Jul 7, 2020
@sandy081 sandy081 modified the milestones: Backlog Candidates, Backlog Jul 7, 2020
@sandy081 sandy081 changed the title reafactoring preview is not a flexiable layout Support moving refactoring preview view Jul 7, 2020
gjsjohnmurray pushed a commit to gjsjohnmurray/vscode that referenced this issue Jul 8, 2020
@sbatten sbatten changed the title Support moving refactoring preview view Support reparenting views during drag and drop without destroying and recreating them Oct 21, 2021
@sandy081 sandy081 removed their assignment Dec 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality ux User experience issues workbench-views Workbench view issues workspace-edit
Projects
None yet
Development

No branches or pull requests

6 participants
@bpasero @jrieken @sbatten @sandy081 @NewtMa and others