Layout/Widget State Change

Hi, I am trying to sync the state between two theia editors (same instance). Basically I am opening the same instance in 2 different browser windows, and I want changes made to the widgets/layout to reflect in the other window. Right now I have it working by hooking into storeLayout and restoreLayout. I replaced local storage with a websocket service. My problem is that the layout object gets very large, and is not efficient to send the entire object whenever something is changed. I am working on using diff-merge-patch to make the payload smaller.
My main objectives are:

  1. Listen for any changes to the layout state
  2. Send only the changes that were made to the other client to update the layout

Any ideas? I’m thinking I will have to just hook into all layout/widget events and send them over the web socket and call the same methods on the other client, I just really liked using The store/restoreLayout because it keeps everything in sync and allows both clients to use the same terminal(s), but the payload is just too big right now.

I don’t think there are events which we notify about layout change. The shell is only aware about how widgets are added to it, how individual widgets are composed and layout stuff inside that’s its own secrets.

1 Like