CodeRibbon / CodeRibbon-Theia

(WIP) Theia Extension implementing the CodeRibbon workspace
22 stars 1 forks source link

save/restore of widget content #15

Open robobenklein opened 1 year ago

robobenklein commented 1 year ago

https://github.com/eclipse-theia/theia/blob/v1.29.0/packages/core/src/browser/shell/application-shell.ts#L604

getLayoutData still contains unserialized widgets, so conversion happens outside the application-shell scope, therefore we need to be compatible enough with DockPanel that the outer code behaves the same.

https://github.com/eclipse-theia/theia/blob/v1.29.0/packages/core/src/browser/shell/shell-layout-restorer.ts#L156

getLayoutData from the AS is called by restorer

deflate: https://github.com/eclipse-theia/theia/blob/v1.29.0/packages/core/src/browser/shell/shell-layout-restorer.ts#L191

Assumes property names must match exactly widget or widgets by isWidget(s)Property...

Widget itself if stateful should provide storeState(), but looks like CR Patches will mostly be subject to the widget manager's whims: https://github.com/eclipse-theia/theia/blob/v1.29.0/packages/core/src/browser/widget-manager.ts

So in the end maybe a patch should not be reported as a first-class widget? (We could dig into it via our own serializer)

robobenklein commented 1 year ago

went with this, patches are no longer serialized as widgets, but as our own serialize type and thus need some extra things to be implemented...

it's closer to the atom implementation, but I'll make some changes given this opportunity anyways

robobenklein commented 1 year ago

https://github.com/CodeRibbon/CodeRibbon-Theia/commit/a32c2691416856e3ca89d5ad4b358a2d768b2d33

It's just the darn sizers at this point, and the restore function works perfectly fine after the main application view is ready, but not during the restoreLayout?

Clearly my own restoreLayout does what it intends: image

After this, application goes from attached_shell to initialized_layout, so far so good, but then on the next IBL update:

image

And thus the sizer data is lost?

robobenklein commented 1 year ago

Also probably related to the sizers problem, but scroll-position gets messed up after deserialize as well. Looking like something is adjusting the layout during the load process?