Hi there,
...
Related: cool#7951 don't invalidate when creating a new view
In writer the ViewOptions are in the ViewShell and are copied when a new
ViewShell is created from that ViewShell so the dark/light-mode and doc
color are the same in a new view as the old view.
Code looks fine - but I'm a tad confused.
a) why do we not have the correct view options pushed very early in the process of creating a new view, so we don't transition through this 'Default' state ? - I suppose that's most of my confusion.
b) The patch -seems- like we avoid this invalidate by hoping that the new view is populated with theme/etc. state from a previous view - and so we hope that this matches the new view's state that is set on it (presumably coming from the JS client), and that this then sometimes avoids this invalidate on load - but surely that's rather fragile, and a proper fix for a) would be better ?
c) I can believe that the new view should invalidate on load - my concern is/was that other views got an invalidation despite their theme and/or any other state not changing when a different new user joined: but perhaps that was fixed already by some of the other two patches you pushed Caolan ? =)
As regards a proper fix for a) - I was thinking we could push the state we want (perhaps for all components since we may not know document type by then) - as a message before the 'load' command down the websocket - which I assume creates the view after a while.
Even with Ash's re-factoring of startup to speed things up further for 24.05 we will need our own JS running inside the iframe to get the settings we need down the websocket.
Paris: was some thought put into getting this state even earlier and pushing it earlier so we could be sure the view would be created with the right state, and so avoiding switching ? =)
Thanks,
Michael.