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

Consolidate workbench layout & views/panel persistence #61777

Closed
bpasero opened this issue Oct 25, 2018 · 4 comments
Closed

Consolidate workbench layout & views/panel persistence #61777

bpasero opened this issue Oct 25, 2018 · 4 comments
Assignees
Labels
debt Code quality issues layout General VS Code workbench layout issues *out-of-scope Posted issue is not in scope of VS Code workbench-state UI state across restarts
Milestone

Comments

@bpasero
Copy link
Member

bpasero commented Oct 25, 2018

Once the workbench layout is driven by the grid widget (#50853) I suggest we also revisit how layout information and view/panels are persisted.

Today we are leveraging the following keys (some global, some workspace):

Sidebar

  • workbench.sidebar.activeviewletid
  • workbench.sidebar.width
  • workbench.sidebar.hidden

Panel

  • workbench.panelpart.activepanelid
  • workbench.panel.width
  • workbench.panel.height
  • workbench.panel.hidden
  • workbench.panel.pinnedpanels
  • workbench.panel.sizebeforemaximized
  • workbench.panel.location

Activity Bar

  • workbench.activity.pinnedviewlets
  • workbench.activity.placeholderviewlets

Layout

  • editorpart.centeredview
  • workbench.centerededitorlayout.active
  • workbench.zenmode.active

Splash

  • parts-splash-data

View Related

  • scm.views
  • viewservice.workbench.view.{id}.enablement
  • {view-id}.numberOfVisibleViews (e.g. workbench.view.explorer.numberofvisibleviews)
  • {view-id}.state (e.g. workbench.explorer.views.state)
  • {view-id}.state.hidden (e.g. workbench.explorer.views.state.hidden)
  • viewservice.*

I think I would prefer a model where we maybe have just one top level key for this information and then update that when the layout changes. Or at least try to consolidate some keys that belong together.

@sandy081 maybe you yould update the View Related section and outline what purpose these keys serve and if they are required in the future. I am a little bit lost to understand the semantics of the keys you introduced.

@bpasero bpasero added layout General VS Code workbench layout issues workbench-state UI state across restarts labels Oct 25, 2018
@bpasero bpasero added this to the On Deck milestone Oct 25, 2018
@isidorn
Copy link
Contributor

isidorn commented Oct 25, 2018

We should also double check when do we write to storage for these keys, I always try to do it on shutdown, but some of those values can change quite frequently, for example sidebar.witdh and we should only store it at the end, not on every change.

If we change it for one key it might be complicate some things since currently we write from different locations. Also every write would have to write additional information - not sure if that slows things down.

@bpasero
Copy link
Member Author

bpasero commented Oct 25, 2018

@isidorn yeah, though to be fair the storage implementation buffers calls and also will not do anything if the value is equal. The downside of only writing global keys on shutdown is that opening a new window will not get the proper layout values.

@bpasero
Copy link
Member Author

bpasero commented Oct 26, 2018

Another idea is to leverage our memento story better: each workbench part has access to a object to store data and this object will automatically be stored and restored and scoped to the part with its ID. I think it would make more sense to e.g. put the active viewlet and number of pinned viewlets into the sidebar memento (same for panel memento). We should then continue to leverage mementos also for individual views within a viewlet.

@bpasero bpasero added the debt Code quality issues label Dec 7, 2018
@bpasero bpasero added the *out-of-scope Posted issue is not in scope of VS Code label Oct 7, 2019
@vscodebot
Copy link

vscodebot bot commented Oct 7, 2019

This issue is being closed to keep the number of issues in our inbox on a manageable level, we are closing issues that are not going to be addressed in the foreseeable future: We look at the number of votes the issue has received and the number of duplicate issues filed. More details here. If you disagree and feel that this issue is crucial: We are happy to listen and to reconsider.

If you wonder what we are up to, please see our roadmap and issue reporting guidelines.

Thanks for your understanding and happy coding!

@vscodebot vscodebot bot closed this as completed Oct 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
debt Code quality issues layout General VS Code workbench layout issues *out-of-scope Posted issue is not in scope of VS Code workbench-state UI state across restarts
Projects
None yet
Development

No branches or pull requests

4 participants